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
OpenEdx
edx-proctoring
Commits
5f86df09
Commit
5f86df09
authored
Oct 06, 2015
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow to turn off prerequisite enforcement
parent
e724f625
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
13 deletions
+22
-13
edx_proctoring/api.py
+4
-7
edx_proctoring/constants.py
+6
-0
edx_proctoring/tests/test_api.py
+12
-6
No files found.
edx_proctoring/api.py
View file @
5f86df09
...
@@ -1108,16 +1108,16 @@ def get_student_view(user_id, course_id, content_id,
...
@@ -1108,16 +1108,16 @@ def get_student_view(user_id, course_id, content_id,
credit_state
=
context
[
'credit_state'
]
credit_state
=
context
[
'credit_state'
]
has_mode
=
_check_eligibility_of_enrollment_mode
(
credit_state
)
has_mode
=
_check_eligibility_of_enrollment_mode
(
credit_state
)
has_prerequisites
=
False
if
not
has_mode
:
if
has_mode
:
return
None
has_prerequisites
=
_check_eligibility_of_prerequisites
(
credit_state
)
has_prerequisites
=
_check_eligibility_of_prerequisites
(
credit_state
)
# see if the user has passed all pre-requisite credit eligibility
# see if the user has passed all pre-requisite credit eligibility
# checks, otherwise just show the user the exam unproctored
# checks, otherwise just show the user the exam unproctored
if
not
has_
mode
or
not
has_prerequisites
:
if
not
has_
prerequisites
and
constants
.
ENFORCE_PREREQUISITES
:
# if we are in the right mode and if we don't have
# if we are in the right mode and if we don't have
# pre-requisites, then we implicitly decline the exam
# pre-requisites, then we implicitly decline the exam
if
has_mode
:
attempt
=
get_exam_attempt
(
exam_id
,
user_id
)
attempt
=
get_exam_attempt
(
exam_id
,
user_id
)
if
not
attempt
:
if
not
attempt
:
# user hasn't a record of attempt, create one now
# user hasn't a record of attempt, create one now
...
@@ -1131,9 +1131,6 @@ def get_student_view(user_id, course_id, content_id,
...
@@ -1131,9 +1131,6 @@ def get_student_view(user_id, course_id, content_id,
raise_if_not_found
=
False
raise_if_not_found
=
False
)
)
# don't override context, let the courseware show
return
None
attempt
=
get_exam_attempt
(
exam_id
,
user_id
)
attempt
=
get_exam_attempt
(
exam_id
,
user_id
)
# if user has declined the attempt, then we don't show the
# if user has declined the attempt, then we don't show the
...
...
edx_proctoring/constants.py
View file @
5f86df09
...
@@ -41,3 +41,9 @@ REQUIRE_FAILURE_SECOND_REVIEWS = (
...
@@ -41,3 +41,9 @@ REQUIRE_FAILURE_SECOND_REVIEWS = (
'REQUIRE_FAILURE_SECOND_REVIEWS'
in
settings
.
PROCTORING_SETTINGS
'REQUIRE_FAILURE_SECOND_REVIEWS'
in
settings
.
PROCTORING_SETTINGS
else
getattr
(
settings
,
'REQUIRE_FAILURE_SECOND_REVIEWS'
,
True
)
else
getattr
(
settings
,
'REQUIRE_FAILURE_SECOND_REVIEWS'
,
True
)
)
)
ENFORCE_PREREQUISITES
=
(
settings
.
PROCTORING_SETTINGS
[
'ENFORCE_PREREQUISITES'
]
if
'ENFORCE_PREREQUISITES'
in
settings
.
PROCTORING_SETTINGS
else
False
)
edx_proctoring/tests/test_api.py
View file @
5f86df09
...
@@ -724,14 +724,19 @@ class ProctoredExamApiTests(LoggedInTestCase):
...
@@ -724,14 +724,19 @@ class ProctoredExamApiTests(LoggedInTestCase):
self
.
assertIsNone
(
rendered_response
)
self
.
assertIsNone
(
rendered_response
)
@ddt.data
(
@ddt.data
(
(
'reverification'
,
None
,
True
,
True
,
False
),
(
True
,
'reverification'
,
None
,
True
,
True
,
False
),
(
'reverification'
,
'failed'
,
False
,
False
,
True
),
(
True
,
'reverification'
,
'failed'
,
False
,
False
,
True
),
(
'reverification'
,
'failed'
,
False
,
True
,
False
),
(
True
,
'reverification'
,
'failed'
,
True
,
True
,
False
),
(
'reverification'
,
'satisfied'
,
True
,
True
,
False
),
(
True
,
'reverification'
,
'satisfied'
,
True
,
True
,
False
),
(
'grade'
,
'failed'
,
True
,
False
,
False
)
(
True
,
'grade'
,
'failed'
,
True
,
False
,
False
),
(
False
,
'reverification'
,
None
,
True
,
True
,
False
),
(
False
,
'reverification'
,
'failed'
,
True
,
False
,
False
),
(
False
,
'reverification'
,
'failed'
,
True
,
True
,
False
),
(
False
,
'reverification'
,
'satisfied'
,
True
,
True
,
False
),
(
False
,
'grade'
,
'failed'
,
True
,
False
,
False
),
)
)
@ddt.unpack
@ddt.unpack
def
test_prereq_scenarios
(
self
,
namespace
,
req_status
,
show_proctored
,
def
test_prereq_scenarios
(
self
,
enforce_prereq
,
namespace
,
req_status
,
show_proctored
,
pre_create_attempt
,
mark_as_declined
):
pre_create_attempt
,
mark_as_declined
):
"""
"""
This test asserts that proctoring will not be displayed under the following
This test asserts that proctoring will not be displayed under the following
...
@@ -740,6 +745,7 @@ class ProctoredExamApiTests(LoggedInTestCase):
...
@@ -740,6 +745,7 @@ class ProctoredExamApiTests(LoggedInTestCase):
- Verified student has not completed all 'reverification' requirements
- Verified student has not completed all 'reverification' requirements
"""
"""
with
patch
(
'edx_proctoring.constants.ENFORCE_PREREQUISITES'
,
enforce_prereq
):
exam
=
get_exam_by_id
(
self
.
proctored_exam_id
)
exam
=
get_exam_by_id
(
self
.
proctored_exam_id
)
if
pre_create_attempt
:
if
pre_create_attempt
:
...
...
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