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
2303060f
Commit
2303060f
authored
Jan 05, 2016
by
Hasnain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove due date has past check from get_practice_exam_view function.
parent
769e1859
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
56 deletions
+1
-56
edx_proctoring/api.py
+1
-4
edx_proctoring/tests/test_api.py
+0
-52
No files found.
edx_proctoring/api.py
View file @
2303060f
...
@@ -1559,10 +1559,7 @@ def _get_practice_exam_view(exam, context, exam_id, user_id, course_id):
...
@@ -1559,10 +1559,7 @@ def _get_practice_exam_view(exam, context, exam_id, user_id, course_id):
attempt_status
=
attempt
[
'status'
]
if
attempt
else
None
attempt_status
=
attempt
[
'status'
]
if
attempt
else
None
if
not
attempt_status
:
if
not
attempt_status
:
if
_has_due_date_passed
(
exam
[
'due_date'
]):
student_view_template
=
'practice_exam/entrance.html'
student_view_template
=
'proctored_exam/expired.html'
else
:
student_view_template
=
'practice_exam/entrance.html'
elif
attempt_status
==
ProctoredExamStudentAttemptStatus
.
started
:
elif
attempt_status
==
ProctoredExamStudentAttemptStatus
.
started
:
# when we're taking the exam we should not override the view
# when we're taking the exam we should not override the view
return
None
return
None
...
...
edx_proctoring/tests/test_api.py
View file @
2303060f
...
@@ -1373,58 +1373,6 @@ class ProctoredExamApiTests(LoggedInTestCase):
...
@@ -1373,58 +1373,6 @@ class ProctoredExamApiTests(LoggedInTestCase):
else
:
else
:
self
.
assertIsNone
(
None
)
self
.
assertIsNone
(
None
)
@ddt.data
(
(
True
,
False
),
(
True
,
True
),
(
False
,
False
),
)
@ddt.unpack
def
test_practice_exam_attempt_with_past_due_datetime
(
self
,
is_proctored
,
is_practice
):
"""
Test for get_student_view for practice proctored exam with past due datetime
"""
due_date
=
datetime
.
now
(
pytz
.
UTC
)
+
timedelta
(
days
=
1
)
# exam is created with due datetime which has already passed
self
.
_create_exam_with_due_time
(
is_proctored
=
is_proctored
,
is_practice_exam
=
is_practice
,
due_date
=
due_date
)
# due_date is exactly after 24 hours, if student arrives after 2 days
# then he can not attempt the proctored exam
reset_time
=
due_date
+
timedelta
(
days
=
2
)
with
freeze_time
(
reset_time
):
rendered_response
=
get_student_view
(
user_id
=
self
.
user_id
,
course_id
=
self
.
course_id
,
content_id
=
self
.
content_id_for_exam_with_due_date
,
context
=
{
'is_proctored'
:
True
,
'is_practice_exam'
:
True
,
'display_name'
:
self
.
exam_name
,
'default_time_limit_mins'
:
self
.
default_time_limit
}
)
self
.
assertIn
(
self
.
exam_expired_msg
,
rendered_response
)
# call the view again, because the first call set the exam attempt to 'expired'
# this second call will render the view based on the state
rendered_response
=
get_student_view
(
user_id
=
self
.
user_id
,
course_id
=
self
.
course_id
,
content_id
=
self
.
content_id_for_exam_with_due_date
,
context
=
{
'is_proctored'
:
True
,
'is_practice_exam'
:
True
,
'display_name'
:
self
.
exam_name
,
'default_time_limit_mins'
:
self
.
default_time_limit
}
)
self
.
assertIn
(
self
.
exam_expired_msg
,
rendered_response
)
def
test_proctored_exam_attempt_with_past_due_datetime
(
self
):
def
test_proctored_exam_attempt_with_past_due_datetime
(
self
):
"""
"""
Test for get_student_view for proctored exam with past due datetime
Test for get_student_view for proctored exam with past due datetime
...
...
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