X-Git-Url: https://git.auder.net/?p=qomet.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fmonitor.js;h=b5a0fe41754222a6d297eb761c495c863b92b492;hp=1b8d62f9f8573343c07714d82187d878d56d9972;hb=25cb8d539e4f68586f2e5fa95e20f6de3c031b6f;hpb=db5571d67f6b6b3b841fa1eeaf2099cecf2bcffc diff --git a/public/javascripts/monitor.js b/public/javascripts/monitor.js index 1b8d62f..b5a0fe4 100644 --- a/public/javascripts/monitor.js +++ b/public/javascripts/monitor.js @@ -42,6 +42,23 @@ new Vue({ groupId: function(group, prefix) { return (prefix || "") + "group" + group; }, + togglePresence: function(s) { + s.present = !s.present; + }, + allFinished: function() { + for (s of this.students) + { + if (!s.present) + continue; + const paperIdx = this.assessment.papers.findIndex( item => { return item.number == number; }); + if (paperIdx === -1) + return false; + const paper = this.assessment.papers[paperIdx]; + if (paper.inputs.length < this.assessment.questions.length) + return false; + } + return true; + }, getColor: function(number, qIdx) { // For the moment, green if correct and red if wrong; grey if unanswered yet // TODO: in-between color for partially right (especially for multi-questions) @@ -82,6 +99,7 @@ new Vue({ return input; }); this.students = s.students; + this.students.forEach( s => { s.present = true; }); //a priori... this.stage = 1; socket = io.connect("/", { query: "aid=" + this.assessment._id + "&secret=" + s.secret