Skip to content

Commit

Permalink
feat: [BD-26] Fix generic backend providers to include missing method (
Browse files Browse the repository at this point in the history
…#903)

* fix: add get_proctoring_config method to generic backend provider class which caused learning app crash for proctored exams setup with generic providers

* tests: add additional test for base backend provider class

* docs: update package version and changelog
  • Loading branch information
viktorrusakov committed Jul 14, 2021
1 parent 9c25a04 commit 5e66997
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 3 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ Change Log
Unreleased
~~~~~~~~~~

[3.17.1] - 2021-07-2
[3.17.3] - 2021-07-14
~~~~~~~~~~~~~~~~~~~~~
* Add missing get_proctoring_config method to base backend provider class.

[3.17.2] - 2021-07-2
~~~~~~~~~~~~~~~~~~~~~
* Updated ProctoredExamAttempt view to use the content id from the query.

Expand Down
2 changes: 1 addition & 1 deletion edx_proctoring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"""

# Be sure to update the version number in edx_proctoring/package.json
__version__ = '3.17.2'
__version__ = '3.17.3'

default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name
6 changes: 6 additions & 0 deletions edx_proctoring/backends/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,9 @@ def get_onboarding_profile_info(self, course_id, **kwargs):
Returns onboarding profile information for a given course and optional user
"""
return None

def get_proctoring_config(self):
"""
Returns the metadata and configuration options for the proctoring service
"""
return None
12 changes: 12 additions & 0 deletions edx_proctoring/backends/software_secure.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,3 +390,15 @@ def should_block_access_to_exam_material(self):
req = get_current_request()
# pylint: disable=illegal-waffle-usage
return not req.get_signed_cookie('exam', default=False)

def get_proctoring_config(self):
"""
Returns the metadata and configuration options for the proctoring service
"""
proctoring_config = {
'download_url': self.get_software_download_url(),
'name': self.verbose_name,
'rules': {},
'instructions': []
}
return proctoring_config
2 changes: 2 additions & 0 deletions edx_proctoring/backends/tests/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ def test_raises_exception(self):

self.assertIsNone(provider.get_onboarding_profile_info(course_id='test'))

self.assertIsNone(provider.get_proctoring_config())

def test_null_provider(self):
"""
Assert that the Null provider does nothing
Expand Down
11 changes: 11 additions & 0 deletions edx_proctoring/backends/tests/test_software_secure.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,17 @@ def test_get_software_download_url(self):
provider = get_backend_provider()
self.assertEqual(provider.get_software_download_url(), 'http://example.com')

def test_get_proctoring_config(self):
"""
Makes sure proctoring config is returned
"""

provider = get_backend_provider()
config = provider.get_proctoring_config()
self.assertIsNotNone(config)
self.assertEqual(config['name'], provider.verbose_name)
self.assertEqual(config['download_url'], 'http://example.com')

def test_register_attempt(self):
"""
Makes sure we can register an attempt
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@edx/edx-proctoring",
"//": "Be sure to update the version number in edx_proctoring/__init__.py",
"//": "Note that the version format is slightly different than that of the Python version when using prereleases.",
"version": "3.17.2",
"version": "3.17.3",
"main": "edx_proctoring/static/index.js",
"scripts": {
"test": "gulp test"
Expand Down

0 comments on commit 5e66997

Please sign in to comment.