Remove conclusion option in assessments (seems useless)
authorBenjamin Auder <benjamin.auder@somewhere>
Tue, 13 Feb 2018 00:24:33 +0000 (01:24 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Tue, 13 Feb 2018 00:24:33 +0000 (01:24 +0100)
13 files changed:
entities/assessment.js
models/assessment.js
public/javascripts/assessment.js
public/javascripts/utils/validation.js
public/stylesheets/assessment.css
public/stylesheets/course.css
public/stylesheets/monitor.css
routes/assessments.js
routes/pages.js
views/assessment.pug
views/course.pug
views/grading.pug
views/monitor.pug

index 3dc1952..b4b6d89 100644 (file)
@@ -13,7 +13,6 @@ const AssessmentEntity =
         *   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...
@@ -21,7 +20,7 @@ const AssessmentEntity =
         *     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
@@ -63,7 +62,6 @@ const AssessmentEntity =
                                display: "one",
                                time: 0,
                                introduction: "",
-                               conclusion: "",
                                coefficient: 1,
                                questions: [ ],
                                papers: [ ],
@@ -239,17 +237,6 @@ const AssessmentEntity =
                );
        },
 
-       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(
index 65d594b..8bc08d5 100644 (file)
@@ -132,9 +132,6 @@ const AssessmentModel =
                AssessmentEntity.endAssessment(aid, number, password, (err,ret) => {
                        if (!!err || !ret)
                                return cb(err,ret);
-                       AssessmentEntity.getConclusion(aid, (err2,conclusion) => {
-                               cb(err2, {conclusion:conclusion});
-                       });
                });
        },
 };
index 342e963..95cd4d7 100644 (file)
@@ -274,7 +274,6 @@ new Vue({
                                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
                                },
index 530713a..625fb42 100644 (file)
@@ -42,7 +42,6 @@ Validator.Assessment = {
        "display": "alphanumeric", //"one" or "all"
        "time": "integer",
        "introduction": "string",
-       "conclusion": "string",
        "coefficient": "number",
        "questions": Validator.Question,
        "papers": Validator.Paper,
index 7677063..1baab9c 100644 (file)
@@ -47,10 +47,6 @@ button.sendAnswer {
        padding: 20px 5px;
 }
 
-.conclusion {
-       padding: 20px 5px;
-}
-
 .timer {
        font-size: 2rem;
 }
index 178e824..20c9527 100644 (file)
@@ -57,10 +57,6 @@ tr.stats {
        margin-top: 20px;
 }
 
-.conclusion {
-       margin-bottom: 20px;
-}
-
 table.in-question {
        border: 1px solid black;
        width: auto;
index 303d68e..20406b3 100644 (file)
@@ -38,9 +38,6 @@
 .introduction {
        padding: 20px 5px;
 }
-.conclusion {
-       padding: 20px 5px;
-}
 table.in-question {
        border: 1px solid black;
        width: auto;
index b7dcfd9..c1a99cf 100644 (file)
@@ -37,7 +37,6 @@ router.post("/update/assessment", access.ajax, access.logged, (req,res) => {
        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?!)
@@ -119,11 +118,11 @@ router.get("/end/assessment", access.ajax, (req,res) => {
        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({});
                });
        });
 });
index f6c77a2..a78ba0d 100644 (file)
@@ -114,8 +114,7 @@ router.get("/:initials([a-z0-9]+)/:courseCode([a-z0-9._-]+)/:assessmentName([a-z
                                        // 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", {
index 9e8550f..87d9fba 100644 (file)
@@ -51,9 +51,6 @@ block content
                                #stage3(v-show="stage==3")
                                        .card
                                                .finish Exam completed &#9786; ...don't close the window!
-                               #stage3_4(v-show="[3,4].includes(stage)")
-                                       .card
-                                               .conclusion(v-html="assessment.conclusion")
 
 block append javascripts
        script.
index 8d2dce4..87788e3 100644 (file)
@@ -56,9 +56,6 @@ block content
                                                .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
@@ -179,7 +176,6 @@ block content
                                                                        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
index f7eda27..5a0abf4 100644 (file)
@@ -28,8 +28,6 @@ block content
                                                .introduction(v-html="assessment.introduction")
                                        .card
                                                statements(:questions="assessment.questions" :answers:"answers")
-                                       .card
-                                               .conclusion(v-html="assessment.conclusion")
 
 block append javascripts
        script.
index fa9daee..7b257ec 100644 (file)
@@ -39,8 +39,6 @@ block content
                                                        .introduction(v-html="assessment.introduction")
                                                .card
                                                        statements(:questions="assessment.questions" :answers="answers")
-                                               .card
-                                                       .conclusion(v-html="assessment.conclusion")
 
 block append javascripts
        script.