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
ebe66950
Commit
ebe66950
authored
Aug 03, 2015
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decling proctoring will not show the views
parent
66b468e7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletions
+26
-1
edx_proctoring/api.py
+6
-1
edx_proctoring/tests/test_api.py
+20
-0
No files found.
edx_proctoring/api.py
View file @
ebe66950
...
@@ -633,8 +633,13 @@ def get_student_view(user_id, course_id, content_id,
...
@@ -633,8 +633,13 @@ def get_student_view(user_id, course_id, content_id,
return
None
return
None
attempt
=
get_exam_attempt
(
exam_id
,
user_id
)
attempt
=
get_exam_attempt
(
exam_id
,
user_id
)
has_started_exam
=
attempt
and
attempt
.
get
(
'started_at'
)
# if user has declined the attempt, then we don't show the
# proctored exam
if
attempt
and
attempt
[
'status'
]
==
ProctoredExamStudentAttemptStatus
.
declined
:
return
None
has_started_exam
=
attempt
and
attempt
.
get
(
'started_at'
)
if
has_started_exam
:
if
has_started_exam
:
if
attempt
.
get
(
'status'
)
==
'error'
:
if
attempt
.
get
(
'status'
)
==
'error'
:
student_view_template
=
'proctoring/seq_proctored_exam_error.html'
student_view_template
=
'proctoring/seq_proctored_exam_error.html'
...
...
edx_proctoring/tests/test_api.py
View file @
ebe66950
...
@@ -788,6 +788,26 @@ class ProctoredExamApiTests(LoggedInTestCase):
...
@@ -788,6 +788,26 @@ class ProctoredExamApiTests(LoggedInTestCase):
)
)
self
.
assertIn
(
self
.
chose_proctored_exam_msg
%
self
.
exam_name
,
rendered_response
)
self
.
assertIn
(
self
.
chose_proctored_exam_msg
%
self
.
exam_name
,
rendered_response
)
def
test_declined_attempt
(
self
):
"""
Make sure that a declined attempt does not show proctoring
"""
attempt_obj
=
self
.
_create_unstarted_exam_attempt
()
attempt_obj
.
status
=
ProctoredExamStudentAttemptStatus
.
declined
attempt_obj
.
save
()
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
}
)
self
.
assertIsNone
(
rendered_response
)
def
test_get_studentview_started_exam
(
self
):
# pylint: disable=invalid-name
def
test_get_studentview_started_exam
(
self
):
# pylint: disable=invalid-name
"""
"""
Test for get_student_view proctored exam which has started.
Test for get_student_view proctored exam which has started.
...
...
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