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
1b1a309f
Commit
1b1a309f
authored
Jul 16, 2015
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
construct a jump_to link and pass back to the backbone app
parent
a49d2b0f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
edx_proctoring/views.py
+17
-4
No files found.
edx_proctoring/views.py
View file @
1b1a309f
...
...
@@ -8,6 +8,7 @@ from datetime import datetime, timedelta
from
django.utils.decorators
import
method_decorator
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
,
NoReverseMatch
from
rest_framework
import
status
from
rest_framework.response
import
Response
...
...
@@ -365,9 +366,10 @@ class StudentProctoredExamAttemptCollection(AuthenticatedAPIView):
exams
=
get_active_exams_for_user
(
request
.
user
.
id
)
if
exams
:
exam
=
exams
[
0
]
exam
_info
=
exams
[
0
]
attempt
=
exam
[
'attempt'
]
exam
=
exam_info
[
'exam'
]
attempt
=
exam_info
[
'attempt'
]
# need to adjust for allowances
expires_at
=
attempt
[
'started_at'
]
+
timedelta
(
minutes
=
attempt
[
'allowed_time_limit_mins'
])
...
...
@@ -387,11 +389,22 @@ class StudentProctoredExamAttemptCollection(AuthenticatedAPIView):
critically_low_threshold_pct
*
float
(
attempt
[
'allowed_time_limit_mins'
])
*
60
)
exam_url_path
=
''
try
:
# resolve the LMS url, note we can't assume we're running in
# a same process as the LMS
exam_url_path
=
reverse
(
'courseware.views.jump_to'
,
args
=
[
exam
[
'course_id'
],
exam
[
'content_id'
]]
)
except
NoReverseMatch
:
pass
response_dict
=
{
'in_timed_exam'
:
True
,
'taking_as_proctored'
:
attempt
[
'taking_as_proctored'
],
'exam_display_name'
:
exam
[
'exam
'
][
'exam
_name'
],
'exam_url_path'
:
''
,
'exam_display_name'
:
exam
[
'exam_name'
],
'exam_url_path'
:
exam_url_path
,
'time_remaining_seconds'
:
time_remaining_seconds
,
'low_threshold_sec'
:
low_threshold
,
'critically_low_threshold_sec'
:
critically_low_threshold
,
...
...
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