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.
Files changed (293) hide show
  1. edx_proctoring/__init__.py +6 -0
  2. edx_proctoring/admin.py +502 -0
  3. edx_proctoring/api.py +3269 -0
  4. edx_proctoring/apps.py +162 -0
  5. edx_proctoring/backends/LICENSE.txt +202 -0
  6. edx_proctoring/backends/README.txt +1 -0
  7. edx_proctoring/backends/__init__.py +20 -0
  8. edx_proctoring/backends/backend.py +162 -0
  9. edx_proctoring/backends/mock.py +105 -0
  10. edx_proctoring/backends/null.py +61 -0
  11. edx_proctoring/backends/rest.py +422 -0
  12. edx_proctoring/backends/software_secure.py +423 -0
  13. edx_proctoring/backends/tests/__init__.py +3 -0
  14. edx_proctoring/backends/tests/test_backend.py +363 -0
  15. edx_proctoring/backends/tests/test_rest.py +624 -0
  16. edx_proctoring/backends/tests/test_review_payload.py +102 -0
  17. edx_proctoring/backends/tests/test_software_secure.py +628 -0
  18. edx_proctoring/callbacks.py +66 -0
  19. edx_proctoring/constants.py +83 -0
  20. edx_proctoring/decorators.py +3 -0
  21. edx_proctoring/exceptions.py +188 -0
  22. edx_proctoring/handlers.py +229 -0
  23. edx_proctoring/instructor_dashboard_exam_urls.py +19 -0
  24. edx_proctoring/locale/ar/LC_MESSAGES/django.mo +0 -0
  25. edx_proctoring/locale/ar/LC_MESSAGES/django.po +1445 -0
  26. edx_proctoring/locale/ar/LC_MESSAGES/djangojs.mo +0 -0
  27. edx_proctoring/locale/ar/LC_MESSAGES/djangojs.po +1443 -0
  28. edx_proctoring/locale/ca/LC_MESSAGES/django.mo +0 -0
  29. edx_proctoring/locale/ca/LC_MESSAGES/django.po +1464 -0
  30. edx_proctoring/locale/ca/LC_MESSAGES/djangojs.mo +0 -0
  31. edx_proctoring/locale/ca/LC_MESSAGES/djangojs.po +1463 -0
  32. edx_proctoring/locale/config.yaml +73 -0
  33. edx_proctoring/locale/cs/LC_MESSAGES/django.mo +0 -0
  34. edx_proctoring/locale/cs/LC_MESSAGES/django.po +1632 -0
  35. edx_proctoring/locale/cs/LC_MESSAGES/djangojs.mo +0 -0
  36. edx_proctoring/locale/cs/LC_MESSAGES/djangojs.po +1634 -0
  37. edx_proctoring/locale/de_DE/LC_MESSAGES/django.mo +0 -0
  38. edx_proctoring/locale/de_DE/LC_MESSAGES/django.po +1461 -0
  39. edx_proctoring/locale/de_DE/LC_MESSAGES/djangojs.mo +0 -0
  40. edx_proctoring/locale/de_DE/LC_MESSAGES/djangojs.po +1461 -0
  41. edx_proctoring/locale/el/LC_MESSAGES/django.mo +0 -0
  42. edx_proctoring/locale/el/LC_MESSAGES/django.po +1389 -0
  43. edx_proctoring/locale/el/LC_MESSAGES/djangojs.mo +0 -0
  44. edx_proctoring/locale/el/LC_MESSAGES/djangojs.po +1387 -0
  45. edx_proctoring/locale/en/LC_MESSAGES/django.mo +0 -0
  46. edx_proctoring/locale/en/LC_MESSAGES/django.po +1476 -0
  47. edx_proctoring/locale/en/LC_MESSAGES/djangojs.mo +0 -0
  48. edx_proctoring/locale/en/LC_MESSAGES/djangojs.po +264 -0
  49. edx_proctoring/locale/eo/LC_MESSAGES/django.mo +0 -0
  50. edx_proctoring/locale/eo/LC_MESSAGES/django.po +1880 -0
  51. edx_proctoring/locale/eo/LC_MESSAGES/djangojs.mo +0 -0
  52. edx_proctoring/locale/eo/LC_MESSAGES/djangojs.po +304 -0
  53. edx_proctoring/locale/es_419/LC_MESSAGES/django.mo +0 -0
  54. edx_proctoring/locale/es_419/LC_MESSAGES/django.po +1783 -0
  55. edx_proctoring/locale/es_419/LC_MESSAGES/djangojs.mo +0 -0
  56. edx_proctoring/locale/es_419/LC_MESSAGES/djangojs.po +1785 -0
  57. edx_proctoring/locale/es_AR/LC_MESSAGES/django.mo +0 -0
  58. edx_proctoring/locale/es_AR/LC_MESSAGES/django.po +1654 -0
  59. edx_proctoring/locale/es_AR/LC_MESSAGES/djangojs.mo +0 -0
  60. edx_proctoring/locale/es_AR/LC_MESSAGES/djangojs.po +1655 -0
  61. edx_proctoring/locale/es_ES/LC_MESSAGES/django.mo +0 -0
  62. edx_proctoring/locale/es_ES/LC_MESSAGES/django.po +1655 -0
  63. edx_proctoring/locale/es_ES/LC_MESSAGES/djangojs.mo +0 -0
  64. edx_proctoring/locale/es_ES/LC_MESSAGES/djangojs.po +1652 -0
  65. edx_proctoring/locale/eu_ES/LC_MESSAGES/django.mo +0 -0
  66. edx_proctoring/locale/eu_ES/LC_MESSAGES/django.po +1378 -0
  67. edx_proctoring/locale/eu_ES/LC_MESSAGES/djangojs.mo +0 -0
  68. edx_proctoring/locale/eu_ES/LC_MESSAGES/djangojs.po +1378 -0
  69. edx_proctoring/locale/fa_IR/LC_MESSAGES/django.mo +0 -0
  70. edx_proctoring/locale/fa_IR/LC_MESSAGES/django.po +1666 -0
  71. edx_proctoring/locale/fa_IR/LC_MESSAGES/djangojs.mo +0 -0
  72. edx_proctoring/locale/fa_IR/LC_MESSAGES/djangojs.po +1665 -0
  73. edx_proctoring/locale/fr/LC_MESSAGES/django.mo +0 -0
  74. edx_proctoring/locale/fr/LC_MESSAGES/django.po +1805 -0
  75. edx_proctoring/locale/fr/LC_MESSAGES/djangojs.mo +0 -0
  76. edx_proctoring/locale/fr/LC_MESSAGES/djangojs.po +1802 -0
  77. edx_proctoring/locale/fr_CA/LC_MESSAGES/django.mo +0 -0
  78. edx_proctoring/locale/fr_CA/LC_MESSAGES/django.po +1790 -0
  79. edx_proctoring/locale/fr_CA/LC_MESSAGES/djangojs.mo +0 -0
  80. edx_proctoring/locale/fr_CA/LC_MESSAGES/djangojs.po +1793 -0
  81. edx_proctoring/locale/he/LC_MESSAGES/django.mo +0 -0
  82. edx_proctoring/locale/he/LC_MESSAGES/django.po +1444 -0
  83. edx_proctoring/locale/he/LC_MESSAGES/djangojs.mo +0 -0
  84. edx_proctoring/locale/he/LC_MESSAGES/djangojs.po +1443 -0
  85. edx_proctoring/locale/id/LC_MESSAGES/django.mo +0 -0
  86. edx_proctoring/locale/id/LC_MESSAGES/django.po +1390 -0
  87. edx_proctoring/locale/id/LC_MESSAGES/djangojs.mo +0 -0
  88. edx_proctoring/locale/id/LC_MESSAGES/djangojs.po +1389 -0
  89. edx_proctoring/locale/it_IT/LC_MESSAGES/django.mo +0 -0
  90. edx_proctoring/locale/it_IT/LC_MESSAGES/django.po +1715 -0
  91. edx_proctoring/locale/it_IT/LC_MESSAGES/djangojs.mo +0 -0
  92. edx_proctoring/locale/it_IT/LC_MESSAGES/djangojs.po +1715 -0
  93. edx_proctoring/locale/ja_JP/LC_MESSAGES/djangojs.mo +0 -0
  94. edx_proctoring/locale/ja_JP/LC_MESSAGES/djangojs.po +1387 -0
  95. edx_proctoring/locale/ka/LC_MESSAGES/django.mo +0 -0
  96. edx_proctoring/locale/ka/LC_MESSAGES/django.po +1380 -0
  97. edx_proctoring/locale/ka/LC_MESSAGES/djangojs.mo +0 -0
  98. edx_proctoring/locale/ka/LC_MESSAGES/djangojs.po +1380 -0
  99. edx_proctoring/locale/lv/LC_MESSAGES/django.mo +0 -0
  100. edx_proctoring/locale/lv/LC_MESSAGES/django.po +1377 -0
  101. edx_proctoring/locale/lv/LC_MESSAGES/djangojs.mo +0 -0
  102. edx_proctoring/locale/lv/LC_MESSAGES/djangojs.po +1377 -0
  103. edx_proctoring/locale/mn/LC_MESSAGES/django.mo +0 -0
  104. edx_proctoring/locale/mn/LC_MESSAGES/django.po +1434 -0
  105. edx_proctoring/locale/mn/LC_MESSAGES/djangojs.mo +0 -0
  106. edx_proctoring/locale/mn/LC_MESSAGES/djangojs.po +1379 -0
  107. edx_proctoring/locale/nb/LC_MESSAGES/django.mo +0 -0
  108. edx_proctoring/locale/nb/LC_MESSAGES/django.po +1393 -0
  109. edx_proctoring/locale/nb/LC_MESSAGES/djangojs.mo +0 -0
  110. edx_proctoring/locale/nb/LC_MESSAGES/djangojs.po +1393 -0
  111. edx_proctoring/locale/pl/LC_MESSAGES/django.mo +0 -0
  112. edx_proctoring/locale/pl/LC_MESSAGES/django.po +1386 -0
  113. edx_proctoring/locale/pl/LC_MESSAGES/djangojs.mo +0 -0
  114. edx_proctoring/locale/pl/LC_MESSAGES/djangojs.po +1386 -0
  115. edx_proctoring/locale/pt_PT/LC_MESSAGES/django.mo +0 -0
  116. edx_proctoring/locale/pt_PT/LC_MESSAGES/django.po +1793 -0
  117. edx_proctoring/locale/pt_PT/LC_MESSAGES/djangojs.mo +0 -0
  118. edx_proctoring/locale/pt_PT/LC_MESSAGES/djangojs.po +1810 -0
  119. edx_proctoring/locale/ro/LC_MESSAGES/django.mo +0 -0
  120. edx_proctoring/locale/ro/LC_MESSAGES/django.po +1382 -0
  121. edx_proctoring/locale/ro/LC_MESSAGES/djangojs.mo +0 -0
  122. edx_proctoring/locale/ro/LC_MESSAGES/djangojs.po +1382 -0
  123. edx_proctoring/locale/ru/LC_MESSAGES/django.mo +0 -0
  124. edx_proctoring/locale/ru/LC_MESSAGES/django.po +1456 -0
  125. edx_proctoring/locale/ru/LC_MESSAGES/djangojs.mo +0 -0
  126. edx_proctoring/locale/ru/LC_MESSAGES/djangojs.po +1459 -0
  127. edx_proctoring/locale/sw_KE/LC_MESSAGES/django.mo +0 -0
  128. edx_proctoring/locale/sw_KE/LC_MESSAGES/django.po +1462 -0
  129. edx_proctoring/locale/sw_KE/LC_MESSAGES/djangojs.mo +0 -0
  130. edx_proctoring/locale/sw_KE/LC_MESSAGES/djangojs.po +1464 -0
  131. edx_proctoring/locale/tr_TR/LC_MESSAGES/django.mo +0 -0
  132. edx_proctoring/locale/tr_TR/LC_MESSAGES/django.po +1527 -0
  133. edx_proctoring/locale/tr_TR/LC_MESSAGES/djangojs.mo +0 -0
  134. edx_proctoring/locale/tr_TR/LC_MESSAGES/djangojs.po +1527 -0
  135. edx_proctoring/locale/uk/LC_MESSAGES/django.mo +0 -0
  136. edx_proctoring/locale/uk/LC_MESSAGES/django.po +1443 -0
  137. edx_proctoring/locale/uk/LC_MESSAGES/djangojs.mo +0 -0
  138. edx_proctoring/locale/uk/LC_MESSAGES/djangojs.po +1443 -0
  139. edx_proctoring/locale/zh_CN/LC_MESSAGES/django.mo +0 -0
  140. edx_proctoring/locale/zh_CN/LC_MESSAGES/django.po +1468 -0
  141. edx_proctoring/locale/zh_CN/LC_MESSAGES/djangojs.mo +0 -0
  142. edx_proctoring/locale/zh_CN/LC_MESSAGES/djangojs.po +1469 -0
  143. edx_proctoring/management/__init__.py +3 -0
  144. edx_proctoring/management/commands/__init__.py +3 -0
  145. edx_proctoring/management/commands/reset_attempts.py +87 -0
  146. edx_proctoring/management/commands/set_attempt_status.py +52 -0
  147. edx_proctoring/management/commands/set_is_attempt_active.py +104 -0
  148. edx_proctoring/management/commands/tests/__init__.py +3 -0
  149. edx_proctoring/management/commands/tests/test_reset_attempts.py +153 -0
  150. edx_proctoring/management/commands/tests/test_set_attempt_status.py +85 -0
  151. edx_proctoring/management/commands/tests/test_set_is_attempt_active.py +85 -0
  152. edx_proctoring/management/commands/tests/test_update_attempt_status_from_review.py +113 -0
  153. edx_proctoring/management/commands/tests/test_update_attempts_for_exam.py +62 -0
  154. edx_proctoring/management/commands/update_attempt_status_from_review.py +81 -0
  155. edx_proctoring/management/commands/update_attempts_for_exam.py +78 -0
  156. edx_proctoring/migrations/0001_initial.py +227 -0
  157. edx_proctoring/migrations/0002_proctoredexamstudentattempt_is_status_acknowledged.py +18 -0
  158. edx_proctoring/migrations/0003_auto_20160101_0525.py +24 -0
  159. edx_proctoring/migrations/0004_auto_20160201_0523.py +19 -0
  160. edx_proctoring/migrations/0005_proctoredexam_hide_after_due.py +19 -0
  161. edx_proctoring/migrations/0006_allowed_time_limit_mins.py +24 -0
  162. edx_proctoring/migrations/0007_proctoredexam_backend.py +20 -0
  163. edx_proctoring/migrations/0008_auto_20181116_1551.py +32 -0
  164. edx_proctoring/migrations/0009_proctoredexamreviewpolicy_remove_rules.py +23 -0
  165. edx_proctoring/migrations/0010_update_backend.py +32 -0
  166. edx_proctoring/migrations/0011_allow_multiple_attempts.py +17 -0
  167. edx_proctoring/migrations/0012_proctoredexamstudentattempt_time_remaining_seconds.py +18 -0
  168. edx_proctoring/migrations/0013_proctoredexamsoftwaresecurereview_is_active_attempt.py +23 -0
  169. edx_proctoring/migrations/0014_add_is_resumable_to_proctoredexamstudentattempt.py +23 -0
  170. edx_proctoring/migrations/0015_rm_proctoredexamstudentattempt_ips.py +29 -0
  171. edx_proctoring/migrations/0016_nullable_proctoredexamstudentattempt_name.py +23 -0
  172. edx_proctoring/migrations/0017_rm_proctoredexamstudentattempt_name.py +21 -0
  173. edx_proctoring/migrations/0018_historicalproctoredexamstudentattempt.py +53 -0
  174. edx_proctoring/migrations/0019_proctoredexamsoftwaresecurereview_encrypted_video_url.py +18 -0
  175. edx_proctoring/migrations/0020_auto_20211028_1915.py +23 -0
  176. edx_proctoring/migrations/0021_auto_20211029_1353.py +26 -0
  177. edx_proctoring/migrations/0022_proctoredexamstudentattempt_add_readytoresume_resumed.py +33 -0
  178. edx_proctoring/migrations/0023_historicalproctoredexam.py +50 -0
  179. edx_proctoring/migrations/0024_delete_proctoredexamstudentattempthistory.py +16 -0
  180. edx_proctoring/migrations/0025_auto_20230727_2112.py +21 -0
  181. edx_proctoring/migrations/__init__.py +0 -0
  182. edx_proctoring/models.py +844 -0
  183. edx_proctoring/rules.py +15 -0
  184. edx_proctoring/runtime.py +21 -0
  185. edx_proctoring/scripts/obscure_user.py +108 -0
  186. edx_proctoring/serializers.py +147 -0
  187. edx_proctoring/services.py +43 -0
  188. edx_proctoring/settings/__init__.py +0 -0
  189. edx_proctoring/settings/common.py +50 -0
  190. edx_proctoring/settings/production.py +13 -0
  191. edx_proctoring/settings/test.py +11 -0
  192. edx_proctoring/signals.py +5 -0
  193. edx_proctoring/static/index.js +41 -0
  194. edx_proctoring/static/proctoring/clippy.swf +0 -0
  195. edx_proctoring/static/proctoring/close-modal-hover.png +0 -0
  196. edx_proctoring/static/proctoring/close-modal.png +0 -0
  197. edx_proctoring/static/proctoring/js/collections/proctored_exam_allowance_collection.js +15 -0
  198. edx_proctoring/static/proctoring/js/collections/proctored_exam_attempt_grouped_collection.js +15 -0
  199. edx_proctoring/static/proctoring/js/collections/proctored_exam_collection.js +16 -0
  200. edx_proctoring/static/proctoring/js/collections/proctored_exam_onboarding_collection.js +13 -0
  201. edx_proctoring/static/proctoring/js/dropdown.js +97 -0
  202. edx_proctoring/static/proctoring/js/exam_action_handler.js +252 -0
  203. edx_proctoring/static/proctoring/js/models/learner_onboarding_model.js +9 -0
  204. edx_proctoring/static/proctoring/js/models/proctored_exam_allowance_model.js +15 -0
  205. edx_proctoring/static/proctoring/js/models/proctored_exam_attempt_model.js +15 -0
  206. edx_proctoring/static/proctoring/js/models/proctored_exam_bulk_allowance_model.js +15 -0
  207. edx_proctoring/static/proctoring/js/models/proctored_exam_model.js +56 -0
  208. edx_proctoring/static/proctoring/js/proctored_app.js +16 -0
  209. edx_proctoring/static/proctoring/js/vendor/backbone.js +1608 -0
  210. edx_proctoring/static/proctoring/js/vendor/date.js +145 -0
  211. edx_proctoring/static/proctoring/js/vendor/i18n.js +10 -0
  212. edx_proctoring/static/proctoring/js/vendor/jquery.js +4 -0
  213. edx_proctoring/static/proctoring/js/vendor/underscore.js +1416 -0
  214. edx_proctoring/static/proctoring/js/views/Backbone.ModalDialog.js +338 -0
  215. edx_proctoring/static/proctoring/js/views/proctored_exam_add_bulk_allowance_view.js +300 -0
  216. edx_proctoring/static/proctoring/js/views/proctored_exam_allowance_view.js +204 -0
  217. edx_proctoring/static/proctoring/js/views/proctored_exam_attempt_view.js +307 -0
  218. edx_proctoring/static/proctoring/js/views/proctored_exam_edit_allowance_view.js +165 -0
  219. edx_proctoring/static/proctoring/js/views/proctored_exam_info.js +232 -0
  220. edx_proctoring/static/proctoring/js/views/proctored_exam_instructor_launch.js +41 -0
  221. edx_proctoring/static/proctoring/js/views/proctored_exam_onboarding_view.js +288 -0
  222. edx_proctoring/static/proctoring/js/views/proctored_exam_view.js +267 -0
  223. edx_proctoring/static/proctoring/templates/add-new-bulk-allowance.underscore +105 -0
  224. edx_proctoring/static/proctoring/templates/course_grouped_allowances.underscore +70 -0
  225. edx_proctoring/static/proctoring/templates/dashboard.underscore +3 -0
  226. edx_proctoring/static/proctoring/templates/edit-allowance.underscore +52 -0
  227. edx_proctoring/static/proctoring/templates/proctored-exam-info.underscore +46 -0
  228. edx_proctoring/static/proctoring/templates/student-onboarding-status.underscore +153 -0
  229. edx_proctoring/static/proctoring/templates/student-proctored-exam-attempts-grouped.underscore +287 -0
  230. edx_proctoring/statuses.py +330 -0
  231. edx_proctoring/templates/common/waiting_banner.html +12 -0
  232. edx_proctoring/templates/emails/proctoring_attempt_satisfactory_email.html +28 -0
  233. edx_proctoring/templates/emails/proctoring_attempt_submitted_email.html +20 -0
  234. edx_proctoring/templates/emails/proctoring_attempt_unsatisfactory_email.html +33 -0
  235. edx_proctoring/templates/onboarding_exam/entrance.html +65 -0
  236. edx_proctoring/templates/onboarding_exam/error.html +18 -0
  237. edx_proctoring/templates/onboarding_exam/ready_to_submit.html +10 -0
  238. edx_proctoring/templates/onboarding_exam/rejected.html +33 -0
  239. edx_proctoring/templates/onboarding_exam/submitted.html +60 -0
  240. edx_proctoring/templates/onboarding_exam/verified.html +23 -0
  241. edx_proctoring/templates/practice_exam/entrance.html +90 -0
  242. edx_proctoring/templates/practice_exam/error.html +42 -0
  243. edx_proctoring/templates/practice_exam/submitted.html +31 -0
  244. edx_proctoring/templates/proctored_exam/confirm-decline.html +55 -0
  245. edx_proctoring/templates/proctored_exam/entrance.html +29 -0
  246. edx_proctoring/templates/proctored_exam/error.html +26 -0
  247. edx_proctoring/templates/proctored_exam/error_modal.html +26 -0
  248. edx_proctoring/templates/proctored_exam/error_wrong_browser.html +32 -0
  249. edx_proctoring/templates/proctored_exam/expired.html +13 -0
  250. edx_proctoring/templates/proctored_exam/failed-prerequisites.html +46 -0
  251. edx_proctoring/templates/proctored_exam/footer.html +80 -0
  252. edx_proctoring/templates/proctored_exam/inactive_account.html +38 -0
  253. edx_proctoring/templates/proctored_exam/instructions.html +227 -0
  254. edx_proctoring/templates/proctored_exam/onboarding_error.html +45 -0
  255. edx_proctoring/templates/proctored_exam/pending-prerequisites.html +40 -0
  256. edx_proctoring/templates/proctored_exam/proctoring_launch_callback.html +183 -0
  257. edx_proctoring/templates/proctored_exam/proctoring_opt_out_button.html +8 -0
  258. edx_proctoring/templates/proctored_exam/ready_to_resume.html +33 -0
  259. edx_proctoring/templates/proctored_exam/ready_to_start.html +70 -0
  260. edx_proctoring/templates/proctored_exam/ready_to_submit.html +39 -0
  261. edx_proctoring/templates/proctored_exam/rejected.html +30 -0
  262. edx_proctoring/templates/proctored_exam/submitted.html +24 -0
  263. edx_proctoring/templates/proctored_exam/verified.html +19 -0
  264. edx_proctoring/templates/proctored_exam/visit_exam_content.html +38 -0
  265. edx_proctoring/templates/timed_exam/entrance.html +79 -0
  266. edx_proctoring/templates/timed_exam/expired.html +13 -0
  267. edx_proctoring/templates/timed_exam/footer.html +10 -0
  268. edx_proctoring/templates/timed_exam/ready_to_submit.html +56 -0
  269. edx_proctoring/templates/timed_exam/submitted.html +32 -0
  270. edx_proctoring/tests/__init__.py +56 -0
  271. edx_proctoring/tests/test_api.py +3878 -0
  272. edx_proctoring/tests/test_email.py +325 -0
  273. edx_proctoring/tests/test_handlers.py +56 -0
  274. edx_proctoring/tests/test_mfe_views.py +579 -0
  275. edx_proctoring/tests/test_models.py +483 -0
  276. edx_proctoring/tests/test_reviews.py +844 -0
  277. edx_proctoring/tests/test_serializer.py +34 -0
  278. edx_proctoring/tests/test_services.py +429 -0
  279. edx_proctoring/tests/test_student_view.py +1676 -0
  280. edx_proctoring/tests/test_utils/factories.py +35 -0
  281. edx_proctoring/tests/test_utils/test_utils.py +207 -0
  282. edx_proctoring/tests/test_utils/utils.py +402 -0
  283. edx_proctoring/tests/test_views.py +6501 -0
  284. edx_proctoring/tests/test_workerconfig.py +96 -0
  285. edx_proctoring/urls.py +149 -0
  286. edx_proctoring/utils.py +488 -0
  287. edx_proctoring/views.py +2333 -0
  288. edx_proctoring-6.2.0.dist-info/METADATA +152 -0
  289. edx_proctoring-6.2.0.dist-info/RECORD +293 -0
  290. edx_proctoring-6.2.0.dist-info/WHEEL +5 -0
  291. edx_proctoring-6.2.0.dist-info/entry_points.txt +11 -0
  292. edx_proctoring-6.2.0.dist-info/licenses/LICENSE.txt +674 -0
  293. edx_proctoring-6.2.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,267 @@
1
+ edx = edx || {};
2
+
3
+ (function(Backbone, $, _, gettext) {
4
+ 'use strict';
5
+
6
+ edx.courseware = edx.courseware || {};
7
+ edx.courseware.proctored_exam = edx.courseware.proctored_exam || {};
8
+
9
+ edx.courseware.proctored_exam.ProctoredExamView = Backbone.View.extend({
10
+ initialize: function(options) {
11
+ var templateHtml, controlsTemplateHtml;
12
+ _.bindAll(this, 'detectScroll');
13
+ this.$el = options.el;
14
+ this.timerBarTopPosition = this.$el.position().top;
15
+ this.initialCourseNavBarMarginTop = this.timerBarTopPosition - 3;
16
+ this.model = options.model;
17
+ this.templateId = options.proctored_template;
18
+ this.template = null;
19
+ this.timerId = null;
20
+ this.timerTick = 0;
21
+ this.secondsLeft = 0;
22
+ /* give an extra 5 seconds where the timer holds at 00:00 before page refreshes */
23
+ this.grace_period_secs = 5;
24
+ this.poll_interval = 60;
25
+ this.first_time_rendering = true;
26
+
27
+ // we need to keep a copy here because the model will
28
+ // get destroyed before onbeforeunload is called
29
+ this.taking_as_proctored = false;
30
+
31
+ templateHtml = $(this.templateId).text();
32
+ if (templateHtml !== null) {
33
+ /* don't assume this backbone view is running on a page with the underscore templates */
34
+ this.template = _.template(templateHtml);
35
+ }
36
+
37
+ controlsTemplateHtml = $(this.examControlsTemplateId).text();
38
+ if (controlsTemplateHtml !== null) {
39
+ /* don't assume this backbone view is running on a page with the underscore templates */
40
+ this.controls_template = _.template(controlsTemplateHtml);
41
+ }
42
+
43
+ /* re-render if the model changes */
44
+ this.listenTo(this.model, 'change', this.modelChanged);
45
+
46
+ $(window).unbind('beforeunload', this.unloadMessage);
47
+
48
+ /* make the async call to the backend REST API */
49
+ /* after it loads, the listenTo event will file and */
50
+ /* will call into the rendering */
51
+ this.model.fetch();
52
+ },
53
+ events: {
54
+ 'click #toggle_timer': 'toggleTimerVisibility',
55
+ 'click .js-toggle-show-more': 'toggleShowText'
56
+ },
57
+ detectScroll: function(event) {
58
+ var examStatusBarHeight;
59
+ var $courseNavBar = $('.wrapper-course-material');
60
+ if (!$courseNavBar.length) {
61
+ $courseNavBar = $('.course-tabs');
62
+ }
63
+ examStatusBarHeight = this.$el.height();
64
+ if ($(event.currentTarget).scrollTop() > this.timerBarTopPosition) {
65
+ $('.proctored_exam_status').addClass('is-fixed');
66
+ $courseNavBar.css('margin-top', examStatusBarHeight + 'px');
67
+ } else {
68
+ $('.proctored_exam_status').removeClass('is-fixed');
69
+ $courseNavBar.css('margin-top', '0');
70
+ }
71
+ },
72
+ modelChanged: function() {
73
+ var desktopApplicationJsUrl;
74
+ // if we are a proctored exam, then we need to alert user that he/she
75
+ // should not be navigating around the courseware
76
+ var takingAsProctored = this.model.get('taking_as_proctored');
77
+ var timeLeft = this.model.get('time_remaining_seconds') > 0;
78
+ var status = this.model.get('attempt_status');
79
+ var inCourseware = document.location.href.indexOf(
80
+ '/courses/' + this.model.get('course_id') + '/courseware/'
81
+ ) > -1;
82
+ this.secondsLeft = this.model.get('time_remaining_seconds');
83
+
84
+ if (takingAsProctored && timeLeft && inCourseware && status !== 'started') {
85
+ $(window).bind('beforeunload', this.unloadMessage);
86
+ } else {
87
+ // remove callback on unload event
88
+ $(window).unbind('beforeunload', this.unloadMessage);
89
+ }
90
+ desktopApplicationJsUrl = this.model.get('desktop_application_js_url');
91
+ if (desktopApplicationJsUrl && !edx.courseware.proctored_exam.configuredWorkerURL) {
92
+ edx.courseware.proctored_exam.configuredWorkerURL = desktopApplicationJsUrl;
93
+ }
94
+
95
+ this.render();
96
+ },
97
+ render: function() {
98
+ var html, self;
99
+ if (this.template !== null) {
100
+ if (
101
+ this.model.get('in_timed_exam') &&
102
+ this.model.get('time_remaining_seconds') > 0 &&
103
+ this.model.get('attempt_status') !== 'error'
104
+ ) {
105
+ // add callback on scroll event
106
+ $(window).bind('scroll', this.detectScroll);
107
+
108
+ html = this.template(this.model.toJSON());
109
+ this.$el.html(html);
110
+ this.$el.show();
111
+ // only render the accesibility string the first time we render after
112
+ // page load (then we will update on time left warnings)
113
+ if (this.first_time_rendering) {
114
+ this.accessibility_time_string = this.model.get('accessibility_time_string');
115
+ this.$el.find('.timer-announce').html(this.accessibility_time_string);
116
+ if (!(window && window.matchMedia && window.matchMedia('(min-width: 992px)').matches)) {
117
+ this.toggleShowText();
118
+ }
119
+ this.first_time_rendering = false;
120
+ }
121
+ this.updateRemainingTime();
122
+ this.timerId = setInterval(this.updateRemainingTime.bind(this), 1000, this);
123
+
124
+ // Bind a click handler to the exam controls
125
+ self = this;
126
+ $('.exam-button-turn-in-exam').click(function() {
127
+ $(window).unbind('beforeunload', self.unloadMessage);
128
+
129
+ $.ajax({
130
+ url: '/api/edx_proctoring/v1/proctored_exam/attempt/' + self.model.get('attempt_id'),
131
+ type: 'PUT',
132
+ data: {
133
+ action: 'stop'
134
+ },
135
+ success: function() {
136
+ // change the location of the page to the active exam page
137
+ // which will reflect the new state of the attempt
138
+ location.href = self.model.get('exam_url_path');
139
+ }
140
+ });
141
+ });
142
+ } else {
143
+ // remove callback on scroll event
144
+ $(window).unbind('scroll', this.detectScroll);
145
+ }
146
+ }
147
+ return this;
148
+ },
149
+ reloadPage: function() {
150
+ location.reload();
151
+ },
152
+ unloadMessage: function() {
153
+ return gettext('Are you sure you want to leave this page? \n' +
154
+ 'To pass your proctored exam you must also pass the online proctoring session review.');
155
+ },
156
+ updateRemainingTime: function() {
157
+ var url, queryString, newState;
158
+ var self = this;
159
+ var pingInterval = self.model.get('ping_interval');
160
+ self.timerTick += 1;
161
+ self.secondsLeft -= 1;
162
+
163
+ // AED 2020-02-21:
164
+ // If the learner is in a state where they've finished the exam
165
+ // and the attempt can be submitted (i.e. they are "ready_to_submit"),
166
+ // don't ping the proctoring app (which action could move
167
+ // the attempt into an error state).
168
+ if (
169
+ self.timerTick % pingInterval === pingInterval / 2 &&
170
+ edx.courseware.proctored_exam.configuredWorkerURL &&
171
+ this.model.get('attempt_status') !== 'ready_to_submit'
172
+ ) {
173
+ edx.courseware.proctored_exam.pingApplication(pingInterval)
174
+ .catch(function(error) {
175
+ self.endExamForFailureState(error);
176
+ });
177
+ }
178
+ if (self.timerTick % self.poll_interval === 0) {
179
+ url = self.model.url + '/' + self.model.get('attempt_id');
180
+ queryString = '?sourceid=in_exam&proctored=' + self.model.get('taking_as_proctored');
181
+ $.ajax(url + queryString)
182
+ .success(function(data) {
183
+ if (data.status === 'error') {
184
+ // The proctoring session is in error state
185
+ // refresh the page to bring up the new Proctoring state from the backend.
186
+ clearInterval(self.timerId); // stop the timer once the time finishes.
187
+ $(window).unbind('beforeunload', self.unloadMessage);
188
+ self.reloadPage();
189
+ } else {
190
+ self.secondsLeft = data.time_remaining_seconds;
191
+ self.accessibility_time_string = data.accessibility_time_string;
192
+ }
193
+ })
194
+ .error(function(error) {
195
+ // if unauthorized refresh the page to kick user out of exam
196
+ if (error.status === 403) {
197
+ clearInterval(self.timerId);
198
+ $(window).unbind('beforeunload', self.unloadMessage);
199
+ self.reloadPage();
200
+ }
201
+ });
202
+ }
203
+ self.$el.find('div.exam-timer').attr('class');
204
+ newState = self.model.getRemainingTimeState(self.secondsLeft);
205
+
206
+ if (newState !== null && !self.$el.find('div.exam-timer').hasClass(newState)) {
207
+ self.$el.find('div.exam-timer').removeClass('warning critical');
208
+ self.$el.find('div.exam-timer').addClass('low-time ' + newState);
209
+ // refresh accessibility string
210
+ self.$el.find('.timer-announce').html(self.accessibility_time_string);
211
+ }
212
+
213
+ self.$el.find('h3#time_remaining_id b').html(self.model.getFormattedRemainingTime(self.secondsLeft));
214
+ if (self.secondsLeft <= -self.grace_period_secs) {
215
+ clearInterval(self.timerId); // stop the timer once the time finishes.
216
+ $(window).unbind('beforeunload', this.unloadMessage);
217
+ // refresh the page when the timer expired
218
+ edx.courseware.proctored_exam.endExam(self.model.get('exam_started_poll_url')).then(self.reloadPage);
219
+ }
220
+ },
221
+ endExamForFailureState: function(error) {
222
+ var self = this;
223
+ return $.ajax({
224
+ data: {
225
+ action: 'error',
226
+ detail: String(error)
227
+ },
228
+ url: this.model.url + '/' + this.model.get('attempt_id'),
229
+ type: 'PUT'
230
+ }).done(function(result) {
231
+ if (result.exam_attempt_id) {
232
+ self.reloadPage();
233
+ }
234
+ });
235
+ },
236
+ toggleTimerVisibility: function(event) {
237
+ var $button = $(event.currentTarget);
238
+ var icon = $button.find('i');
239
+ var timer = this.$el.find('h3#time_remaining_id b');
240
+ if (timer.hasClass('timer-hidden')) {
241
+ timer.removeClass('timer-hidden');
242
+ $button.attr('aria-pressed', 'false');
243
+ icon.removeClass('fa-eye').addClass('fa-eye-slash');
244
+ } else {
245
+ timer.addClass('timer-hidden');
246
+ $button.attr('aria-pressed', 'true');
247
+ icon.removeClass('fa-eye-slash').addClass('fa-eye');
248
+ }
249
+ event.stopPropagation();
250
+ event.preventDefault();
251
+ },
252
+ toggleShowText: function() {
253
+ var $examText = this.$el.find('.js-exam-text');
254
+ var $toggle = this.$el.find('.js-toggle-show-more');
255
+ var $additionalText = this.$el.find('.js-exam-additional-text');
256
+ var currentlyShowingLongText = $examText.data('showLong');
257
+ $additionalText
258
+ // uses both a v1 and a bootstrap utility class because
259
+ // this banner appears across both types of pages
260
+ .toggleClass('hidden d-none', currentlyShowingLongText)
261
+ .attr('aria-hidden', currentlyShowingLongText);
262
+ $toggle.html(currentlyShowingLongText ? $toggle.data('showMoreText') : $toggle.data('showLessText'));
263
+ $examText.data('showLong', !currentlyShowingLongText);
264
+ }
265
+ });
266
+ this.edx.courseware.proctored_exam.ProctoredExamView = edx.courseware.proctored_exam.ProctoredExamView;
267
+ }).call(this, Backbone, $, _, gettext);
@@ -0,0 +1,105 @@
1
+ <style>
2
+ select#proctored_exam {
3
+ width: 100%;
4
+ }
5
+ select#timed_exam {
6
+ width: 100%;
7
+ }
8
+ table, td {
9
+ width: 100%;
10
+ }
11
+ </style>
12
+ <div class='modal-header'><%- gettext("Add a New Allowance") %></div>
13
+ <form>
14
+ <h3 class='error-response'><h3>
15
+ <table class='compact'>
16
+ <tr>
17
+ <td>
18
+ <label><%- gettext("Add Usernames or Emails seperated by commas") %></label>
19
+ </td>
20
+ </tr>
21
+ <tr>
22
+ <td>
23
+ <input type="text" id="user_info" />
24
+ </td>
25
+ </tr>
26
+ <tr>
27
+ <td>
28
+ <label><%- gettext("Select Exam Type") %></label>
29
+ </td>
30
+ </tr>
31
+ <tr>
32
+ <td>
33
+ <select id="exam_type">
34
+ <option value="proctored_exam">
35
+ <%- gettext("Proctored Exam") %>
36
+ </option>
37
+ <option value="timed_exam">
38
+ <%- gettext("Timed Exam") %>
39
+ </option>
40
+ </select>
41
+ </td>
42
+ </tr>
43
+ <tr>
44
+ <td>
45
+ <label><%- gettext("Select Exams") %></label>
46
+ </td>
47
+ </tr>
48
+ <tr>
49
+ <td>
50
+ <select multiple id='proctored_exam' class="exam_dropdown">
51
+ <option hidden selected value=default> <%- gettext("Choose Exams Below") %> </option>
52
+ <% _.each(proctored_exams, function(proctored_exam){ %>
53
+ <option value="<%= proctored_exam.id %>">
54
+ <%- interpolate(gettext(' %(exam_display_name)s '), { exam_display_name: proctored_exam.exam_name }, true) %>
55
+ </option>
56
+ <% }); %>
57
+ </select>
58
+ <select multiple id='timed_exam' class="exam_dropdown" style="display:none;">
59
+ <option hidden selected value=default> <%- gettext("Choose Exams Below") %> </option>
60
+ <% _.each(timed_exams, function(timed_exam){ %>
61
+ <option value="<%= timed_exam.id %>">
62
+ <%- interpolate(gettext(' %(exam_display_name)s '), { exam_display_name: timed_exam.exam_name }, true) %>
63
+ </option>
64
+ <% }); %>
65
+ </select>
66
+ </td>
67
+ </tr>
68
+ <tr>
69
+ <td colspan="3">
70
+ <div id="selected_exams" ></div>
71
+ </td>
72
+ </tr>
73
+ <tr>
74
+ <td>
75
+ <label><%- gettext("Allowance Type") %></label>
76
+ </td>
77
+ </tr>
78
+ <tr>
79
+ <td>
80
+ <select id="allowance_type">
81
+ <% _.each(allowance_types, function(allowance_type){ %>
82
+ <option value="<%= allowance_type[0] %>">
83
+ <%= allowance_type[1] %>
84
+ </option>
85
+ <% }); %>
86
+ </select>
87
+ </td>
88
+ </tr>
89
+ <tr>
90
+ <td>
91
+ <label id='allowance_value_label'><%- gettext("Add Time(Minutes)") %></label>
92
+ </td>
93
+ </tr>
94
+ <tr>
95
+ <td>
96
+ <input type="text" id="allowance_value" />
97
+ </td>
98
+ </tr>
99
+ <tr>
100
+ <td>
101
+ <input id='addNewAllowance' type='submit' value='Create Allowance' />
102
+ </td>
103
+ </tr>
104
+ </table>
105
+ </form>
@@ -0,0 +1,70 @@
1
+ <span class="tip"> <%- gettext("Allowances") %>
2
+ <span>
3
+ <a id="add-allowance" href="#" class="add blue-button">+ <%- gettext("Add Allowance") %></a>
4
+ </span>
5
+ </span>
6
+ <% var is_allowances = proctored_exam_allowances.length !== 0 %>
7
+ <% if (is_allowances) { %>
8
+
9
+ <div class="wrapper-content wrapper">
10
+ <section class="content exam-allowances-content">
11
+ <% _.each(proctored_exam_allowances, function(student){ %>
12
+ <div class="accordion-trigger" aria-expanded="false" style="font-size:20px;" data-key-id="<%=generateDomId(student[0].user.username)%>">
13
+ <span class="fa fa-chevron-down" aria-hidden="true"></span>
14
+ <%=student[0].user.username %>
15
+ </div>
16
+ <table class="allowance-table" id="<%=generateDomId(student[0].user.username) %>" style="display:none;">
17
+ <tbody>
18
+ <tr class="allowance-headings">
19
+ <th class="exam-name"><%- gettext("Exam Name") %></th>
20
+ <th class="email"><%- gettext("Email") %></th>
21
+ <th class="allowance-name"><%- gettext("Allowance Type") %> </th>
22
+ <th class="allowance-value"><%- gettext("Allowance Value") %></th>
23
+ <th class="c_action"><%- gettext("Actions") %> </th>
24
+ </tr>
25
+ <% _.each(student, function(proctored_exam_allowance){ %>
26
+ <% var key = proctored_exam_allowance.key; %>
27
+ <% for (i = 0; i < allowance_types.length; i += 1) { %>
28
+ <% if (key === allowance_types[i][0]) { %>
29
+ <% proctored_exam_allowance.key_display_name = allowance_types[i][1]; %>
30
+ <% break; %>
31
+ <% }} %>
32
+ <% if (!proctored_exam_allowance.key_display_name) { %>
33
+ <% proctored_exam_allowance.key_display_name = key;} %>
34
+ <tr class="allowance-items">
35
+ <td>
36
+ <%- proctored_exam_allowance.proctored_exam.exam_name %>
37
+ </td>
38
+ <td>
39
+ <% if (proctored_exam_allowance.user){ %>
40
+ <%= proctored_exam_allowance.user.email %>
41
+ </td>
42
+ <% }else{ %>
43
+ <td>N/A</td>
44
+ <td>N/A</td>
45
+ <% } %>
46
+ <td>
47
+ <%= proctored_exam_allowance.key_display_name %>
48
+ </td>
49
+ <td>
50
+ <%- proctored_exam_allowance.value %></td>
51
+ <td>
52
+ <a data-exam-id="<%= proctored_exam_allowance.proctored_exam.id %>"
53
+ data-key-name="<%= proctored_exam_allowance.key %>"
54
+ data-key-value="<%= proctored_exam_allowance.key_display_name %>"
55
+ data-user-name="<%= proctored_exam_allowance.user.username %>"
56
+ data-exam-name="<%= proctored_exam_allowance.proctored_exam.exam_name %>"
57
+ class="edit_allowance" href="#">Edit</a>
58
+ <a data-exam-id="<%= proctored_exam_allowance.proctored_exam.id %>"
59
+ data-key-name="<%= proctored_exam_allowance.key %>"
60
+ data-user-id="<%= proctored_exam_allowance.user.id %>"
61
+ class="remove_allowance" href="#">Delete</a>
62
+ </td>
63
+ </tr>
64
+ <% }); %>
65
+ </tbody>
66
+ </table>
67
+ <% }); %>
68
+ </section>
69
+ </div>
70
+ <% } %>
@@ -0,0 +1,3 @@
1
+ <div class="wrapper-content wrapper">
2
+ <iframe src="<%= dashboardURL %>" frameborder=0 height=1280 style="width:100%">
3
+ </div>
@@ -0,0 +1,52 @@
1
+ <div class='modal-header'><%- gettext("Edit Allowance") %></div>
2
+ <form>
3
+ <h3 class='error-response'><h3>
4
+ <table class='compact'>
5
+ <tr>
6
+ <td>
7
+ <label><%- gettext("Username") %></label>
8
+ </td>
9
+ <td>
10
+ <label> <%= selected_user %> </label>
11
+ </td>
12
+ </tr>
13
+ <tr>
14
+ <td>
15
+ <label><%- gettext("Special Exam") %></label>
16
+ </td>
17
+ <td>
18
+ <label>
19
+ <%= selected_exam_name %>
20
+ </label>
21
+ </td>
22
+ </tr>
23
+ <tr>
24
+ <td>
25
+ <label><%- gettext("Allowance Type") %></label>
26
+ </td>
27
+ <td>
28
+ <label>
29
+ <%= allowance_type_name %>
30
+ </label>
31
+ </td>
32
+ </tr>
33
+ <tr>
34
+ <td>
35
+ <% if (allowance_type == 'additional_time_granted') { %>
36
+ <label id='allowance_value_label'><%- gettext("Add Time(Minutes)") %></label>
37
+ <% }else{ %>
38
+ <label id='allowance_value_label'><%- gettext("Add Policy Exception") %></label>
39
+ <% } %>
40
+ </td>
41
+ <td>
42
+ <input type="text" id="allowance_value" />
43
+ </td>
44
+ </tr>
45
+ <tr>
46
+ <td></td>
47
+ <td>
48
+ <input id='editAllowance' type='submit' value='Save' />
49
+ </td>
50
+ </tr>
51
+ </table>
52
+ </form>
@@ -0,0 +1,46 @@
1
+ <div class="proctoring-info">
2
+ <h3 class="message-title"> <%= gettext("This course contains proctored exams") %></h3>
3
+ <% if (onboardingStatusText) { %>
4
+ <div class="onboarding-status">
5
+ <span class="onboarding-status"><%= gettext("Current Onboarding Status:") %> <%= onboardingStatusText %></span>
6
+ </div>
7
+ <div class="onboarding-status-message">
8
+ <span class="onboarding-status-message"><%= onboardingMessage %></span>
9
+ </div>
10
+ <% if (onboardingDetail) { %>
11
+ <div class="onboarding-status-detail">
12
+ <span class="onboarding-status-detail"><%= onboardingDetail %></span>
13
+ </div>
14
+ <%} %>
15
+ <%} %>
16
+ <div class="onboarding-reminder">
17
+ <% if (showOnboardingReminder) { %>
18
+ <h4 class="message-title">
19
+ <% if (showOnboardingExamLink) { %>
20
+ <%= gettext("You must have a verified onboarding profile prior to taking any proctored exam.") %>
21
+ <% } else { %>
22
+ <%= gettext("You have successfully submitted your onboarding profile for review.") %>
23
+ <%} %>
24
+ </h4>
25
+ <p class="message-copy">
26
+ <%= gettext("Onboarding profile review can take 2+ business days.") %>
27
+ </p>
28
+ <%} %>
29
+ </div>
30
+ <% if (showOnboardingExamLink) { %>
31
+ <% if (onboardingPastDue) { %>
32
+ <a class="action action-onboarding action-disabled"><%= gettext("Onboarding Past Due") %></a>
33
+ <% } else if (onboardingNotReleased) { %>
34
+ <a class="action action-onboarding action-disabled"><%= gettext("Onboarding Opens") %> <%= onboardingReleaseDate %></a>
35
+ <%} else if (onboardingStatus && onboardingStatus === 'other_course_approved') { %>
36
+ <a href="<%= onboardingLink %>" class="action action-onboarding-practice"><%= gettext("View Onboarding Exam") %></a>
37
+ <%} else { %>
38
+ <a href="<%= onboardingLink %>" class="action action-onboarding"><%= gettext("Complete Onboarding") %></a>
39
+ <%} %>
40
+ <%} %>
41
+ <% if (reviewRequirementsUrl) { %>
42
+ <a href="<%= reviewRequirementsUrl %>" class="action action-info-link"><%= gettext("Review instructions and system requirements for proctored exams") %></a>
43
+ <%} else { %>
44
+ <a href="https://support.edx.org/hc/en-us/articles/207249428-How-do-proctored-exams-work" class="action action-info-link"><%= gettext("Review instructions and system requirements for proctored exams") %></a>
45
+ <%} %>
46
+ </div>