Commit cf3dfce2 by Joshua Spayd Committed by Farhanah Sheets

Add ability to toggle timer visibility

For timed exams
parent 23ab09c4
...@@ -49,6 +49,9 @@ var edx = edx || {}; ...@@ -49,6 +49,9 @@ var edx = edx || {};
/* will call into the rendering */ /* will call into the rendering */
this.model.fetch(); this.model.fetch();
}, },
events: {
'click #toggle_timer': 'toggleTimerVisibility'
},
detectScroll: function(event) { detectScroll: function(event) {
if ($(event.currentTarget).scrollTop() > this.timerBarTopPosition) { if ($(event.currentTarget).scrollTop() > this.timerBarTopPosition) {
$(".proctored_exam_status").addClass('is-fixed'); $(".proctored_exam_status").addClass('is-fixed');
...@@ -171,6 +174,22 @@ var edx = edx || {}; ...@@ -171,6 +174,22 @@ var edx = edx || {};
// refresh the page when the timer expired // refresh the page when the timer expired
self.reloadPage(); self.reloadPage();
} }
},
toggleTimerVisibility: function (event) {
var button = $(event.currentTarget);
var icon = button.find('i');
var timer = this.$el.find('span#time_remaining_id b');
if (timer.css('visibility') === 'visible') {
timer.css('visibility', 'hidden');
button.attr('title', gettext('Show Timer'));
icon.removeClass('fa-eye-slash').addClass('fa-eye');
} else {
timer.css('visibility', 'visible');
button.attr('title', gettext('Hide Timer'));
icon.removeClass('fa-eye').addClass('fa-eye-slash');
}
event.stopPropagation();
event.preventDefault();
} }
}); });
this.edx.coursware.proctored_exam.ProctoredExamView = edx.coursware.proctored_exam.ProctoredExamView; this.edx.coursware.proctored_exam.ProctoredExamView = edx.coursware.proctored_exam.ProctoredExamView;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment