const UserModel = require("../models/user");
-const EvaluationModel = require("../models/evaluation");
const db = require("../utils/database");
const CourseModel =
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);
+ }
+ );
});
},
}
);
},
- removeGroup: function(cid, cb)
- {
- db.evaluations.remove(
- { cid: cid },
- cb
- );
- },
-
/////////////////////
// ADVANCED FUNCTIONS
--> 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>
+ <result>
+ let M = math.matrix([[7, x], [y, -3]]);
+ return math.det(M);
+ </result>
<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 ?)
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