9f43ce0a403540cca2299953c8db73c6290c9ea5
1 // TODO: onglets pour chaque groupe + section déroulante questionnaire (chargé avec réponses)
2 // NOM Prenom (par grp, puis alphabétique)
3 // réponse : vert si OK (+ choix), rouge si faux, gris si texte (clic pour voir)
5 // click sur en-tête de colonne : tri alphabétique, tri décroissant...
6 // Affiché si (hash du) mdp du cours est correctement entré
7 // Doit reprendre les données en base si refresh (sinon : sockets)
9 // Also buttons "start exam", "end exam" for logged in teacher
11 let socket
= null; //monitor answers in real time
16 password: "", //from password field
17 assessment: null, //obtained after authentication
18 // Stage 0: unauthenticated (password),
19 // 1: authenticated (password hash validated), start monitoring
24 startMonitoring: function() {
25 $.ajax("/start/monitoring", {
35 return this.warning(s
.errmsg
);
40 // TODO: 2-level sockets, for prof and monitors
41 socket
= io
.connect("/" + assessment
.name
, {
42 query: "number=" + this.student
.number
+ "&password=" + this.password
44 socket
.on(message
.allAnswers
, this.setAnswers
);
45 initializeStage2(s
.questions
, s
.paper
);
49 // stage 2 --> 3 (or 4)
50 // from a message by statements component, or time over
51 // TODO: also function startAssessment (for main teacher only)
52 endAssessment: function() {
53 // Set endTime, destroy password
54 $("#leftButton, #rightButton").show();
55 if (assessment
.mode
== "open")
60 $.ajax("/end/assessment", {
64 number: this.student
.number
,
65 password: this.student
.password
,
70 return this.warning(ret
.errmsg
);
71 assessment
.conclusion
= ret
.conclusion
;
73 delete this.student
["password"]; //unable to send new answers now