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
5c681c58
Commit
5c681c58
authored
Jul 23, 2015
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Course staff should not see any proctored exam stuff
parent
7b8492d7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
4 deletions
+27
-4
edx_proctoring/api.py
+8
-4
edx_proctoring/tests/test_api.py
+19
-0
No files found.
edx_proctoring/api.py
View file @
5c681c58
# pylint: disable=unused-argument
# remove pylint rule after we implement each method
# pylint: disable=too-many-branches
"""
In-Proc API (aka Library) for the edx_proctoring subsystem. This is not to be confused with a HTTP REST
...
...
@@ -473,7 +471,8 @@ def get_active_exams_for_user(user_id, course_id=None):
return
result
def
get_student_view
(
user_id
,
course_id
,
content_id
,
context
):
# pylint: disable=too-many-branches
def
get_student_view
(
user_id
,
course_id
,
content_id
,
context
,
user_role
=
'student'
):
"""
Helper method that will return the view HTML related to the exam control
flow (i.e. entering, expired, completed, etc.) If there is no specific
...
...
@@ -481,6 +480,11 @@ def get_student_view(user_id, course_id, content_id, context): # pylint: disabl
render it's own view
"""
# non-student roles should never see any proctoring related
# screens
if
user_role
!=
'student'
:
return
None
has_finished_exam
=
False
student_view_template
=
None
...
...
edx_proctoring/tests/test_api.py
View file @
5c681c58
...
...
@@ -492,6 +492,25 @@ class ProctoredExamApiTests(LoggedInTestCase):
self
.
assertIn
(
'data-exam-id="
%
d"'
%
self
.
proctored_exam_id
,
rendered_response
)
self
.
assertIn
(
self
.
start_an_exam_msg
%
self
.
exam_name
,
rendered_response
)
def
test_student_view_non_student
(
self
):
"""
Make sure that if we ask for a student view if we are not in a student role,
then we don't see any proctoring views
"""
rendered_response
=
get_student_view
(
user_id
=
self
.
user_id
,
course_id
=
self
.
course_id
,
content_id
=
self
.
content_id
,
context
=
{
'is_proctored'
:
True
,
'display_name'
:
self
.
exam_name
,
'default_time_limit_mins'
:
90
},
user_role
=
'staff'
)
self
.
assertIsNone
(
rendered_response
)
def
test_get_disabled_student_view
(
self
):
"""
Assert that a disabled proctored exam will not override the
...
...
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