X-Git-Url: https://git.auder.net/assets/%7B%7B%20path%28%27mixstore_store_package_list%27%29%20%7D%7D?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fstatements.js;h=5373e898152c237950f452a568bbf7798e54a5cf;hb=fdf62750d329257baae55a86e746902f310a2386;hp=6e12eb6109dac2a54571580b79ae2211ea041eb7;hpb=cb39647ade2e424bcdf015228a7c1a09a92b5212;p=qomet.git
diff --git a/public/javascripts/components/statements.js b/public/javascripts/components/statements.js
index 6e12eb6..5373e89 100644
--- 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)
(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();
+
+ let M = math.matrix([[7, x], [y, -3]]);
+ return math.det(M);
+
Calculer le déterminant de
- $$\begin{matrix}7 & x\\y & -3\end{matrix}$$
+ $$\begin{matrix}7 & £x£\\£y£ & -3\end{matrix}$$
* ...
+ 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);
});
- 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);