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
6e12eb6
..
0b8ef65
100644
(file)
--- a/
public/javascripts/components/statements.js
+++ b/
public/javascripts/components/statements.js
@@
-6,13
+6,15
@@
NOTE: questions can contain parameterized exercises (how ?
--> write javascript script (OK, users trusted ? ==> safe mode possible if public website)
Imaginary example: (using math.js)
<params> (avant l'exo)
--> write javascript script (OK, users trusted ? ==> safe mode possible if public website)
Imaginary example: (using math.js)
<params> (avant l'exo)
- x: math.random()
- y: math.random()
- M: math.matrix([[7, x], [y, -3]]);
- res: math.det(M)
+ const x = math.random()
+ const y = math.random()
</params>
</params>
+ <result>
+ let M = math.matrix([[7, x], [y, -3]]);
+ return math.det(M);
+ </result>
<div>Calculer le déterminant de
<div>Calculer le déterminant de
- $$\begin{matrix}7 &
x\\y
& -3\end{matrix}$$</div>
+ $$\begin{matrix}7 &
£x£\\£y£
& -3\end{matrix}$$</div>
* ...
+ fixed + question time (syntax ?)
* ...
+ fixed + question time (syntax ?)
@@
-41,7
+43,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);