-
Notifications
You must be signed in to change notification settings - Fork 1
/
clasF_es.html
54 lines (52 loc) · 1.94 KB
/
clasF_es.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE html>
<link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css">
<html>
<head>
<base target="_top">
<script>
// Prevent forms from submitting.
function preventFormSubmit() {
var forms = document.querySelectorAll('form');
for (var i = 0; i < forms.length; i++) {
forms[i].addEventListener('submit', function(event) {
event.preventDefault();
});
}
}
window.addEventListener('load', preventFormSubmit);
function handleFormSubmit(formObject) {
google.script.run.withSuccessHandler().classform(formObject);
}
</script>
</head>
<body>
<h2>Publicar el enlace del formulario en Classroom</h2>
<form id="imp" onsubmit="handleFormSubmit(this)">
<div class="block form-group">
<label for="select">Curso de Classroom</label>
<select id="select" name="combo_curs">
<option value='0'>Selecciona un curso</option>
<? var optionalArgs = {
courseStates: 'Active',teacherId: "me"
};
var response = Classroom.Courses.list(optionalArgs);
var courses = response.courses;
if (courses && courses.length > 0) {
for (i = 0; i < courses.length; i++) {
var course = courses[i];
var properties = PropertiesService.getDocumentProperties();
var curs_triat = properties.getProperty('cursid');
if (course.id==curs_triat){
?>
<option value="<?= course.id ?>" selected><?= course.name ?></option>
<? }else{ ?>
<option value="<?= course.id ?>" ><?= course.name ?></option>
<? } ?>
<? } ?>
</select> <?
} ?></div>
<p>Indica un texto para el anuncio en Classroom <input type="text" name="titol"></p>
<p><input id="boto" class="action" type="submit" value="Publicar"></p>
</form>
</body>
</html>