Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-proctoring
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
edx-proctoring
Commits
1088e5d5
Commit
1088e5d5
authored
Oct 05, 2016
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor SS polling code.
parent
85bd3040
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
edx_proctoring/callbacks.py
+2
-1
edx_proctoring/templates/proctored_exam/proctoring_launch_callback.html
+17
-4
No files found.
edx_proctoring/callbacks.py
View file @
1088e5d5
...
@@ -68,7 +68,8 @@ def start_exam_callback(request, attempt_code): # pylint: disable=unused-argume
...
@@ -68,7 +68,8 @@ def start_exam_callback(request, attempt_code): # pylint: disable=unused-argume
Context
({
Context
({
'exam_attempt_status_url'
:
poll_url
,
'exam_attempt_status_url'
:
poll_url
,
'platform_name'
:
settings
.
PLATFORM_NAME
,
'platform_name'
:
settings
.
PLATFORM_NAME
,
'link_urls'
:
settings
.
PROCTORING_SETTINGS
.
get
(
'LINK_URLS'
,
{})
'link_urls'
:
settings
.
PROCTORING_SETTINGS
.
get
(
'LINK_URLS'
,
{}),
'default_polling_interval'
:
constants
.
DEFAULT_CLIENT_POLLING_INTERVAL
,
})
})
)
)
)
)
...
...
edx_proctoring/templates/proctored_exam/proctoring_launch_callback.html
View file @
1088e5d5
...
@@ -187,12 +187,25 @@
...
@@ -187,12 +187,25 @@
</div>
</div>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
var
_poll_interval
=
null
;
var
_poll_interval_id
=
null
;
var
_current_interval
;
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
poll_exam_status
();
set_poll_interval
({{
default_polling_interval
}});
poll_exam_status
();
});
});
function
set_poll_interval
(
new_polling_interval
)
{
// The polling interval will be in seconds, so we need to multiply by 1000 to get the interval in miliseconds.
new_pollint_interval
=
new_polling_interval
*
1000
;
if
(
new_polling_interval
!=
_current_interval
)
{
clearInterval
(
_poll_interval_id
);
_poll_interval_id
=
setInterval
(
poll_exam_status
,
new_polling_interval
);
}
}
function
poll_exam_status
()
{
function
poll_exam_status
()
{
var
url
=
'{{exam_attempt_status_url}}'
;
var
url
=
'{{exam_attempt_status_url}}'
;
...
@@ -203,9 +216,9 @@
...
@@ -203,9 +216,9 @@
// NOTE: This is per the API documentation from SoftwareSecure
// NOTE: This is per the API documentation from SoftwareSecure
window
.
external
.
quitApplication
();
window
.
external
.
quitApplication
();
}
}
clearInterval
(
_poll_interval
);
// The polling interval is returned in seconds, so we need to multiply by 1000.
// The polling interval is returned in seconds, so we need to multiply by 1000.
_poll_interval
=
setInterval
(
poll_exam_status
,
parseInt
(
data
.
polling_interval
)
*
1000
);
set_poll_interval
(
parseInt
(
data
.
polling_intervall
)
);
});
});
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment