projects
/
qomet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Debug monitoring
[qomet.git]
/
public
/
javascripts
/
monitor.js
diff --git
a/public/javascripts/monitor.js
b/public/javascripts/monitor.js
index
6c08d7a
..
23972a9
100644
(file)
--- 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;
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("/", {
this.students = s.students;
this.stage = 1;
socket = io.connect("/", {
@@
-101,7
+105,7
@@
new Vue({
});
}
// TODO: notations not coherent (input / answer... when, which ?)
});
}
// TODO: notations not coherent (input / answer... when, which ?)
- this.assessment.papers[paperIdx].inputs.push(
m.answer
); //input+index
+ this.assessment.papers[paperIdx].inputs.push(
JSON.parse(m.answer)
); //input+index
});
},
});
});
},
});
@@
-110,7
+114,7
@@
new Vue({
// In the end, send answers to students
socket.emit(
message.allAnswers,
// In the end, send answers to students
socket.emit(
message.allAnswers,
- { answers:
this.assessment.questions.map( q => { return q.answer; }
) }
+ { answers:
JSON.stringify(this.assessment.questions.map( q => { return q.answer; })
) }
);
},
},
);
},
},