X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fmonitor.js;h=07a0814395acd56cb31d966882e1468efb939c67;hb=fa6abf40b7afdbff4b9dc5fb143e29db512bf8c5;hp=6c08d7a05b2f417ec231e4a21f41e38a2d3f31b9;hpb=71d1ca9c594b64d959c608a2abbff926480abad5;p=qomet.git 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("/", {