projects
/
qomet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix monitoring presence (TODO: weird Vue syntax...)
[qomet.git]
/
public
/
javascripts
/
monitor.js
diff --git
a/public/javascripts/monitor.js
b/public/javascripts/monitor.js
index
b5a0fe4
..
6ee6a41
100644
(file)
--- a/
public/javascripts/monitor.js
+++ b/
public/javascripts/monitor.js
@@
-42,15
+42,17
@@
new Vue({
groupId: function(group, prefix) {
return (prefix || "") + "group" + group;
},
groupId: function(group, prefix) {
return (prefix || "") + "group" + group;
},
- togglePresence: function(s) {
- s.present = !s.present;
+ togglePresence: function(student) {
+ const sIdx = this.students.findIndex( s => { return s.number == student.number; });
+ Vue.set( this.students, sIdx, Object.assign({},student,{present:!student.present}) );
+ //s.present = !s.present;
},
allFinished: function() {
for (s of this.students)
{
if (!s.present)
continue;
},
allFinished: function() {
for (s of this.students)
{
if (!s.present)
continue;
- const paperIdx = this.assessment.papers.findIndex( item => { return item.number == number; });
+ const paperIdx = this.assessment.papers.findIndex( item => { return item.number ==
s.
number; });
if (paperIdx === -1)
return false;
const paper = this.assessment.papers[paperIdx];
if (paperIdx === -1)
return false;
const paper = this.assessment.papers[paperIdx];