edx-proctoring 6.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- edx_proctoring/__init__.py +6 -0
- edx_proctoring/admin.py +502 -0
- edx_proctoring/api.py +3269 -0
- edx_proctoring/apps.py +162 -0
- edx_proctoring/backends/LICENSE.txt +202 -0
- edx_proctoring/backends/README.txt +1 -0
- edx_proctoring/backends/__init__.py +20 -0
- edx_proctoring/backends/backend.py +162 -0
- edx_proctoring/backends/mock.py +105 -0
- edx_proctoring/backends/null.py +61 -0
- edx_proctoring/backends/rest.py +422 -0
- edx_proctoring/backends/software_secure.py +423 -0
- edx_proctoring/backends/tests/__init__.py +3 -0
- edx_proctoring/backends/tests/test_backend.py +363 -0
- edx_proctoring/backends/tests/test_rest.py +624 -0
- edx_proctoring/backends/tests/test_review_payload.py +102 -0
- edx_proctoring/backends/tests/test_software_secure.py +628 -0
- edx_proctoring/callbacks.py +66 -0
- edx_proctoring/constants.py +83 -0
- edx_proctoring/decorators.py +3 -0
- edx_proctoring/exceptions.py +188 -0
- edx_proctoring/handlers.py +229 -0
- edx_proctoring/instructor_dashboard_exam_urls.py +19 -0
- edx_proctoring/locale/ar/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/ar/LC_MESSAGES/django.po +1445 -0
- edx_proctoring/locale/ar/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/ar/LC_MESSAGES/djangojs.po +1443 -0
- edx_proctoring/locale/ca/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/ca/LC_MESSAGES/django.po +1464 -0
- edx_proctoring/locale/ca/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/ca/LC_MESSAGES/djangojs.po +1463 -0
- edx_proctoring/locale/config.yaml +73 -0
- edx_proctoring/locale/cs/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/cs/LC_MESSAGES/django.po +1632 -0
- edx_proctoring/locale/cs/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/cs/LC_MESSAGES/djangojs.po +1634 -0
- edx_proctoring/locale/de_DE/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/de_DE/LC_MESSAGES/django.po +1461 -0
- edx_proctoring/locale/de_DE/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/de_DE/LC_MESSAGES/djangojs.po +1461 -0
- edx_proctoring/locale/el/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/el/LC_MESSAGES/django.po +1389 -0
- edx_proctoring/locale/el/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/el/LC_MESSAGES/djangojs.po +1387 -0
- edx_proctoring/locale/en/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/en/LC_MESSAGES/django.po +1476 -0
- edx_proctoring/locale/en/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/en/LC_MESSAGES/djangojs.po +264 -0
- edx_proctoring/locale/eo/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/eo/LC_MESSAGES/django.po +1880 -0
- edx_proctoring/locale/eo/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/eo/LC_MESSAGES/djangojs.po +304 -0
- edx_proctoring/locale/es_419/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/es_419/LC_MESSAGES/django.po +1783 -0
- edx_proctoring/locale/es_419/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/es_419/LC_MESSAGES/djangojs.po +1785 -0
- edx_proctoring/locale/es_AR/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/es_AR/LC_MESSAGES/django.po +1654 -0
- edx_proctoring/locale/es_AR/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/es_AR/LC_MESSAGES/djangojs.po +1655 -0
- edx_proctoring/locale/es_ES/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/es_ES/LC_MESSAGES/django.po +1655 -0
- edx_proctoring/locale/es_ES/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/es_ES/LC_MESSAGES/djangojs.po +1652 -0
- edx_proctoring/locale/eu_ES/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/eu_ES/LC_MESSAGES/django.po +1378 -0
- edx_proctoring/locale/eu_ES/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/eu_ES/LC_MESSAGES/djangojs.po +1378 -0
- edx_proctoring/locale/fa_IR/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/fa_IR/LC_MESSAGES/django.po +1666 -0
- edx_proctoring/locale/fa_IR/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/fa_IR/LC_MESSAGES/djangojs.po +1665 -0
- edx_proctoring/locale/fr/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/fr/LC_MESSAGES/django.po +1805 -0
- edx_proctoring/locale/fr/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/fr/LC_MESSAGES/djangojs.po +1802 -0
- edx_proctoring/locale/fr_CA/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/fr_CA/LC_MESSAGES/django.po +1790 -0
- edx_proctoring/locale/fr_CA/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/fr_CA/LC_MESSAGES/djangojs.po +1793 -0
- edx_proctoring/locale/he/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/he/LC_MESSAGES/django.po +1444 -0
- edx_proctoring/locale/he/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/he/LC_MESSAGES/djangojs.po +1443 -0
- edx_proctoring/locale/id/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/id/LC_MESSAGES/django.po +1390 -0
- edx_proctoring/locale/id/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/id/LC_MESSAGES/djangojs.po +1389 -0
- edx_proctoring/locale/it_IT/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/it_IT/LC_MESSAGES/django.po +1715 -0
- edx_proctoring/locale/it_IT/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/it_IT/LC_MESSAGES/djangojs.po +1715 -0
- edx_proctoring/locale/ja_JP/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/ja_JP/LC_MESSAGES/djangojs.po +1387 -0
- edx_proctoring/locale/ka/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/ka/LC_MESSAGES/django.po +1380 -0
- edx_proctoring/locale/ka/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/ka/LC_MESSAGES/djangojs.po +1380 -0
- edx_proctoring/locale/lv/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/lv/LC_MESSAGES/django.po +1377 -0
- edx_proctoring/locale/lv/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/lv/LC_MESSAGES/djangojs.po +1377 -0
- edx_proctoring/locale/mn/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/mn/LC_MESSAGES/django.po +1434 -0
- edx_proctoring/locale/mn/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/mn/LC_MESSAGES/djangojs.po +1379 -0
- edx_proctoring/locale/nb/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/nb/LC_MESSAGES/django.po +1393 -0
- edx_proctoring/locale/nb/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/nb/LC_MESSAGES/djangojs.po +1393 -0
- edx_proctoring/locale/pl/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/pl/LC_MESSAGES/django.po +1386 -0
- edx_proctoring/locale/pl/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/pl/LC_MESSAGES/djangojs.po +1386 -0
- edx_proctoring/locale/pt_PT/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/pt_PT/LC_MESSAGES/django.po +1793 -0
- edx_proctoring/locale/pt_PT/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/pt_PT/LC_MESSAGES/djangojs.po +1810 -0
- edx_proctoring/locale/ro/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/ro/LC_MESSAGES/django.po +1382 -0
- edx_proctoring/locale/ro/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/ro/LC_MESSAGES/djangojs.po +1382 -0
- edx_proctoring/locale/ru/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/ru/LC_MESSAGES/django.po +1456 -0
- edx_proctoring/locale/ru/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/ru/LC_MESSAGES/djangojs.po +1459 -0
- edx_proctoring/locale/sw_KE/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/sw_KE/LC_MESSAGES/django.po +1462 -0
- edx_proctoring/locale/sw_KE/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/sw_KE/LC_MESSAGES/djangojs.po +1464 -0
- edx_proctoring/locale/tr_TR/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/tr_TR/LC_MESSAGES/django.po +1527 -0
- edx_proctoring/locale/tr_TR/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/tr_TR/LC_MESSAGES/djangojs.po +1527 -0
- edx_proctoring/locale/uk/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/uk/LC_MESSAGES/django.po +1443 -0
- edx_proctoring/locale/uk/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/uk/LC_MESSAGES/djangojs.po +1443 -0
- edx_proctoring/locale/zh_CN/LC_MESSAGES/django.mo +0 -0
- edx_proctoring/locale/zh_CN/LC_MESSAGES/django.po +1468 -0
- edx_proctoring/locale/zh_CN/LC_MESSAGES/djangojs.mo +0 -0
- edx_proctoring/locale/zh_CN/LC_MESSAGES/djangojs.po +1469 -0
- edx_proctoring/management/__init__.py +3 -0
- edx_proctoring/management/commands/__init__.py +3 -0
- edx_proctoring/management/commands/reset_attempts.py +87 -0
- edx_proctoring/management/commands/set_attempt_status.py +52 -0
- edx_proctoring/management/commands/set_is_attempt_active.py +104 -0
- edx_proctoring/management/commands/tests/__init__.py +3 -0
- edx_proctoring/management/commands/tests/test_reset_attempts.py +153 -0
- edx_proctoring/management/commands/tests/test_set_attempt_status.py +85 -0
- edx_proctoring/management/commands/tests/test_set_is_attempt_active.py +85 -0
- edx_proctoring/management/commands/tests/test_update_attempt_status_from_review.py +113 -0
- edx_proctoring/management/commands/tests/test_update_attempts_for_exam.py +62 -0
- edx_proctoring/management/commands/update_attempt_status_from_review.py +81 -0
- edx_proctoring/management/commands/update_attempts_for_exam.py +78 -0
- edx_proctoring/migrations/0001_initial.py +227 -0
- edx_proctoring/migrations/0002_proctoredexamstudentattempt_is_status_acknowledged.py +18 -0
- edx_proctoring/migrations/0003_auto_20160101_0525.py +24 -0
- edx_proctoring/migrations/0004_auto_20160201_0523.py +19 -0
- edx_proctoring/migrations/0005_proctoredexam_hide_after_due.py +19 -0
- edx_proctoring/migrations/0006_allowed_time_limit_mins.py +24 -0
- edx_proctoring/migrations/0007_proctoredexam_backend.py +20 -0
- edx_proctoring/migrations/0008_auto_20181116_1551.py +32 -0
- edx_proctoring/migrations/0009_proctoredexamreviewpolicy_remove_rules.py +23 -0
- edx_proctoring/migrations/0010_update_backend.py +32 -0
- edx_proctoring/migrations/0011_allow_multiple_attempts.py +17 -0
- edx_proctoring/migrations/0012_proctoredexamstudentattempt_time_remaining_seconds.py +18 -0
- edx_proctoring/migrations/0013_proctoredexamsoftwaresecurereview_is_active_attempt.py +23 -0
- edx_proctoring/migrations/0014_add_is_resumable_to_proctoredexamstudentattempt.py +23 -0
- edx_proctoring/migrations/0015_rm_proctoredexamstudentattempt_ips.py +29 -0
- edx_proctoring/migrations/0016_nullable_proctoredexamstudentattempt_name.py +23 -0
- edx_proctoring/migrations/0017_rm_proctoredexamstudentattempt_name.py +21 -0
- edx_proctoring/migrations/0018_historicalproctoredexamstudentattempt.py +53 -0
- edx_proctoring/migrations/0019_proctoredexamsoftwaresecurereview_encrypted_video_url.py +18 -0
- edx_proctoring/migrations/0020_auto_20211028_1915.py +23 -0
- edx_proctoring/migrations/0021_auto_20211029_1353.py +26 -0
- edx_proctoring/migrations/0022_proctoredexamstudentattempt_add_readytoresume_resumed.py +33 -0
- edx_proctoring/migrations/0023_historicalproctoredexam.py +50 -0
- edx_proctoring/migrations/0024_delete_proctoredexamstudentattempthistory.py +16 -0
- edx_proctoring/migrations/0025_auto_20230727_2112.py +21 -0
- edx_proctoring/migrations/__init__.py +0 -0
- edx_proctoring/models.py +844 -0
- edx_proctoring/rules.py +15 -0
- edx_proctoring/runtime.py +21 -0
- edx_proctoring/scripts/obscure_user.py +108 -0
- edx_proctoring/serializers.py +147 -0
- edx_proctoring/services.py +43 -0
- edx_proctoring/settings/__init__.py +0 -0
- edx_proctoring/settings/common.py +50 -0
- edx_proctoring/settings/production.py +13 -0
- edx_proctoring/settings/test.py +11 -0
- edx_proctoring/signals.py +5 -0
- edx_proctoring/static/index.js +41 -0
- edx_proctoring/static/proctoring/clippy.swf +0 -0
- edx_proctoring/static/proctoring/close-modal-hover.png +0 -0
- edx_proctoring/static/proctoring/close-modal.png +0 -0
- edx_proctoring/static/proctoring/js/collections/proctored_exam_allowance_collection.js +15 -0
- edx_proctoring/static/proctoring/js/collections/proctored_exam_attempt_grouped_collection.js +15 -0
- edx_proctoring/static/proctoring/js/collections/proctored_exam_collection.js +16 -0
- edx_proctoring/static/proctoring/js/collections/proctored_exam_onboarding_collection.js +13 -0
- edx_proctoring/static/proctoring/js/dropdown.js +97 -0
- edx_proctoring/static/proctoring/js/exam_action_handler.js +252 -0
- edx_proctoring/static/proctoring/js/models/learner_onboarding_model.js +9 -0
- edx_proctoring/static/proctoring/js/models/proctored_exam_allowance_model.js +15 -0
- edx_proctoring/static/proctoring/js/models/proctored_exam_attempt_model.js +15 -0
- edx_proctoring/static/proctoring/js/models/proctored_exam_bulk_allowance_model.js +15 -0
- edx_proctoring/static/proctoring/js/models/proctored_exam_model.js +56 -0
- edx_proctoring/static/proctoring/js/proctored_app.js +16 -0
- edx_proctoring/static/proctoring/js/vendor/backbone.js +1608 -0
- edx_proctoring/static/proctoring/js/vendor/date.js +145 -0
- edx_proctoring/static/proctoring/js/vendor/i18n.js +10 -0
- edx_proctoring/static/proctoring/js/vendor/jquery.js +4 -0
- edx_proctoring/static/proctoring/js/vendor/underscore.js +1416 -0
- edx_proctoring/static/proctoring/js/views/Backbone.ModalDialog.js +338 -0
- edx_proctoring/static/proctoring/js/views/proctored_exam_add_bulk_allowance_view.js +300 -0
- edx_proctoring/static/proctoring/js/views/proctored_exam_allowance_view.js +204 -0
- edx_proctoring/static/proctoring/js/views/proctored_exam_attempt_view.js +307 -0
- edx_proctoring/static/proctoring/js/views/proctored_exam_edit_allowance_view.js +165 -0
- edx_proctoring/static/proctoring/js/views/proctored_exam_info.js +232 -0
- edx_proctoring/static/proctoring/js/views/proctored_exam_instructor_launch.js +41 -0
- edx_proctoring/static/proctoring/js/views/proctored_exam_onboarding_view.js +288 -0
- edx_proctoring/static/proctoring/js/views/proctored_exam_view.js +267 -0
- edx_proctoring/static/proctoring/templates/add-new-bulk-allowance.underscore +105 -0
- edx_proctoring/static/proctoring/templates/course_grouped_allowances.underscore +70 -0
- edx_proctoring/static/proctoring/templates/dashboard.underscore +3 -0
- edx_proctoring/static/proctoring/templates/edit-allowance.underscore +52 -0
- edx_proctoring/static/proctoring/templates/proctored-exam-info.underscore +46 -0
- edx_proctoring/static/proctoring/templates/student-onboarding-status.underscore +153 -0
- edx_proctoring/static/proctoring/templates/student-proctored-exam-attempts-grouped.underscore +287 -0
- edx_proctoring/statuses.py +330 -0
- edx_proctoring/templates/common/waiting_banner.html +12 -0
- edx_proctoring/templates/emails/proctoring_attempt_satisfactory_email.html +28 -0
- edx_proctoring/templates/emails/proctoring_attempt_submitted_email.html +20 -0
- edx_proctoring/templates/emails/proctoring_attempt_unsatisfactory_email.html +33 -0
- edx_proctoring/templates/onboarding_exam/entrance.html +65 -0
- edx_proctoring/templates/onboarding_exam/error.html +18 -0
- edx_proctoring/templates/onboarding_exam/ready_to_submit.html +10 -0
- edx_proctoring/templates/onboarding_exam/rejected.html +33 -0
- edx_proctoring/templates/onboarding_exam/submitted.html +60 -0
- edx_proctoring/templates/onboarding_exam/verified.html +23 -0
- edx_proctoring/templates/practice_exam/entrance.html +90 -0
- edx_proctoring/templates/practice_exam/error.html +42 -0
- edx_proctoring/templates/practice_exam/submitted.html +31 -0
- edx_proctoring/templates/proctored_exam/confirm-decline.html +55 -0
- edx_proctoring/templates/proctored_exam/entrance.html +29 -0
- edx_proctoring/templates/proctored_exam/error.html +26 -0
- edx_proctoring/templates/proctored_exam/error_modal.html +26 -0
- edx_proctoring/templates/proctored_exam/error_wrong_browser.html +32 -0
- edx_proctoring/templates/proctored_exam/expired.html +13 -0
- edx_proctoring/templates/proctored_exam/failed-prerequisites.html +46 -0
- edx_proctoring/templates/proctored_exam/footer.html +80 -0
- edx_proctoring/templates/proctored_exam/inactive_account.html +38 -0
- edx_proctoring/templates/proctored_exam/instructions.html +227 -0
- edx_proctoring/templates/proctored_exam/onboarding_error.html +45 -0
- edx_proctoring/templates/proctored_exam/pending-prerequisites.html +40 -0
- edx_proctoring/templates/proctored_exam/proctoring_launch_callback.html +183 -0
- edx_proctoring/templates/proctored_exam/proctoring_opt_out_button.html +8 -0
- edx_proctoring/templates/proctored_exam/ready_to_resume.html +33 -0
- edx_proctoring/templates/proctored_exam/ready_to_start.html +70 -0
- edx_proctoring/templates/proctored_exam/ready_to_submit.html +39 -0
- edx_proctoring/templates/proctored_exam/rejected.html +30 -0
- edx_proctoring/templates/proctored_exam/submitted.html +24 -0
- edx_proctoring/templates/proctored_exam/verified.html +19 -0
- edx_proctoring/templates/proctored_exam/visit_exam_content.html +38 -0
- edx_proctoring/templates/timed_exam/entrance.html +79 -0
- edx_proctoring/templates/timed_exam/expired.html +13 -0
- edx_proctoring/templates/timed_exam/footer.html +10 -0
- edx_proctoring/templates/timed_exam/ready_to_submit.html +56 -0
- edx_proctoring/templates/timed_exam/submitted.html +32 -0
- edx_proctoring/tests/__init__.py +56 -0
- edx_proctoring/tests/test_api.py +3878 -0
- edx_proctoring/tests/test_email.py +325 -0
- edx_proctoring/tests/test_handlers.py +56 -0
- edx_proctoring/tests/test_mfe_views.py +579 -0
- edx_proctoring/tests/test_models.py +483 -0
- edx_proctoring/tests/test_reviews.py +844 -0
- edx_proctoring/tests/test_serializer.py +34 -0
- edx_proctoring/tests/test_services.py +429 -0
- edx_proctoring/tests/test_student_view.py +1676 -0
- edx_proctoring/tests/test_utils/factories.py +35 -0
- edx_proctoring/tests/test_utils/test_utils.py +207 -0
- edx_proctoring/tests/test_utils/utils.py +402 -0
- edx_proctoring/tests/test_views.py +6501 -0
- edx_proctoring/tests/test_workerconfig.py +96 -0
- edx_proctoring/urls.py +149 -0
- edx_proctoring/utils.py +488 -0
- edx_proctoring/views.py +2333 -0
- edx_proctoring-6.2.0.dist-info/METADATA +152 -0
- edx_proctoring-6.2.0.dist-info/RECORD +293 -0
- edx_proctoring-6.2.0.dist-info/WHEEL +5 -0
- edx_proctoring-6.2.0.dist-info/entry_points.txt +11 -0
- edx_proctoring-6.2.0.dist-info/licenses/LICENSE.txt +674 -0
- edx_proctoring-6.2.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"Tests for generating webpack config json"
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
import os
|
|
5
|
+
import os.path
|
|
6
|
+
import tempfile
|
|
7
|
+
import unittest
|
|
8
|
+
from unittest.mock import patch
|
|
9
|
+
|
|
10
|
+
from django.conf import settings
|
|
11
|
+
|
|
12
|
+
from edx_proctoring.apps import make_worker_config
|
|
13
|
+
from edx_proctoring.backends.tests.test_backend import TestBackendProvider
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class TestWorkerConfig(unittest.TestCase):
|
|
17
|
+
"Tests for generating webpack config json"
|
|
18
|
+
|
|
19
|
+
def setUp(self):
|
|
20
|
+
super().setUp()
|
|
21
|
+
self.outfile = tempfile.mktemp(prefix=f'test-{os.getpid()}')
|
|
22
|
+
self.to_del = [self.outfile]
|
|
23
|
+
|
|
24
|
+
def tearDown(self):
|
|
25
|
+
for path in self.to_del:
|
|
26
|
+
if os.path.exists(path):
|
|
27
|
+
os.unlink(path)
|
|
28
|
+
|
|
29
|
+
def _make_npm_module(self, package, main=None):
|
|
30
|
+
"creates a fake 'npm module'"
|
|
31
|
+
package_json = {
|
|
32
|
+
'name': package
|
|
33
|
+
}
|
|
34
|
+
if main:
|
|
35
|
+
package_json['main'] = main
|
|
36
|
+
self.to_del.append(main)
|
|
37
|
+
package_file = os.path.join(settings.NODE_MODULES_ROOT, package, 'package.json')
|
|
38
|
+
try:
|
|
39
|
+
os.makedirs(os.path.dirname(package_file))
|
|
40
|
+
except OSError:
|
|
41
|
+
pass
|
|
42
|
+
with open(package_file, 'wb') as package_fp:
|
|
43
|
+
package_fp.write(json.dumps(package_json).encode('utf-8'))
|
|
44
|
+
self.to_del.append(package_file)
|
|
45
|
+
return package
|
|
46
|
+
|
|
47
|
+
def _check_outfile(self, expected):
|
|
48
|
+
"checks that the outfile contains expected json"
|
|
49
|
+
if expected is None:
|
|
50
|
+
self.assertFalse(os.path.exists(self.outfile))
|
|
51
|
+
else:
|
|
52
|
+
with open(self.outfile, 'rb') as out_fp:
|
|
53
|
+
data = json.loads(out_fp.read().decode('utf-8'))
|
|
54
|
+
self.assertEqual(data, expected)
|
|
55
|
+
|
|
56
|
+
def test_create_success(self):
|
|
57
|
+
backend = TestBackendProvider()
|
|
58
|
+
backend.npm_module = self._make_npm_module('success', 'foo/bar/baz.js')
|
|
59
|
+
self.assertTrue(make_worker_config([backend], self.outfile))
|
|
60
|
+
self._check_outfile(
|
|
61
|
+
{'success': [
|
|
62
|
+
'babel-polyfill',
|
|
63
|
+
'/tmp/test-proctoring-modules/success/foo/bar/baz.js'
|
|
64
|
+
]}
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
def test_not_defined(self):
|
|
68
|
+
backend = TestBackendProvider()
|
|
69
|
+
self.assertFalse(make_worker_config([backend], self.outfile))
|
|
70
|
+
self._check_outfile(None)
|
|
71
|
+
|
|
72
|
+
def test_no_main(self):
|
|
73
|
+
backend = TestBackendProvider()
|
|
74
|
+
backend.npm_module = self._make_npm_module('no-main')
|
|
75
|
+
self.assertFalse(make_worker_config([backend], self.outfile))
|
|
76
|
+
self._check_outfile(None)
|
|
77
|
+
|
|
78
|
+
def test_no_module(self):
|
|
79
|
+
backend = TestBackendProvider()
|
|
80
|
+
backend.npm_module = 'test-1234'
|
|
81
|
+
self.assertFalse(make_worker_config([backend], self.outfile))
|
|
82
|
+
self._check_outfile(None)
|
|
83
|
+
|
|
84
|
+
def test_no_permission(self):
|
|
85
|
+
self.outfile = '/etc/workers-test.json'
|
|
86
|
+
backend = TestBackendProvider()
|
|
87
|
+
backend.npm_module = self._make_npm_module('no-perm', 'foo/bar/baz.js')
|
|
88
|
+
self.assertFalse(make_worker_config([backend], self.outfile))
|
|
89
|
+
self._check_outfile(None)
|
|
90
|
+
|
|
91
|
+
@patch('django.conf.settings.NODE_MODULES_ROOT', None)
|
|
92
|
+
def test_no_setting(self):
|
|
93
|
+
backend = TestBackendProvider()
|
|
94
|
+
backend.npm_module = 'no-setting'
|
|
95
|
+
self.assertFalse(make_worker_config([backend], self.outfile))
|
|
96
|
+
self._check_outfile(None)
|
edx_proctoring/urls.py
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"""
|
|
2
|
+
URL mappings for edX Proctoring Server.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from django.conf import settings
|
|
6
|
+
from django.urls import include, path, re_path
|
|
7
|
+
|
|
8
|
+
from edx_proctoring import callbacks, instructor_dashboard_exam_urls, views
|
|
9
|
+
|
|
10
|
+
app_name = 'edx_proctoring'
|
|
11
|
+
|
|
12
|
+
CONTENT_ID_PATTERN = r'(?P<content_id>([A-z0-9]+|(?:i4x://?[^/]+/[^/]+/[^/]+/[^@]+(?:@[^/]+)?)|(?:[^/]+)))'
|
|
13
|
+
|
|
14
|
+
urlpatterns = [
|
|
15
|
+
path('edx_proctoring/v1/proctored_exam/exam', views.ProctoredExamView.as_view(),
|
|
16
|
+
name='proctored_exam.exam'
|
|
17
|
+
),
|
|
18
|
+
path('edx_proctoring/v1/proctored_exam/exam/exam_id/<int:exam_id>', views.ProctoredExamView.as_view(),
|
|
19
|
+
name='proctored_exam.exam_by_id'
|
|
20
|
+
),
|
|
21
|
+
re_path(
|
|
22
|
+
(fr'edx_proctoring/v1/proctored_exam/exam/course_id/{settings.COURSE_ID_PATTERN}'
|
|
23
|
+
'/content_id/(?P<content_id>[A-z0-9]+)$'),
|
|
24
|
+
views.ProctoredExamView.as_view(),
|
|
25
|
+
name='proctored_exam.exam_by_content_id'
|
|
26
|
+
),
|
|
27
|
+
re_path(
|
|
28
|
+
fr'edx_proctoring/v1/proctored_exam/exam/course_id/{settings.COURSE_ID_PATTERN}$',
|
|
29
|
+
views.ProctoredExamView.as_view(),
|
|
30
|
+
name='proctored_exam.exams_by_course_id'
|
|
31
|
+
),
|
|
32
|
+
re_path(
|
|
33
|
+
fr'edx_proctoring/v1/proctored_exam/exam_registration/course_id/{settings.COURSE_ID_PATTERN}$',
|
|
34
|
+
views.RegisterProctoredExamsView.as_view(),
|
|
35
|
+
name='proctored_exam.register_exams_by_course_id'
|
|
36
|
+
),
|
|
37
|
+
path('edx_proctoring/v1/proctored_exam/attempt/<int:attempt_id>', views.StudentProctoredExamAttempt.as_view(),
|
|
38
|
+
name='proctored_exam.attempt'
|
|
39
|
+
),
|
|
40
|
+
re_path(
|
|
41
|
+
fr'edx_proctoring/v1/proctored_exam/attempt/grouped/course_id/{settings.COURSE_ID_PATTERN}$',
|
|
42
|
+
views.StudentProctoredGroupedExamAttemptsByCourse.as_view(),
|
|
43
|
+
name='proctored_exam.attempts.grouped.course'
|
|
44
|
+
),
|
|
45
|
+
re_path(
|
|
46
|
+
'edx_proctoring/v1/proctored_exam/attempt/grouped/course_id/'
|
|
47
|
+
fr'{settings.COURSE_ID_PATTERN}/search/(?P<search_by>.+)$',
|
|
48
|
+
views.StudentProctoredGroupedExamAttemptsByCourse.as_view(),
|
|
49
|
+
name='proctored_exam.attempts.grouped.search'
|
|
50
|
+
),
|
|
51
|
+
path('edx_proctoring/v1/proctored_exam/attempt',
|
|
52
|
+
views.StudentProctoredExamAttemptCollection.as_view(),
|
|
53
|
+
name='proctored_exam.attempt.collection'
|
|
54
|
+
),
|
|
55
|
+
path('edx_proctoring/v1/proctored_exam/attempt/<int:attempt_id>/review_status',
|
|
56
|
+
views.ProctoredExamAttemptReviewStatus.as_view(),
|
|
57
|
+
name='proctored_exam.attempt.review_status'
|
|
58
|
+
),
|
|
59
|
+
path('edx_proctoring/v1/proctored_exam/attempt/<slug:external_id>/ready',
|
|
60
|
+
views.ExamReadyCallback.as_view(),
|
|
61
|
+
name='proctored_exam.attempt.ready_callback'
|
|
62
|
+
),
|
|
63
|
+
path('edx_proctoring/v1/proctored_exam/attempt/<slug:external_id>/reviewed',
|
|
64
|
+
views.ProctoredExamReviewCallback.as_view(),
|
|
65
|
+
name='proctored_exam.attempt.callback'
|
|
66
|
+
),
|
|
67
|
+
re_path(
|
|
68
|
+
fr'edx_proctoring/v1/proctored_exam/{settings.COURSE_ID_PATTERN}/allowance$',
|
|
69
|
+
views.ExamAllowanceView.as_view(),
|
|
70
|
+
name='proctored_exam.allowance'
|
|
71
|
+
),
|
|
72
|
+
path('edx_proctoring/v1/proctored_exam/allowance', views.ExamAllowanceView.as_view(),
|
|
73
|
+
name='proctored_exam.allowance'
|
|
74
|
+
),
|
|
75
|
+
re_path(
|
|
76
|
+
fr'edx_proctoring/v1/proctored_exam/{settings.COURSE_ID_PATTERN}/bulk_allowance$',
|
|
77
|
+
views.ExamBulkAllowanceView.as_view(),
|
|
78
|
+
name='proctored_exam.bulk_allowance'
|
|
79
|
+
),
|
|
80
|
+
path('edx_proctoring/v1/proctored_exam/bulk_allowance', views.ExamBulkAllowanceView.as_view(),
|
|
81
|
+
name='proctored_exam.bulk_allowance'
|
|
82
|
+
),
|
|
83
|
+
re_path(
|
|
84
|
+
fr'edx_proctoring/v1/proctored_exam/{settings.COURSE_ID_PATTERN}/grouped/allowance$',
|
|
85
|
+
views.GroupedExamAllowancesByStudent.as_view(),
|
|
86
|
+
name='proctored_exam.allowance.grouped.course'
|
|
87
|
+
),
|
|
88
|
+
path('edx_proctoring/v1/proctored_exam/active_exams_for_user', views.ActiveExamsForUserView.as_view(),
|
|
89
|
+
name='proctored_exam.active_exams_for_user'
|
|
90
|
+
),
|
|
91
|
+
path('edx_proctoring/v1/user_onboarding/status', views.StudentOnboardingStatusView.as_view(),
|
|
92
|
+
name='user_onboarding.status'
|
|
93
|
+
),
|
|
94
|
+
re_path(
|
|
95
|
+
fr'edx_proctoring/v1/user_onboarding/status/course_id/{settings.COURSE_ID_PATTERN}$',
|
|
96
|
+
views.StudentOnboardingStatusByCourseView.as_view(),
|
|
97
|
+
name='user_onboarding.status.course'
|
|
98
|
+
),
|
|
99
|
+
re_path(
|
|
100
|
+
fr'edx_proctoring/v1/instructor/{settings.COURSE_ID_PATTERN}$',
|
|
101
|
+
views.InstructorDashboard.as_view(),
|
|
102
|
+
name='instructor_dashboard_course'
|
|
103
|
+
),
|
|
104
|
+
re_path(
|
|
105
|
+
r'edx_proctoring/v1/retire_backend_user/(?P<user_id>[\d]+)/$',
|
|
106
|
+
views.BackendUserManagementAPI.as_view(),
|
|
107
|
+
name='backend_user_deletion_api'
|
|
108
|
+
),
|
|
109
|
+
re_path(
|
|
110
|
+
r'edx_proctoring/v1/retire_user/(?P<user_id>[\d]+)/$',
|
|
111
|
+
views.UserRetirement.as_view(),
|
|
112
|
+
name='user_retirement_api'
|
|
113
|
+
),
|
|
114
|
+
re_path(
|
|
115
|
+
fr'edx_proctoring/v1/proctored_exam/attempt/course_id/{settings.COURSE_ID_PATTERN}$',
|
|
116
|
+
views.ProctoredExamAttemptView.as_view(),
|
|
117
|
+
name='proctored_exam.exam_attempts'
|
|
118
|
+
),
|
|
119
|
+
re_path(
|
|
120
|
+
'edx_proctoring/v1/proctored_exam/active_attempt',
|
|
121
|
+
views.ProctoredExamActiveAttemptView.as_view(),
|
|
122
|
+
name='proctored_exam.active_attempt'
|
|
123
|
+
),
|
|
124
|
+
path('edx_proctoring/v1/proctored_exam/settings/exam_id/<int:exam_id>/', views.ProctoredSettingsView.as_view(),
|
|
125
|
+
name='proctored_exam.proctoring_settings'
|
|
126
|
+
),
|
|
127
|
+
path('edx_proctoring/v1/proctored_exam/review_policy/exam_id/<int:exam_id>/',
|
|
128
|
+
views.ProctoredExamReviewPolicyView.as_view(),
|
|
129
|
+
name='proctored_exam.review_policy'
|
|
130
|
+
),
|
|
131
|
+
|
|
132
|
+
# Unauthenticated callbacks from SoftwareSecure. Note we use other
|
|
133
|
+
# security token measures to protect data
|
|
134
|
+
#
|
|
135
|
+
path('edx_proctoring/proctoring_launch_callback/start_exam/<slug:attempt_code>', callbacks.start_exam_callback,
|
|
136
|
+
name='anonymous.proctoring_launch_callback.start_exam'
|
|
137
|
+
),
|
|
138
|
+
path('edx_proctoring/proctoring_review_callback/', views.AnonymousReviewCallback.as_view(),
|
|
139
|
+
name='anonymous.proctoring_review_callback'
|
|
140
|
+
),
|
|
141
|
+
re_path(
|
|
142
|
+
r'edx_proctoring/v1/proctored_exam/exam_id/(?P<exam_id>\d+)/user_id/(?P<user_id>[\d]+)/reset_attempts$',
|
|
143
|
+
views.StudentProctoredExamResetAttempts.as_view(),
|
|
144
|
+
name='proctored_exam.attempts.reset'
|
|
145
|
+
),
|
|
146
|
+
path('', include('rest_framework.urls', namespace='rest_framework')),
|
|
147
|
+
]
|
|
148
|
+
|
|
149
|
+
urlpatterns += instructor_dashboard_exam_urls.urlpatterns
|