-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathp_clas_ca.html
95 lines (85 loc) · 2.94 KB
/
p_clas_ca.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE html>
<link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css">
<html>
<head>
<title>CoRubrics</title>
<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().publicanotes(formObject);
}
</script>
</head>
<body>
<h3>Publicació de resultats a Classroom</h3>
<form id="enviament" onsubmit="handleFormSubmit(this)">
<?
var properties = PropertiesService.getDocumentProperties();
var tasca_av_id = properties.getProperty('tasca_av_id');
var tasca_co_id = properties.getProperty('tasca_co_id');
var tasca_pf_id = properties.getProperty('tasca_pf_id');
if (tasca_av_id =="" && tasca_co_id == "" && tasca_pf_id==""){ ?>
<div class="block form-group">
<label for="select">Curs de Classroom</label>
<select id="select" name="combo_curs">
<option value='0'>Selecciona un curs</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 títol per la tasca <input type="text" name="titol"></p>
<p>Indica una descripció per la tarea <input type="text" name="descripcio"></p>
<? };?>
<div class="block form-group">
<label for="select3">Nota final a publicar</label>
<select id="select3" name="nf">
<option value="0">Mitjana ponderada</option>
<option value="1">Ítem més baix</option>
</select></div>
<p><b>Tipus d'avaluació a publicar</b><br> (es crearà una tasca a Classroom per a cada tipus d'avaluació)</p>
<div>
<input type="checkbox" id="checkbox4" name="av">
<label for="checkbox4">Autoavalució</label>
</div>
<div>
<input type="checkbox" id="checkbox5"name="co">
<label for="checkbox5">Coavaluació</label>
</div>
<div>
<input type="checkbox" id="checkbox6"name="pf">
<label for="checkbox6">Avaluació del professor</label>
</div>
<div>
<input type="checkbox" id="checkbox7"name="ng">
<label for="checkbox7">Nota global</label>
</div>
<p><input type="submit" class="action" value="Publicar"></p>
</form>
<div id="output"></div>
</body>
</html>