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
/
assessment.js
diff --git
a/public/javascripts/assessment.js
b/public/javascripts/assessment.js
index
09caf12
..
ad309d7
100644
(file)
--- a/
public/javascripts/assessment.js
+++ b/
public/javascripts/assessment.js
@@
-129,7
+129,8
@@
let V = new Vue({
this.answers.indices = indices.concat( _.shuffle(remainingIndices) );
}
this.answers.index = !!paper ? paper.inputs.length : 0;
this.answers.indices = indices.concat( _.shuffle(remainingIndices) );
}
this.answers.index = !!paper ? paper.inputs.length : 0;
- Vue.nextTick(statementsLibsRefresh);
+ this.answers.displayAll = assessment.display == "all";
+ this.answers.showSolution = false;
this.stage = 2;
};
if (assessment.mode == "open")
this.stage = 2;
};
if (assessment.mode == "open")
@@
-156,7
+157,7
@@
let V = new Vue({
// Got password: students answers locked to this page until potential teacher
// action (power failure, computer down, ...)
}
// Got password: students answers locked to this page until potential teacher
// action (power failure, computer down, ...)
}
- socket = io.connect("/"
+ assessment.name
, {
+ socket = io.connect("/", {
query: "aid=" + assessment._id + "&number=" + this.student.number + "&password=" + this.student.password
});
socket.on(message.allAnswers, this.setAnswers);
query: "aid=" + assessment._id + "&number=" + this.student.number + "&password=" + this.student.password
});
socket.on(message.allAnswers, this.setAnswers);
@@
-180,7
+181,7
@@
let V = new Vue({
}, 1000);
},
// stage 2
}, 1000);
},
// stage 2
- sendAnswer: function() {
+ send
One
Answer: function() {
const realIndex = this.answers.indices[this.answers.index];
let gotoNext = () => {
if (this.answers.index == assessment.questions.length - 1)
const realIndex = this.answers.indices[this.answers.index];
let gotoNext = () => {
if (this.answers.index == assessment.questions.length - 1)
@@
-215,6
+216,13
@@
let V = new Vue({
},
});
},
},
});
},
+ // TODO: I don't like that + sending should not be definitive in exam mode with display = all
+ sendAnswer: function() {
+ if (assessment.display == "one")
+ this.sendOneAnswer();
+ else
+ assessment.questions.forEach(this.sendOneAnswer);
+ },
// stage 2 --> 3 (or 4)
// from a message by statements component, or time over
endAssessment: function() {
// stage 2 --> 3 (or 4)
// from a message by statements component, or time over
endAssessment: function() {
@@
-223,6
+231,8
@@
let V = new Vue({
if (assessment.mode == "open")
{
this.stage = 4;
if (assessment.mode == "open")
{
this.stage = 4;
+ this.answers.showSolution = true;
+ this.answers.displayAll = true;
return;
}
$.ajax("/end/assessment", {
return;
}
$.ajax("/end/assessment", {
@@
-239,16
+249,19
@@
let V = new Vue({
assessment.conclusion = ret.conclusion;
this.stage = 3;
delete this.student["password"]; //unable to send new answers now
assessment.conclusion = ret.conclusion;
this.stage = 3;
delete this.student["password"]; //unable to send new answers now
- socket.disconnect();
- socket = null;
},
});
},
// stage 3 --> 4 (on socket message "feedback")
setAnswers: function(m) {
},
});
},
// stage 3 --> 4 (on socket message "feedback")
setAnswers: function(m) {
- for (let i=0; i<m.answers.length; i++)
- assessment.questions[i].answer = m.answers[i];
+ const answers = JSON.parse(m.answers);
+ for (let i=0; i<answers.length; i++)
+ assessment.questions[i].answer = answers[i];
+ this.answers.showSolution = true;
+ this.answers.displayAll = true;
this.stage = 4;
this.stage = 4;
+ socket.disconnect();
+ socket = null;
},
},
});
},
},
});