projects
/
qomet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8d38641
)
Bugs fixes
author
Benjamin Auder
<benjamin.auder@somewhere>
Mon, 5 Feb 2018 14:10:37 +0000
(15:10 +0100)
committer
Benjamin Auder
<benjamin.auder@somewhere>
Mon, 5 Feb 2018 14:10:37 +0000
(15:10 +0100)
TODO
patch
|
blob
|
blame
|
history
public/javascripts/assessment.js
patch
|
blob
|
blame
|
history
public/javascripts/components/statements.js
patch
|
blob
|
blame
|
history
public/stylesheets/assessment.css
patch
|
blob
|
blame
|
history
views/assessment.pug
patch
|
blob
|
blame
|
history
diff --git
a/TODO
b/TODO
index
73f669e
..
2c7a5b2
100644
(file)
--- a/
TODO
+++ b/
TODO
@@
-1,5
+1,3
@@
-Debug exam mode (and open too...): Vue.js warning + shift questions (not showing solution)
-
Replace underscore by lodash (or better: ES6)
Replace socket.io by Websockets ( https://www.npmjs.com/package/websocket )
Replace underscore by lodash (or better: ES6)
Replace socket.io by Websockets ( https://www.npmjs.com/package/websocket )
diff --git
a/public/javascripts/assessment.js
b/public/javascripts/assessment.js
index
09caf12
..
9858643
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")
@@
-223,6
+224,7
@@
let V = new Vue({
if (assessment.mode == "open")
{
this.stage = 4;
if (assessment.mode == "open")
{
this.stage = 4;
+ this.answers.showSolution = true;
return;
}
$.ajax("/end/assessment", {
return;
}
$.ajax("/end/assessment", {
@@
-248,6
+250,7
@@
let V = new Vue({
setAnswers: function(m) {
for (let i=0; i<m.answers.length; i++)
assessment.questions[i].answer = m.answers[i];
setAnswers: function(m) {
for (let i=0; i<m.answers.length; i++)
assessment.questions[i].answer = m.answers[i];
+ this.answers.showSolution = true;
this.stage = 4;
},
},
this.stage = 4;
},
},
diff --git
a/public/javascripts/components/statements.js
b/public/javascripts/components/statements.js
index
5bf6bdb
..
8cfbde3
100644
(file)
--- a/
public/javascripts/components/statements.js
+++ b/
public/javascripts/components/statements.js
@@
-109,6
+109,9
@@
Vue.component("statements", {
domTree
);
},
domTree
);
},
+ mounted: function() {
+ statementsLibsRefresh();
+ },
updated: function() {
// TODO: next line shouldn't be required: questions wordings + answer + options
// are processed earlier; their content should be updated at this time.
updated: function() {
// TODO: next line shouldn't be required: questions wordings + answer + options
// are processed earlier; their content should be updated at this time.
diff --git
a/public/stylesheets/assessment.css
b/public/stylesheets/assessment.css
index
2143f40
..
26d9d75
100644
(file)
--- a/
public/stylesheets/assessment.css
+++ b/
public/stylesheets/assessment.css
@@
-4,7
+4,7
@@
a#rightButton {
right: 0;
}
right: 0;
}
-button
#
sendAnswer {
+button
.
sendAnswer {
display: block;
margin: 0 auto;
}
display: block;
margin: 0 auto;
}
diff --git
a/views/assessment.pug
b/views/assessment.pug
index
26221d8
..
5c573d7
100644
(file)
--- a/
views/assessment.pug
+++ b/
views/assessment.pug
@@
-44,11
+44,13
@@
block content
.introduction(v-html="assessment.introduction")
#stage2_4(v-if="[2,4].includes(stage)")
if assessment.time > 0
.introduction(v-html="assessment.introduction")
#stage2_4(v-if="[2,4].includes(stage)")
if assessment.time > 0
- .card(v-
if
="stage==2")
+ .card(v-
show
="stage==2")
.timer.center {{ countdown }}
.card
.timer.center {{ countdown }}
.card
- button
#
sendAnswer.waves-effect.waves-light.btn(@click="sendAnswer") Send
+ button
.
sendAnswer.waves-effect.waves-light.btn(@click="sendAnswer") Send
statements(:questions="assessment.questions" :answers="answers")
statements(:questions="assessment.questions" :answers="answers")
+ if assessment.display == "all"
+ button.sendAnswer.waves-effect.waves-light.btn(@click="sendAnswer") Send
#stage3(v-show="stage==3")
.card
.finish Exam completed ☺ ...don't close the window!
#stage3(v-show="stage==3")
.card
.finish Exam completed ☺ ...don't close the window!