Commit f19c4ab7 by Eric Fischer

WIP

parent 4d8db4fd
...@@ -70,7 +70,7 @@ class MockProctoringBackendProvider(ProctoringBackendProvider): ...@@ -70,7 +70,7 @@ class MockProctoringBackendProvider(ProctoringBackendProvider):
the URL that the user needs to go to in order to download the URL that the user needs to go to in order to download
the corresponding desktop software the corresponding desktop software
""" """
return "mockurl" return "api/edx_proctoring/v1/proctored_exam/attempt"
def on_review_callback(self, payload): def on_review_callback(self, payload):
""" """
......
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
function check_exam_started() { function check_exam_started() {
var url = $('.instructions').data('exam-started-poll-url') + '?sourceid=instructions'; var url = $('.instructions').data('exam-started-poll-url');
$.ajax(url).success(function(data){ $.ajax(url).success(function(data){
if (data.status === 'ready_to_start') { if (data.status === 'ready_to_start') {
// we've state transitioned, so refresh the page // we've state transitioned, so refresh the page
...@@ -157,26 +157,15 @@ ...@@ -157,26 +157,15 @@
$('.start-proctored-exam').click(check_exam_started); $('.start-proctored-exam').click(check_exam_started);
$("#software_download_link").click(function (e) { $("#software_download_link").click(function (e) {
e.preventDefault();
var url = $('.instructions').data('exam-started-poll-url');
var action = $(this).data('action');
// open the new tab in the click event with an empty URL but show the message.
var newWindow = window.open("", "_blank");
$(newWindow.document.body).html("<p>Please wait while you are being redirected...</p>");
var self = this;
$.ajax({ $.ajax({
url: url, url: "{{software_download_url}}",
type: 'PUT', type: 'POST',
data: { data: {
action: action start_clock: true,
}, attempt_proctored: true,
success: function (data) { exam_id: $('.instructions').data('exam-id')
newWindow.location = "{{software_download_url}}"; }
} );
}).fail(function(){
newWindow.close();
});
}); });
</script> </script>
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