Skip to content

Commit

Permalink
Merge pull request #480 from edx/matthugs/non-js-provider-error-state…
Browse files Browse the repository at this point in the history
…-bug

Fix bug wherein non-JS proctoring providers attempt to ping
  • Loading branch information
matthugs committed Dec 10, 2018
2 parents 15a02d8 + 04c337f commit 06131ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,11 @@ var edx = edx || {};
updateRemainingTime: function (self) {
self.timerTick ++;
self.secondsLeft --;
if (self.timerTick % self.poll_interval === self.poll_interval / 2) {
edx.courseware.proctored_exam.pingApplication().catch(self.endExamForFailureState.bind(self));
if (
self.timerTick % self.poll_interval === self.poll_interval / 2 &&
edx.courseware.proctored_exam.configuredWorkerURL
) {
edx.courseware.proctored_exam.pingApplication().catch(self.endExamForFailureState.bind(self));
}
if (self.timerTick % self.poll_interval === 0) {
var url = self.model.url + '/' + self.model.get('attempt_id');
Expand Down
4 changes: 3 additions & 1 deletion edx_proctoring/static/proctoring/spec/proctored_exam_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,12 @@ describe('ProctoredExamView', function () {
});
it("calls external js global function on off-beat", function() {
edx.courseware.proctored_exam.pingApplication = jasmine.createSpy().and.returnValue(Promise.resolve());
edx.courseware.proctored_exam.configuredWorkerURL = 'nonempty/string.html';
this.proctored_exam_view.timerTick = this.proctored_exam_view.poll_interval / 2 - 1;
this.proctored_exam_view.updateRemainingTime(this.proctored_exam_view);
expect(edx.courseware.proctored_exam.pingApplication).toHaveBeenCalled();
delete edx.courseware.proctored_exam.pingApplication
delete edx.courseware.proctored_exam.pingApplication;
delete edx.courseware.proctored_exam.configuredWorkerURL;
});
it("reloads the page after failure-state ajax call", function(done) {
this.server.respondWith(
Expand Down

0 comments on commit 06131ca

Please sign in to comment.