X-Git-Url: https://git.auder.net/assets/icon_infos.svg?a=blobdiff_plain;f=models%2Fevaluation.js;h=8cf7e6457ec916c27daf0f66957bfdd026331afd;hb=HEAD;hp=89f2560ca08dbe9ae6517e58b05aa467d1fadc5a;hpb=a3080c337cfaca9d600911396cae5a9233d43554;p=qomet.git diff --git a/models/evaluation.js b/models/evaluation.js index 89f2560..8cf7e64 100644 --- a/models/evaluation.js +++ b/models/evaluation.js @@ -20,13 +20,15 @@ const EvaluationModel = * coefficient: number, default 1 * questions: array of * index: for paper test, like 2.1.a (?!); and quiz: 0, 1, 2, 3... - * wording: varchar (HTML) + * wording: varchar (HTML) with potential placeholders for params * options: array of varchar --> if present, question type == quiz! * fixed: bool, options in fixed order (default: false) - * answer: array of integers (for quiz) or html text (for paper); striped in exam mode - * active: boolean, is question in current evaluation? * points: points for this question (default 1) - * param: parameter (if applicable) + * answers: + * array of index + + * array of integers (for quiz) or + * html text (for paper) or + * function (as string, for parameterized questions) * papers : array of * number: student number * inputs: array of {index,answer[array of integers or html text],startTime} @@ -73,6 +75,7 @@ const EvaluationModel = introduction: "", coefficient: 1, questions: [ ], + answers: [ ], papers: [ ], }, callback @@ -243,7 +246,6 @@ const EvaluationModel = "papers.password": password, }, { $set: { - "papers.$.endTime": Date.now(), "papers.$.password": "", } }, callback @@ -258,14 +260,6 @@ const EvaluationModel = ); }, - removeGroup: function(cid, cb) - { - db.evaluations.remove( - { cid: cid }, - cb - ); - }, - ///////////////////// // ADVANCED FUNCTIONS @@ -357,7 +351,6 @@ const EvaluationModel = { $push: { papers: { number: number, startTime: Date.now(), - endTime: undefined, password: password, totalDisco: 0, discoCount: 0,