Fix answers display on monitor page
authorBenjamin Auder <benjamin.auder@somewhere>
Sun, 4 Feb 2018 23:55:16 +0000 (00:55 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Sun, 4 Feb 2018 23:55:16 +0000 (00:55 +0100)
TODO
public/javascripts/monitor.js

diff --git a/TODO b/TODO
index 8670fcb..2c7a5b2 100644 (file)
--- a/TODO
+++ b/TODO
@@ -5,6 +5,7 @@ time per question (in mode "one question at a time" from server...)
 compute grades after exam (in teacher's view)
 factorize redundant code in course.js, monitor.js and (TOWRITE) grade.js
   (showing students list + grades or papers)
+monitoring: main teacher should not be asked for pwd, and button "send feedback" hidden for others
 
 -----
 
index 6c08d7a..07a0814 100644 (file)
@@ -81,7 +81,11 @@ new Vue({
                                        if (!!s.errmsg)
                                                return alert(s.errmsg);
                                        this.assessment = s.assessment;
-                                       this.answers.inputs = s.assessment.questions.map( q => { return q.answer; });
+                                       this.answers.inputs = s.assessment.questions.map( q => {
+                                               let input = _(q.options.length).times( _.constant(false) );
+                                               q.answer.forEach( idx => { input[idx] = true; });
+                                               return input;
+                                       });
                                        this.students = s.students;
                                        this.stage = 1;
                                        socket = io.connect("/", {