X-Git-Url: https://git.auder.net/?p=qomet.git;a=blobdiff_plain;f=models%2Fevaluation.js;h=be5dbc2e474c0a32ac03078d6e18781a034aaecb;hp=89f2560ca08dbe9ae6517e58b05aa467d1fadc5a;hb=14c9c66a3bc1abfeb3097a0c9fe4f0ff25fe2b8b;hpb=a3080c337cfaca9d600911396cae5a9233d43554 diff --git a/models/evaluation.js b/models/evaluation.js index 89f2560..be5dbc2 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 @@ -357,7 +359,6 @@ const EvaluationModel = { $push: { papers: { number: number, startTime: Date.now(), - endTime: undefined, password: password, totalDisco: 0, discoCount: 0,