projects
/
qomet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
c8f6869
)
'update'
author
Benjamin Auder
<benjamin.auder@somewhere>
Mon, 26 Feb 2018 10:53:34 +0000
(11:53 +0100)
committer
Benjamin Auder
<benjamin.auder@somewhere>
Mon, 26 Feb 2018 10:53:34 +0000
(11:53 +0100)
models/course.js
patch
|
blob
|
blame
|
history
models/evaluation.js
patch
|
blob
|
blame
|
history
public/javascripts/components/statements.js
patch
|
blob
|
blame
|
history
views/course.pug
patch
|
blob
|
blame
|
history
diff --git
a/models/course.js
b/models/course.js
index
cbe2c44
..
748ab6c
100644
(file)
--- a/
models/course.js
+++ b/
models/course.js
@@
-1,5
+1,4
@@
const UserModel = require("../models/user");
const UserModel = require("../models/user");
-const EvaluationModel = require("../models/evaluation");
const db = require("../utils/database");
const CourseModel =
const db = require("../utils/database");
const CourseModel =
@@
-160,12
+159,15
@@
const CourseModel =
if (!!err || !course || !course.uid.equals(uid))
return cb({errmsg:"Not your course"},{});
// 2) remove all associated evaluations
if (!!err || !course || !course.uid.equals(uid))
return cb({errmsg:"Not your course"},{});
// 2) remove all associated evaluations
- EvaluationModel.removeGroup(cid, (err2,ret) => {
- if (!!err)
- return cb(err,{});
- // 3) remove course (with its students)
- CourseModel.remove(cid, cb);
- });
+ db.evaluations.remove(
+ { cid: cid },
+ (err2,ret) => {
+ if (!!err)
+ return cb(err,{});
+ // 3) remove course (with its students)
+ CourseModel.remove(cid, cb);
+ }
+ );
});
},
}
});
},
}
diff --git
a/models/evaluation.js
b/models/evaluation.js
index
be5dbc2
..
8cf7e64
100644
(file)
--- a/
models/evaluation.js
+++ b/
models/evaluation.js
@@
-260,14
+260,6
@@
const EvaluationModel =
);
},
);
},
- removeGroup: function(cid, cb)
- {
- db.evaluations.remove(
- { cid: cid },
- cb
- );
- },
-
/////////////////////
// ADVANCED FUNCTIONS
/////////////////////
// ADVANCED FUNCTIONS
diff --git
a/public/javascripts/components/statements.js
b/public/javascripts/components/statements.js
index
65bab5f
..
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 ?)
diff --git
a/views/course.pug
b/views/course.pug
index
4e44ec7
..
2a3f549
100644
(file)
--- a/
views/course.pug
+++ b/
views/course.pug
@@
-66,7
+66,7
@@
block content
button.waves-effect.waves-light.btn(@click="redirect(evaluation.name)") View
div
.introduction(v-html="evaluation.introduction")
button.waves-effect.waves-light.btn(@click="redirect(evaluation.name)") View
div
.introduction(v-html="evaluation.introduction")
- statements(:questions="evaluation.questions" :display="'solution'")
+ statements(:questions="evaluation.questions" :
answers="evaluation.answers" :
display="'solution'")
.card(v-show="mode=='edit'")
form(@submit.prevent)
p
.card(v-show="mode=='edit'")
form(@submit.prevent)
p