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
90b5120d
Unverified
Commit
90b5120d
authored
Feb 28, 2018
by
Noraiz Anwar
Committed by
GitHub
Feb 28, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #416 from edx/noraiz/EDUCATOR-2314-test-fix
fix test failures at edx-platform
parents
c53f61d9
f1f31050
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
edx_proctoring/__init__.py
+1
-1
edx_proctoring/api.py
+8
-4
No files found.
edx_proctoring/__init__.py
View file @
90b5120d
...
...
@@ -4,6 +4,6 @@ The exam proctoring subsystem for the Open edX platform.
from
__future__
import
absolute_import
__version__
=
'1.3.
7
'
__version__
=
'1.3.
8
'
default_app_config
=
'edx_proctoring.apps.EdxProctoringConfig'
# pylint: disable=invalid-name
edx_proctoring/api.py
View file @
90b5120d
...
...
@@ -1648,12 +1648,16 @@ def _calculate_allowed_mins(exam, user_id):
return
allowed_time_limit_mins
def
_get_proctored_exam_context
(
exam
,
attempt
,
course_id
,
is_practice_exam
=
False
):
def
_get_proctored_exam_context
(
exam
,
attempt
,
user_id
,
course_id
,
is_practice_exam
=
False
):
"""
Common context variables for the Proctored and Practice exams' templates.
"""
has_due_date
=
True
if
exam
[
'due_date'
]
is
not
None
else
False
attempt_time
=
attempt
[
'allowed_time_limit_mins'
]
if
attempt
else
exam
[
'time_limit_mins'
]
attempt_time
=
attempt
.
get
(
'allowed_time_limit_mins'
,
None
)
if
attempt
else
None
if
not
attempt_time
:
attempt_time
=
_calculate_allowed_mins
(
exam
,
user_id
)
total_time
=
humanized_time
(
attempt_time
)
progress_page_url
=
''
try
:
...
...
@@ -1723,7 +1727,7 @@ def _get_practice_exam_view(exam, context, exam_id, user_id, course_id):
if
student_view_template
:
template
=
loader
.
get_template
(
student_view_template
)
context
.
update
(
_get_proctored_exam_context
(
exam
,
attempt
,
course_id
,
is_practice_exam
=
True
))
context
.
update
(
_get_proctored_exam_context
(
exam
,
attempt
,
user_id
,
course_id
,
is_practice_exam
=
True
))
return
template
.
render
(
context
)
...
...
@@ -1866,7 +1870,7 @@ def _get_proctored_exam_view(exam, context, exam_id, user_id, course_id):
if
student_view_template
:
template
=
loader
.
get_template
(
student_view_template
)
context
.
update
(
_get_proctored_exam_context
(
exam
,
attempt
,
course_id
))
context
.
update
(
_get_proctored_exam_context
(
exam
,
attempt
,
user_id
,
course_id
))
return
template
.
render
(
context
)
...
...
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