Skip to content

Commit f5df57f

Browse files
author
Douglas Hall
committed
Merge pull request #289 from edx/afzaledx/SOL-1780-polling-interval-too-short
Increased in-exam polling interval from 5 seconds to 30 seconds.
2 parents da76a63 + d00ee3c commit f5df57f

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

edx_proctoring/static/proctoring/js/views/proctored_exam_view.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,14 @@ var edx = edx || {};
136136
updateRemainingTime: function (self) {
137137
self.timerTick ++;
138138
self.secondsLeft --;
139-
if (self.timerTick % 5 === 0){
140-
var url = self.model.url + '/' + self.model.get('attempt_id');
139+
if (self.timerTick % 30 === 0){
140+
var url = self.model.url + '/' + self.model.get('attempt_id') + '?sourceid=in_exam';
141141
$.ajax(url).success(function(data) {
142142
if (data.status === 'error') {
143143
// The proctoring session is in error state
144-
// refresh the page to
144+
// refresh the page to bring up the new Proctoring state from the backend.
145145
clearInterval(self.timerId); // stop the timer once the time finishes.
146146
$(window).unbind('beforeunload', self.unloadMessage);
147-
// refresh the page when the timer expired
148147
location.reload();
149148
}
150149
else {

edx_proctoring/static/proctoring/spec/proctored_exam_spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe('ProctoredExamView', function () {
6262
expect(reloadPage).toHaveBeenCalled();
6363
});
6464
it("resets the remainig exam time after the ajax response", function(){
65-
this.server.respondWith("GET", "/api/edx_proctoring/v1/proctored_exam/attempt/" + this.proctored_exam_view.model.get('attempt_id'),
65+
this.server.respondWith("GET", "/api/edx_proctoring/v1/proctored_exam/attempt/" + this.proctored_exam_view.model.get('attempt_id') + '?sourceid=in_exam',
6666
[
6767
200,
6868
{"Content-Type": "application/json"},
@@ -71,7 +71,7 @@ describe('ProctoredExamView', function () {
7171
})
7272
]
7373
);
74-
this.proctored_exam_view.timerTick = 4; // to make the ajax call.
74+
this.proctored_exam_view.timerTick = 29; // to make the ajax call.
7575
var reloadPage = spyOn(this.proctored_exam_view, 'reloadPage');
7676
this.proctored_exam_view.updateRemainingTime(this.proctored_exam_view);
7777
this.server.respond();

edx_proctoring/templates/proctored_exam/instructions.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ <h3>
9595
});
9696

9797
function poll_exam_started() {
98-
var url = $('.instructions').data('exam-started-poll-url');
98+
var url = $('.instructions').data('exam-started-poll-url') + '?sourceid=instructions';
9999
$.ajax(url).success(function(data){
100100
if (data.status === 'ready_to_start') {
101101
if (_waiting_for_proctored_interval != null) {

edx_proctoring/templates/proctored_exam/waiting_for_app_shutdown.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ <h3>
3030
});
3131

3232
function poll_exam_started() {
33-
var url = '{{ exam_started_poll_url }}';
33+
var url = '{{ exam_started_poll_url }}' + '?sourceid=app_shutdown';
3434
$.ajax(url).success(function(data){
3535
if (data.status === 'submitted') {
3636
// Do we believe the client proctoring app has shut down

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def load_requirements(*requirements_paths):
3434

3535
setup(
3636
name='edx-proctoring',
37-
version='0.12.16',
37+
version='0.12.17',
3838
description='Proctoring subsystem for Open edX',
3939
long_description=open('README.md').read(),
4040
author='edX',

0 commit comments

Comments
 (0)