* display: "one" or "all" (generally "all" for open questions, but...)
* time: 0, //<=0 means "untimed"; otherwise, time in seconds
* introduction: "",
- * conclusion: "https://www.youtube.com/watch?v=6-9AjToJYuw",
* coefficient: number, default 1
* questions: array of
* index: for paper test, like 2.1.a (?!); and quiz: 0, 1, 2, 3...
* 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 assessment? --> striped if inactive!
+ * active: boolean, is question in current assessment?
* points: points for this question (default 1)
* papers : array of
* number: student number
display: "one",
time: 0,
introduction: "",
- conclusion: "",
coefficient: 1,
questions: [ ],
papers: [ ],
);
},
- getConclusion: function(aid, callback)
- {
- db.assessments.findOne(
- { _id: aid },
- { conclusion: 1},
- (err,res) => {
- callback(err, !!res ? res.conclusion : null);
- }
- );
- },
-
remove: function(aid, cb)
{
db.assessments.remove(
AssessmentEntity.endAssessment(aid, number, password, (err,ret) => {
if (!!err || !ret)
return cb(err,ret);
- AssessmentEntity.getConclusion(aid, (err2,conclusion) => {
- cb(err2, {conclusion:conclusion});
- });
});
},
};
success: ret => {
if (!!ret.errmsg)
return this.showWarning(ret.errmsg);
- assessment.conclusion = ret.conclusion;
this.stage = 3;
delete this.student["password"]; //unable to send new answers now
},
"display": "alphanumeric", //"one" or "all"
"time": "integer",
"introduction": "string",
- "conclusion": "string",
"coefficient": "number",
"questions": Validator.Question,
"papers": Validator.Paper,
padding: 20px 5px;
}
-.conclusion {
- padding: 20px 5px;
-}
-
.timer {
font-size: 2rem;
}
margin-top: 20px;
}
-.conclusion {
- margin-bottom: 20px;
-}
-
table.in-question {
border: 1px solid black;
width: auto;
.introduction {
padding: 20px 5px;
}
-.conclusion {
- padding: 20px 5px;
-}
table.in-question {
border: 1px solid black;
width: auto;
if (error.length > 0)
return res.json({errmsg:error});
assessment.introduction = sanitizeHtml(assessment.introduction, sanitizeOpts);
- assessment.conclusion = sanitizeHtml(assessment.conclusion, sanitizeOpts);
assessment.questions.forEach( q => {
q.wording = sanitizeHtml(q.wording, sanitizeOpts);
//q.answer = sanitizeHtml(q.answer); //if text (TODO: it's an array in this case?!)
let error = validator({ _id:aid, papers:[{number:number,password:password}] }, "Assessment");
if (error.length > 0)
return res.json({errmsg:error});
- // Destroy pwd, set endTime, return conclusion
- AssessmentModel.endSession(ObjectId(aid), number, password, (err,conclusion) => {
- access.checkRequest(res,err,conclusion,"Cannot end assessment", () => {
+ // Destroy pwd, set endTime
+ AssessmentModel.endSession(ObjectId(aid), number, password, (err,ret) => {
+ access.checkRequest(res,err,ret,"Cannot end assessment", () => {
res.clearCookie('password');
- res.json(conclusion);
+ res.json({});
});
});
});
// Basic headless browser detection
return res.json({errmsg: "Headless browser detected"});
}
- // Strip conclusion + questions if exam mode (stepwise process)
- delete assessment["conclusion"];
+ // Strip questions if exam mode (stepwise process)
delete assessment["questions"];
}
res.render("assessment", {
#stage3(v-show="stage==3")
.card
.finish Exam completed ☺ ...don't close the window!
- #stage3_4(v-show="[3,4].includes(stage)")
- .card
- .conclusion(v-html="assessment.conclusion")
block append javascripts
script.
.input-field
textarea#assessmentEdition.materialize-textarea(v-model="assessmentText")
label(for="assessmentEdition") Assessment in text format
- .input-field
- textarea#conclusion.materialize-textarea(v-model="assessment.conclusion")
- label(for="conclusion") Conclusion
.modal-footer
.center-align
a.modal-action.modal-close.waves-effect.waves-light.btn-flat(href="#!") Done
label.on-left(:for="checkBoxFixedId(i)") Fixed
input(:id="checkBoxActiveId(i)" type="checkbox" v-model="question.active")
label(:for="checkBoxActiveId(i)") Active
- .conclusion(v-html="assessment.conclusion")
.center-align
button.waves-effect.waves-light.btn.on-left(@click="mode='view'") Cancel
button.waves-effect.waves-light.btn(@click="updateAssessment") Send
.introduction(v-html="assessment.introduction")
.card
statements(:questions="assessment.questions" :answers:"answers")
- .card
- .conclusion(v-html="assessment.conclusion")
block append javascripts
script.
.introduction(v-html="assessment.introduction")
.card
statements(:questions="assessment.questions" :answers="answers")
- .card
- .conclusion(v-html="assessment.conclusion")
block append javascripts
script.