Skip to content

Commit

Permalink
Revert "Show scores in review mode if reviewShowScore is true but exp…
Browse files Browse the repository at this point in the history
…ected answers haven't been revealed."

This reverts commit a35a855.

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.
  • Loading branch information
christianp committed Sep 26, 2023
1 parent 0168ea2 commit 737ea37
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 23 deletions.
4 changes: 1 addition & 3 deletions themes/default/files/scripts/display-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,6 @@ display.measureText = function(element) {
* @property {observable.<number>} credit - Proportion of available marks awarded
* @property {observable.<boolean>} doesMarking - Does the object do any marking?
* @property {observable.<boolean>} revealed - Have the correct answers been revealed?
* @property {observable.<string>} 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}
Expand Down Expand Up @@ -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) {
Expand All @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions themes/default/files/scripts/exam-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -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?
*
Expand Down Expand Up @@ -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);
Expand Down
9 changes: 0 additions & 9 deletions themes/default/files/scripts/part-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 0 additions & 9 deletions themes/default/files/scripts/question-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 737ea37

Please sign in to comment.