From 737ea37d03e6641ec6cb033508d7fe922f0d6b21 Mon Sep 17 00:00:00 2001 From: Christian Lawson-Perfect Date: Tue, 26 Sep 2023 11:32:31 +0100 Subject: [PATCH] Revert "Show scores in review mode if reviewShowScore is true but expected answers haven't been revealed." This reverts commit a35a8559967128a9a7a27eaf583ccc88dfa5996a. see #1042. The reverted commit tried to make it so that scores could be shown immediately after finishing the exam, but not expected answers. However, this has made it impossible to *not* show scores immediately, only once re-entering in review mode. Until there are enough settings to express this, the safest thing is to go with the old behaviour, where less information was revealed to students. --- themes/default/files/scripts/display-base.js | 4 +--- themes/default/files/scripts/exam-display.js | 4 ++-- themes/default/files/scripts/part-display.js | 9 --------- themes/default/files/scripts/question-display.js | 9 --------- 4 files changed, 3 insertions(+), 23 deletions(-) diff --git a/themes/default/files/scripts/display-base.js b/themes/default/files/scripts/display-base.js index dece73530..7c0d3c0dd 100644 --- a/themes/default/files/scripts/display-base.js +++ b/themes/default/files/scripts/display-base.js @@ -489,7 +489,6 @@ display.measureText = function(element) { * @property {observable.} credit - Proportion of available marks awarded * @property {observable.} doesMarking - Does the object do any marking? * @property {observable.} revealed - Have the correct answers been revealed? - * @property {observable.} exam_mode - The mode of the exam this object belongs to. * @property {boolean} plainScore - Show the score without the "Score: " prefix? */ /** Settings for {@link Numbas.display.showScoreFeedback} @@ -533,7 +532,6 @@ var showScoreFeedback = display.showScoreFeedback = function(obj,settings) var attempted = Knockout.computed(function() { return obj.visited!==undefined && obj.visited(); }); - var exam_mode = obj.exam_mode || 'normal'; var showFeedbackIcon = settings.showFeedbackIcon === undefined ? settings.showAnswerState : settings.showFeedbackIcon; var anyAnswered = Knockout.computed(function() { if(obj.anyAnswered===undefined) { @@ -546,7 +544,7 @@ var showScoreFeedback = display.showScoreFeedback = function(obj,settings) return anyAnswered() && !answered(); },this); var revealed = Knockout.computed(function() { - return ((obj.revealed() || Knockout.unwrap(exam_mode) == 'review') && settings.reviewShowScore) || Numbas.is_instructor; + return (obj.revealed() && settings.reviewShowScore) || Numbas.is_instructor; }); var state = Knockout.computed(function() { var score = obj.score(); diff --git a/themes/default/files/scripts/exam-display.js b/themes/default/files/scripts/exam-display.js index 0669630eb..7a5c59631 100644 --- a/themes/default/files/scripts/exam-display.js +++ b/themes/default/files/scripts/exam-display.js @@ -131,7 +131,7 @@ Numbas.queueScript('exam-display',['display-base','math','util','timing'],functi * @memberof Numbas.display.ExamDisplay */ this.showActualMark = Knockout.computed(function() { - return e.settings.showActualMark || ((this.revealed() || this.mode()=='review') && e.settings.reviewShowScore) || Numbas.is_instructor; + return e.settings.showActualMark || (this.revealed() && e.settings.reviewShowScore) || Numbas.is_instructor; },this); /** Allow the student to print an exam transcript? * @@ -180,7 +180,7 @@ Numbas.queueScript('exam-display',['display-base','math','util','timing'],functi var score = this.score(); var marks = this.marks(); var totalExamScoreDisplay = ''; - if(exam.settings.showTotalMark || this.mode() == 'review') + if(exam.settings.showTotalMark) totalExamScoreDisplay = niceNumber(score)+'/'+niceNumber(marks); else totalExamScoreDisplay = niceNumber(score); diff --git a/themes/default/files/scripts/part-display.js b/themes/default/files/scripts/part-display.js index bb8006ca4..84a466c29 100644 --- a/themes/default/files/scripts/part-display.js +++ b/themes/default/files/scripts/part-display.js @@ -246,15 +246,6 @@ Numbas.queueScript('part-display',['display-base','util','jme'],function() { * @memberof Numbas.display.PartDisplay */ this.revealed = Knockout.observable(false); - - /** The mode of the exam this part belongs to. - * - * @see Numbas.display.ExamDisplay#mode - * @member {observable|string} exam_mode - * @memberof Numbas.display.PartDisplay - */ - this.exam_mode = p.question.exam.display.mode; - /** Has this part been locked? * * @member {observable|boolean} locked diff --git a/themes/default/files/scripts/question-display.js b/themes/default/files/scripts/question-display.js index a227157e0..2fa1abef4 100644 --- a/themes/default/files/scripts/question-display.js +++ b/themes/default/files/scripts/question-display.js @@ -203,15 +203,6 @@ Numbas.queueScript('question-display',['display-base','jme-variables','xml','sch * @memberof Numbas.display.QuestionDisplay */ this.revealed = Knockout.observable(q.revealed); - - /* The mode of this question's exam. - * - * @member {observable|string} exam_mode - * @memberof Numbas.display.QuestionDisplay - * @see Numbas.display.ExamDisplay#mode - */ - this.exam_mode = exam.display.mode; - /** Have any of this question's parts been answered? * * @member {observable|boolean} anyAnswered