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
fe23eeb8
Commit
fe23eeb8
authored
Aug 06, 2015
by
chrisndodge
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #67 from edx/cdodge/allow-reattempts-on-practice-error
custom practice exam error page
parents
9eb5619f
c5fd2071
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
2 deletions
+78
-2
edx_proctoring/api.py
+4
-1
edx_proctoring/templates/proctoring/seq_proctored_practice_exam_error.html
+56
-0
edx_proctoring/tests/test_api.py
+18
-1
No files found.
edx_proctoring/api.py
View file @
fe23eeb8
...
...
@@ -941,7 +941,10 @@ def get_student_view(user_id, course_id, content_id,
elif
attempt
[
'status'
]
==
ProctoredExamStudentAttemptStatus
.
ready_to_start
:
student_view_template
=
'proctoring/seq_proctored_exam_ready_to_start.html'
elif
attempt
[
'status'
]
==
ProctoredExamStudentAttemptStatus
.
error
:
student_view_template
=
'proctoring/seq_proctored_exam_error.html'
if
attempt
[
'is_sample_attempt'
]:
student_view_template
=
'proctoring/seq_proctored_practice_exam_error.html'
else
:
student_view_template
=
'proctoring/seq_proctored_exam_error.html'
elif
attempt
[
'status'
]
==
ProctoredExamStudentAttemptStatus
.
timed_out
:
student_view_template
=
'proctoring/seq_timed_exam_expired.html'
elif
attempt
[
'status'
]
==
ProctoredExamStudentAttemptStatus
.
submitted
:
...
...
edx_proctoring/templates/proctoring/seq_proctored_practice_exam_error.html
0 → 100644
View file @
fe23eeb8
{% load i18n %}
<div
class=
"failure sequence proctored-exam"
data-exam-id=
"{{exam_id}}"
>
<h3>
{% blocktrans %}
Your proctoring proctoring session is in error
{% endblocktrans %}
</h3>
<h4>
{% blocktrans %}
Your Practice Proctoring Session:
<b
class=
"failure"
>
Failed
</b>
{% endblocktrans %}
</h4>
<p>
{% blocktrans %}
It appears that your proctoring session has been shut down while you were taking this
practice exam. Your practice exam is considered in error. While this will not affect your grade
or credit eligibility, it is recommended that you retry this practice exam until your
are successful
{% endblocktrans %}
</p>
<hr>
<div
class=
"gated-sequence"
>
<span><i
class=
"fa fa-lock"
></i></span>
<a
class=
"start-timed-exam"
data-ajax-url=
"{{enter_exam_endpoint}}"
data-exam-id=
"{{exam_id}}"
data-attempt-proctored=
true
data-start-immediately=
false
>
{% trans "Please retry this practice exam again" %}
</a>
</div>
</div>
<script
type=
"text/javascript"
>
$
(
'.start-timed-exam'
).
click
(
function
(
event
)
{
var
action_url
=
$
(
this
).
data
(
'ajax-url'
);
var
exam_id
=
$
(
this
).
data
(
'exam-id'
);
var
attempt_proctored
=
$
(
this
).
data
(
'attempt-proctored'
);
var
start_immediately
=
$
(
this
).
data
(
'start-immediately'
);
if
(
typeof
action_url
===
"undefined"
)
{
return
false
;
}
$
.
post
(
action_url
,
{
"exam_id"
:
exam_id
,
"attempt_proctored"
:
attempt_proctored
,
"start_clock"
:
start_immediately
},
function
(
data
)
{
// reload the page, because we've unlocked it
location
.
reload
();
}
);
}
);
</script>
edx_proctoring/tests/test_api.py
View file @
fe23eeb8
...
...
@@ -105,6 +105,7 @@ class ProctoredExamApiTests(LoggedInTestCase):
self
.
start_a_practice_exam_msg
=
'Would you like to take
%
s as a practice proctored exam?'
self
.
practice_exam_submitted_msg
=
'You have submitted this practice proctored exam'
self
.
ready_to_start_msg
=
'Your Proctoring Installation and Set Up is Complete'
self
.
practice_exam_failed_msg
=
'Your proctoring proctoring session is in error'
set_runtime_service
(
'credit'
,
MockCreditService
())
set_runtime_service
(
'instructor'
,
MockInstructorService
())
...
...
@@ -1013,7 +1014,7 @@ class ProctoredExamApiTests(LoggedInTestCase):
Test for get_student_view proctored exam which has exam status error.
"""
ProctoredExamStudentAttempt
.
objects
.
create
(
exam_attempt
=
ProctoredExamStudentAttempt
.
objects
.
create
(
proctored_exam_id
=
self
.
proctored_exam_id
,
user_id
=
self
.
user_id
,
external_id
=
self
.
external_id
,
...
...
@@ -1034,6 +1035,22 @@ class ProctoredExamApiTests(LoggedInTestCase):
)
self
.
assertIn
(
self
.
exam_time_error_msg
,
rendered_response
)
# test the variant if we are a sample attempt
exam_attempt
.
is_sample_attempt
=
True
exam_attempt
.
save
()
rendered_response
=
get_student_view
(
user_id
=
self
.
user_id
,
course_id
=
self
.
course_id
,
content_id
=
self
.
content_id
,
context
=
{
'is_proctored'
:
True
,
'display_name'
:
self
.
exam_name
,
'default_time_limit_mins'
:
90
}
)
self
.
assertIn
(
self
.
practice_exam_failed_msg
,
rendered_response
)
def
test_get_studentview_unstarted_timed_exam
(
self
):
# pylint: disable=invalid-name
"""
Test for get_student_view Timed exam which is not proctored and has not started yet.
...
...
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