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
1b194552
Commit
1b194552
authored
Aug 21, 2015
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make sure that we also time out when status is not just started
parent
0a429c11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
edx_proctoring/api.py
+1
-1
edx_proctoring/tests/test_views.py
+12
-2
No files found.
edx_proctoring/api.py
View file @
1b194552
...
@@ -234,7 +234,7 @@ def _check_for_attempt_timeout(attempt):
...
@@ -234,7 +234,7 @@ def _check_for_attempt_timeout(attempt):
has_started_exam
=
(
has_started_exam
=
(
attempt
and
attempt
and
attempt
.
get
(
'started_at'
)
and
attempt
.
get
(
'started_at'
)
and
attempt
.
get
(
'status'
)
==
ProctoredExamStudentAttemptStatus
.
started
ProctoredExamStudentAttemptStatus
.
is_incomplete_status
(
attempt
.
get
(
'status'
))
)
)
if
has_started_exam
:
if
has_started_exam
:
now_utc
=
datetime
.
now
(
pytz
.
UTC
)
now_utc
=
datetime
.
now
(
pytz
.
UTC
)
...
...
edx_proctoring/tests/test_views.py
View file @
1b194552
...
@@ -25,6 +25,7 @@ from edx_proctoring.api import (
...
@@ -25,6 +25,7 @@ from edx_proctoring.api import (
create_exam
,
create_exam
,
create_exam_attempt
,
create_exam_attempt
,
get_exam_attempt_by_id
,
get_exam_attempt_by_id
,
update_attempt_status
,
)
)
from
.utils
import
(
from
.utils
import
(
...
@@ -557,7 +558,13 @@ class TestStudentProctoredExamAttempt(LoggedInTestCase):
...
@@ -557,7 +558,13 @@ class TestStudentProctoredExamAttempt(LoggedInTestCase):
response_data
=
json
.
loads
(
response
.
content
)
response_data
=
json
.
loads
(
response
.
content
)
self
.
assertEqual
(
response_data
[
'status'
],
'error'
)
self
.
assertEqual
(
response_data
[
'status'
],
'error'
)
def
test_attempt_callback_timeout
(
self
):
@ddt.data
(
ProctoredExamStudentAttemptStatus
.
created
,
ProctoredExamStudentAttemptStatus
.
ready_to_start
,
ProctoredExamStudentAttemptStatus
.
started
,
ProctoredExamStudentAttemptStatus
.
ready_to_submit
)
def
test_attempt_callback_timeout
(
self
,
running_status
):
"""
"""
Ensures that the polling from the client will cause the
Ensures that the polling from the client will cause the
server to transition to timed_out if the user runs out of time
server to transition to timed_out if the user runs out of time
...
@@ -594,6 +601,9 @@ class TestStudentProctoredExamAttempt(LoggedInTestCase):
...
@@ -594,6 +601,9 @@ class TestStudentProctoredExamAttempt(LoggedInTestCase):
self
.
assertEqual
(
response_data
[
'status'
],
'started'
)
self
.
assertEqual
(
response_data
[
'status'
],
'started'
)
attempt_code
=
response_data
[
'attempt_code'
]
attempt_code
=
response_data
[
'attempt_code'
]
# now set status to what we want per DDT
update_attempt_status
(
proctored_exam
.
id
,
self
.
user
.
id
,
running_status
)
# test the polling callback point
# test the polling callback point
response
=
self
.
client
.
get
(
response
=
self
.
client
.
get
(
reverse
(
reverse
(
...
@@ -603,7 +613,7 @@ class TestStudentProctoredExamAttempt(LoggedInTestCase):
...
@@ -603,7 +613,7 @@ class TestStudentProctoredExamAttempt(LoggedInTestCase):
)
)
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertEqual
(
response
.
status_code
,
200
)
response_data
=
json
.
loads
(
response
.
content
)
response_data
=
json
.
loads
(
response
.
content
)
self
.
assertEqual
(
response_data
[
'status'
],
'started'
)
self
.
assertEqual
(
response_data
[
'status'
],
running_status
)
# set time to be in future
# set time to be in future
reset_time
=
datetime
.
now
(
pytz
.
UTC
)
+
timedelta
(
minutes
=
180
)
reset_time
=
datetime
.
now
(
pytz
.
UTC
)
+
timedelta
(
minutes
=
180
)
...
...
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