-
Notifications
You must be signed in to change notification settings - Fork 1
/
grade.html
71 lines (67 loc) · 2.82 KB
/
grade.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
<html>
<head>
<script src="grade.js"></script>
<script type="text/javascript">
function startProc() {
document.body.innerHTML = JSON.stringify(grade);
console.log(grade);
tablestr = "<table>";
student_keys = Object.keys(grade);
for (i=0;i<student_keys.length;i++) {
student = student_keys[i];
//document.body.innerHTML += student + "<br>";
console.log(student);
tablestr += "<tr>";
tablestr += "<td>"+i+"</td>";
tablestr += "<td>"+grade[student].name+"</td>";
tablestr += "<td>"+grade[student].unique_name+"</td>";
tablestr += "<td style='background:#FBF703'>";
tablestr += "<div style='font-size:9px'> Participation </div><br>";
tablestr += (grade[student].participation.status).toString() + "</td>";
for (j=0;j<grade[student].quizzes.length;j++) {
if (grade[student].quizzes[j].status==='PENDING')
tablestr += "<td style='background:#aaaaaa'>";
else
tablestr += "<td style='background:#66aaff'>";
tablestr += "<div style='font-size:9px'> Quiz "+j+"</div><br>";
tablestr += grade[student].quizzes[j].status+"</td>";
}
feature_keys = Object.keys(grade[student].assignments);
for (j=0;j<feature_keys.length;j++) {
feature = feature_keys[j]
if (grade[student].assignments[feature].status==='PENDING')
tablestr += "<td style='background:#888888'>";
else if (grade[student].assignments[feature].status==='CHECK')
tablestr += "<td style='background:#88ff96'>";
<!--tablestr += "<td style='background:#888888' title="+ grade[student].assignments[feature].comments+">";-->
else if (grade[student].assignments[feature].status==='PARTIAL')
tablestr += "<td style='background:#F78E09'>";
<!--tablestr += "<td style='background:#888888' title="+ enrolled[student].assignments[feature].comments+">";-->
else if (grade[student].assignments[feature].status==='PASS')
tablestr += "<td style='background:#8888FF'>";
<!--tablestr += "<td style='background:#888888' title="+ grade[student].assignments[feature].comments+">";-->
else
tablestr += "<td style='background:#FF8888'>";
tablestr += "<div style='font-size:9px'>"+feature+"</div><br>";
tablestr += grade[student].assignments[feature].status+"</td>";
}
tablestr += "<td>"+grade[student].email+"</td>";
tablestr += "</tr>";
}
tablestr += "</table>";
document.body.innerHTML = tablestr;
/*
document.body.innerHTML = JSON.stringify(teams[0])+"<br><br>";
for (i=1;i<teams.length;i++) {
document.body.innerHTML += JSON.stringify(teams[i])+"<br><br>";
}
*/
}
</script>
</head>
<!--<body onload="startProc(); console.log('here');">
-->
<body>
<script> startProc(); </script>
</body>
</html>