Skip to content

Commit

Permalink
Merge pull request #476 from edx/dcs/local-instructions
Browse files Browse the repository at this point in the history
Use instructions from the subclass instead of from the API request
  • Loading branch information
davestgermain authored Dec 6, 2018
2 parents 8d9aa23 + 3f12598 commit 15a02d8
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.*$
3 changes: 2 additions & 1 deletion edx_proctoring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from __future__ import absolute_import

__version__ = '1.5.0b3'
# 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
9 changes: 9 additions & 0 deletions edx_proctoring/backends/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion edx_proctoring/backends/tests/test_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion edx_proctoring/templates/proctored_exam/instructions.html
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ <h2 id="acessible-error-title">{% trans "Cannot Start Proctored Exam" %}</h2>
},
success: function (data) {
newWindow.location = "{{software_download_url|safe}}";
setTimeout(poll_until_ready, 15000);
}
}).fail(function(){
newWindow.close();
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 15a02d8

Please sign in to comment.