From c73d4b90fc00f43a90272ee00c9ae30bfe20287a Mon Sep 17 00:00:00 2001 From: "Dave St.Germain" Date: Thu, 6 Dec 2018 12:14:36 -0500 Subject: [PATCH 1/2] Use instructions from the subclass instead of from the API request --- edx_proctoring/__init__.py | 2 +- edx_proctoring/backends/rest.py | 9 +++++++++ edx_proctoring/backends/tests/test_rest.py | 3 ++- .../templates/proctored_exam/instructions.html | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/edx_proctoring/__init__.py b/edx_proctoring/__init__.py index 06a6c5fedb6..65069270050 100644 --- a/edx_proctoring/__init__.py +++ b/edx_proctoring/__init__.py @@ -4,6 +4,6 @@ from __future__ import absolute_import -__version__ = '1.5.0b3' +__version__ = '1.5.0' default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name diff --git a/edx_proctoring/backends/rest.py b/edx_proctoring/backends/rest.py index 80f4c7ce79b..465cbdc544a 100644 --- a/edx_proctoring/backends/rest.py +++ b/edx_proctoring/backends/rest.py @@ -59,6 +59,11 @@ def instructor_url(self): "Returns the instructor dashboard url" return self.base_url + u'/api/v1/instructor/{client_id}/?jwt={jwt}' + @property + def proctoring_instructions(self): + "Returns the (optional) proctoring instructions" + return [] + def __init__(self, client_id=None, client_secret=None, **kwargs): """ Initialize REST backend. @@ -139,6 +144,10 @@ def get_attempt(self, attempt): attempt['proctored_exam']['external_id'], attempt['external_id'], method='GET') + # If the class has instructions defined, use them. + # Otherwise, the instructions should be returned by this + # API request. Subclasses should wrap each instruction with gettext + response['instructions'] = self.proctoring_instructions or response.get('instructions', []) return response def register_exam_attempt(self, exam, context): diff --git a/edx_proctoring/backends/tests/test_rest.py b/edx_proctoring/backends/tests/test_rest.py index dab294dbaf0..617ad3ee825 100644 --- a/edx_proctoring/backends/tests/test_rest.py +++ b/edx_proctoring/backends/tests/test_rest.py @@ -80,7 +80,8 @@ def test_get_attempt(self): 'id': 1, 'external_id': 'abcd', 'proctored_exam': self.backend_exam, - 'user': 1 + 'user': 1, + 'instructions': [], } responses.add( responses.GET, diff --git a/edx_proctoring/templates/proctored_exam/instructions.html b/edx_proctoring/templates/proctored_exam/instructions.html index 7153b8bb306..da639e129a9 100644 --- a/edx_proctoring/templates/proctored_exam/instructions.html +++ b/edx_proctoring/templates/proctored_exam/instructions.html @@ -195,7 +195,7 @@

{% trans "Cannot Start Proctored Exam" %}

}, success: function (data) { newWindow.location = "{{software_download_url|safe}}"; - setTimeout(poll_until_ready, 15000); + // setTimeout(poll_until_ready, 15000); } }).fail(function(){ newWindow.close(); From 3f12598c597d7b7f4f0a7dcd16914ddc7ad6767f Mon Sep 17 00:00:00 2001 From: "Dave St.Germain" Date: Thu, 6 Dec 2018 14:54:11 -0500 Subject: [PATCH 2/2] Synchronize version numbers between JS and Python packages --- .travis.yml | 1 - edx_proctoring/__init__.py | 3 ++- edx_proctoring/templates/proctored_exam/instructions.html | 1 - package.json | 3 ++- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2ff982bdc7d..15f709b2468 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,4 +35,3 @@ deploy: secure: Bs6z6iFpO86mav8qo3cDhcjDckNXDGfcbuZtSWbbrIFe9Q0VSVz046s9Yo7hHjjaRUSb6frlTC8lYRNDZ2m7TxXrh4vXHrHsr9ajcJXUZJCwqnnxIEFeHe02hD/7RPJ3xK7tkGCxd/2AUHEHXYylGOePDc/Ck/2VYmGQ0EijcfZeOJ5macZ65TP0Kwvf+IDOko++W94f3Ujglu+lWryBTR61Yaf7zt7fKQVgjxGQjb07F1ze39A00xkYYYbIDSrzjZeebs/pzCjZhrrkzTwReDItTxk9K7cEx5nlRvQul6Wj5USe1uBL5SodP2XCp3mi7XrB/LOt6kDEcdREUzqZUqB5n21VVey0JWihd579PIHFhTXDQpdSJNhOi86Mv8lj3v/XUTRaZBV+2OPVGKSRgmJ0Qv7BkQXOp8tzSN4AINrYD2bMod3jVaGcjg7MYUpJ7B2swWUSa0aLLUe1M2RYzfQ2CiGeN9jCdz8jmQie+HGc5CkaMFtoT1OUt1R7wuO2RNo8pYrP0KJTWpOCHlGn+5r17iDOPXoc/m6a5wN3sxMrARqF5A/PRv3uY/Nb+4bfTeczDZudpxVxGFxe85rahXjh7tSHX5JOiaOXDO9xWj2EBRKKeD4xbgRSBZvjnRrZ0f9ygZjuzFv86KixwYI3HFo21SJQmIaJIUSOoM+r1lQ= on: tags: true - condition: $TRAVIS_TAG =~ ^npmv.*$ diff --git a/edx_proctoring/__init__.py b/edx_proctoring/__init__.py index 65069270050..b2d90d2d540 100644 --- a/edx_proctoring/__init__.py +++ b/edx_proctoring/__init__.py @@ -4,6 +4,7 @@ from __future__ import absolute_import -__version__ = '1.5.0' +# Be sure to update the version number in edx_proctoring/package.json +__version__ = '1.5.0rc1' default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name diff --git a/edx_proctoring/templates/proctored_exam/instructions.html b/edx_proctoring/templates/proctored_exam/instructions.html index da639e129a9..d934e45ae05 100644 --- a/edx_proctoring/templates/proctored_exam/instructions.html +++ b/edx_proctoring/templates/proctored_exam/instructions.html @@ -195,7 +195,6 @@

{% trans "Cannot Start Proctored Exam" %}

}, success: function (data) { newWindow.location = "{{software_download_url|safe}}"; - // setTimeout(poll_until_ready, 15000); } }).fail(function(){ newWindow.close(); diff --git a/package.json b/package.json index 08eb6801d6c..c5f4686762a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "@edx/edx-proctoring", - "version": "1.0.0", + "//": "Be sure to update the version number in edx_proctoring/__init__.py", + "version": "1.5.0-rc.1", "main": "edx_proctoring/static/index.js", "repository": { "type": "git",