Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-proctoring
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-proctoring
Commits
8bb0d240
Commit
8bb0d240
authored
Aug 09, 2017
by
sarahkf
Committed by
GitHub
Aug 09, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Proctor Review Rules
EDUCATOR-757
parents
f77da94a
e99371df
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
0 deletions
+53
-0
edx_proctoring/api.py
+14
-0
edx_proctoring/templates/proctored_exam/ready_to_start.html
+21
-0
edx_proctoring/tests/test_api.py
+18
-0
No files found.
edx_proctoring/api.py
View file @
8bb0d240
...
...
@@ -205,6 +205,19 @@ def get_review_policy_by_exam_id(exam_id):
return
ProctoredExamReviewPolicySerializer
(
exam_review_policy
)
.
data
def
_get_review_policy_by_exam_id
(
exam_id
):
"""
Looks up exam by the primary key. Returns None if not found
Returns review_policy field of the Django ORM object
"""
try
:
exam_review_policy
=
get_review_policy_by_exam_id
(
exam_id
)
return
ProctoredExamReviewPolicySerializer
(
exam_review_policy
)
.
data
[
'review_policy'
]
except
ProctoredExamReviewPolicyNotFoundException
:
return
None
def
update_exam
(
exam_id
,
exam_name
=
None
,
time_limit_mins
=
None
,
due_date
=
constants
.
MINIMUM_TIME
,
is_proctored
=
None
,
is_practice_exam
=
None
,
external_id
=
None
,
is_active
=
None
,
hide_after_due
=
None
):
"""
...
...
@@ -1623,6 +1636,7 @@ def _get_proctored_exam_context(exam, attempt, course_id, is_practice_exam=False
)
if
attempt
else
''
,
'link_urls'
:
settings
.
PROCTORING_SETTINGS
.
get
(
'LINK_URLS'
,
{}),
'tech_support_email'
:
settings
.
TECH_SUPPORT_EMAIL
,
'exam_review_policy'
:
_get_review_policy_by_exam_id
(
exam
[
'id'
]),
}
...
...
edx_proctoring/templates/proctored_exam/ready_to_start.html
View file @
8bb0d240
...
...
@@ -12,8 +12,29 @@
•
You cannot stop the timer once you start.
</br>
•
If time expires before you finish your exam, your completed answers will be
submitted for review.
</br>
•
If you have not taken a proctored exam before using {{ platform_name }} please read
the exam rules and guidelines first. Reading these will ensure you don't accidentally violate
any of the proctored exam rules. {% endblocktrans %}
<a
href=
"{{link_urls.online_proctoring_rules}}"
target=
"_blank"
>
{% blocktrans %}
Read the {{ platform_name }} Online Proctoring Rules for Learners
{% endblocktrans %}
</a>
</br>
</p>
{% if exam_review_policy %}
<h3>
{% blocktrans %}
Additional Exam Rules
{% endblocktrans %}
</h3>
<p>
{% blocktrans %}
In addition to the general exam rules above, the following additions or exceptions apply to this exam:
</br>
</br>
{{ exam_review_policy }}
</br>
{% endblocktrans %}
</p>
{% endif %}
<div>
<button
type=
"button"
class=
"exam-action-button proctored-enter-exam btn btn-pl-primary btn-base"
data-action=
"start"
data-exam-id=
"{{exam_id}}"
data-change-state-url=
"{{change_state_url}}"
>
{% blocktrans %}
...
...
edx_proctoring/tests/test_api.py
View file @
8bb0d240
...
...
@@ -43,6 +43,7 @@ from edx_proctoring.api import (
_are_prerequirements_satisfied
,
create_exam_review_policy
,
get_review_policy_by_exam_id
,
_get_review_policy_by_exam_id
,
update_review_policy
,
remove_review_policy
,
)
...
...
@@ -195,6 +196,23 @@ class ProctoredExamApiTests(ProctoredExamTestCase):
self
.
assertEqual
(
exam_review_policy
[
'set_by_user'
][
'id'
],
self
.
user_id
)
self
.
assertEqual
(
exam_review_policy
[
'review_policy'
],
u'allow use of paper'
)
def
test_get_exam_review_policy
(
self
):
"""
Test that creates a new exam policy and tests
that the policy can be properly retrieved
"""
proctored_exam
=
get_exam_by_id
(
self
.
proctored_exam_id
)
create_exam_review_policy
(
exam_id
=
proctored_exam
[
'id'
],
set_by_user_id
=
self
.
user_id
,
review_policy
=
u'allow use of paper'
)
# now get the exam review policy for the proctored exam
exam_review_policy_string
=
_get_review_policy_by_exam_id
(
proctored_exam
[
'id'
])
self
.
assertEqual
(
exam_review_policy_string
,
u'allow use of paper'
)
def
test_update_exam_review_policy
(
self
):
"""
Test to update existing exam review policy for
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment