projects
/
qomet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
'update'
[qomet.git]
/
public
/
javascripts
/
components
/
statements.js
diff --git
a/public/javascripts/components/statements.js
b/public/javascripts/components/statements.js
index
86138c0
..
65bab5f
100644
(file)
--- a/
public/javascripts/components/statements.js
+++ b/
public/javascripts/components/statements.js
@@
-32,7
+32,7
@@
Vue.component("statements", {
displayStyle: "compact", //or "all": all on same page
parameters: 0, //TODO: DO NOT re-draw parameters for already answered questions
};
displayStyle: "compact", //or "all": all on same page
parameters: 0, //TODO: DO NOT re-draw parameters for already answered questions
};
- }
+ }
,
// Full questions tree is rendered, but some parts hidden depending on display settings
render(h) {
// Prepare questions groups, ordered
// Full questions tree is rendered, but some parts hidden depending on display settings
render(h) {
// Prepare questions groups, ordered
@@
-41,7
+41,9
@@
Vue.component("statements", {
const dotPos = q.index.indexOf(".");
return dotPos === -1 ? q.index : q.index.substring(0,dotPos);
});
const dotPos = q.index.indexOf(".");
return dotPos === -1 ? q.index : q.index.substring(0,dotPos);
});
- let domTree = questionGroups.map( (qg,i) => {
+ let domTree = Object.keys(questionGroups).map( idx => {
+ let qg = questionGroups[idx];
+ const i = parseInt(idx);
// Re-order questions 1.1.1 then 1.1.2 then...
const orderedQg = qg.sort( (a,b) => {
let aParts = a.split('.').map(Number);
// Re-order questions 1.1.1 then 1.1.2 then...
const orderedQg = qg.sort( (a,b) => {
let aParts = a.split('.').map(Number);
@@
-158,7
+160,7
@@
Vue.component("statements", {
{
"class": {
"question": true,
{
"class": {
"question": true,
-
"depth" + depth
: true,
+
["depth" + depth]
: true,
},
},
questionContent
},
},
questionContent
@@
-171,7
+173,7
@@
Vue.component("statements", {
"questionGroup": true,
"hide": this.display == "one" && this.iidx != i,
},
"questionGroup": true,
"hide": this.display == "one" && this.iidx != i,
},
- }
+ }
,
qgDom
);
});
qgDom
);
});