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
edx
edx-proctoring
Commits
71e3838b
Commit
71e3838b
authored
Nov 25, 2015
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do the timestamp changes at the same time we set the status
parent
74eaaa9f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
16 deletions
+14
-16
edx_proctoring/api.py
+14
-16
No files found.
edx_proctoring/api.py
View file @
71e3838b
...
@@ -653,6 +653,20 @@ def update_attempt_status(exam_id, user_id, to_status, raise_if_not_found=True,
...
@@ -653,6 +653,20 @@ def update_attempt_status(exam_id, user_id, to_status, raise_if_not_found=True,
# OK, state transition is fine, we can proceed
# OK, state transition is fine, we can proceed
exam_attempt_obj
.
status
=
to_status
exam_attempt_obj
.
status
=
to_status
# if we have transitioned to started and haven't set our
# started_at timestamp, do so now
add_start_time
=
(
to_status
==
ProctoredExamStudentAttemptStatus
.
started
and
not
exam_attempt_obj
.
started_at
)
if
add_start_time
:
exam_attempt_obj
.
started_at
=
datetime
.
now
(
pytz
.
UTC
)
elif
to_status
==
ProctoredExamStudentAttemptStatus
.
submitted
:
# likewise, when we transition to submitted mark
# when the exam has been completed
exam_attempt_obj
.
completed_at
=
datetime
.
now
(
pytz
.
UTC
)
exam_attempt_obj
.
save
()
exam_attempt_obj
.
save
()
# see if the status transition this changes credit requirement status
# see if the status transition this changes credit requirement status
...
@@ -737,22 +751,6 @@ def update_attempt_status(exam_id, user_id, to_status, raise_if_not_found=True,
...
@@ -737,22 +751,6 @@ def update_attempt_status(exam_id, user_id, to_status, raise_if_not_found=True,
cascade_effects
=
False
cascade_effects
=
False
)
)
if
to_status
==
ProctoredExamStudentAttemptStatus
.
submitted
:
# also mark the exam attempt completed_at timestamp
# after we submit the attempt
exam_attempt_obj
.
completed_at
=
datetime
.
now
(
pytz
.
UTC
)
exam_attempt_obj
.
save
()
# if we have transitioned to started and haven't set our
# started_at timestamp, do so now
add_start_time
=
(
to_status
==
ProctoredExamStudentAttemptStatus
.
started
and
not
exam_attempt_obj
.
started_at
)
if
add_start_time
:
exam_attempt_obj
.
started_at
=
datetime
.
now
(
pytz
.
UTC
)
exam_attempt_obj
.
save
()
# email will be send when the exam is proctored and not practice exam
# email will be send when the exam is proctored and not practice exam
# and the status is verified, submitted or rejected
# and the status is verified, submitted or rejected
should_send_status_email
=
(
should_send_status_email
=
(
...
...
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