From: Benjamin Auder Date: Sun, 4 Feb 2018 23:55:16 +0000 (+0100) Subject: Fix answers display on monitor page X-Git-Url: https://git.auder.net/doc/html/%7B%7B%20asset%28%27mixstore/css/pieces/cb.svg?a=commitdiff_plain;h=fa6abf40b7afdbff4b9dc5fb143e29db512bf8c5;p=qomet.git Fix answers display on monitor page --- diff --git a/TODO b/TODO index 8670fcb..2c7a5b2 100644 --- 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 ----- diff --git a/public/javascripts/monitor.js b/public/javascripts/monitor.js index 6c08d7a..07a0814 100644 --- a/public/javascripts/monitor.js +++ b/public/javascripts/monitor.js @@ -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("/", {