Commit baaaafef by Afzal Wali

Separating the views for proctored, practice and timed exams.

Addressed the suggestions

concatenation with format fucntion

Removed some unused context variables for timed exams to reduce complexity.
Made a common context dictionary for Practice and Proctored exams.

Addressing a bug. Added a testcase.

bug fix.

bug fix.

Updated the docstrings.
parent 3c36cc69
...@@ -50,7 +50,7 @@ def start_exam_callback(request, attempt_code): # pylint: disable=unused-argume ...@@ -50,7 +50,7 @@ def start_exam_callback(request, attempt_code): # pylint: disable=unused-argume
mark_exam_attempt_as_ready(attempt['proctored_exam']['id'], attempt['user']['id']) mark_exam_attempt_as_ready(attempt['proctored_exam']['id'], attempt['user']['id'])
template = loader.get_template('proctoring/proctoring_launch_callback.html') template = loader.get_template('proctored_exam/proctoring_launch_callback.html')
poll_url = reverse( poll_url = reverse(
'edx_proctoring.anonymous.proctoring_poll_status', 'edx_proctoring.anonymous.proctoring_poll_status',
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<i class="fa fa-arrow-circle-right start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=true data-start-immediately=false></i> <i class="fa fa-arrow-circle-right start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=true data-start-immediately=false></i>
</button> </button>
</div> </div>
{% include 'proctoring/seq_proctored_exam_footer.html' %} {% include 'proctored_exam/footer.html' %}
<script type="text/javascript"> <script type="text/javascript">
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</a> </a>
</button> </button>
</div> </div>
{% include 'proctoring/seq_proctored_exam_footer.html' %} {% include 'proctored_exam/footer.html' %}
<script type="text/javascript"> <script type="text/javascript">
$('.start-timed-exam').click( $('.start-timed-exam').click(
function(event) { function(event) {
......
"""
We need python think this is a python module
"""
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
</div> </div>
{% include 'proctoring/seq_proctored_exam_footer.html' %} {% include 'proctored_exam/footer.html' %}
<script type="text/javascript"> <script type="text/javascript">
var startProctoredExam = function(selector, exam_id, action_url, start_immediately, attempt_proctored) { var startProctoredExam = function(selector, exam_id, action_url, start_immediately, attempt_proctored) {
......
...@@ -33,4 +33,4 @@ ...@@ -33,4 +33,4 @@
</p> </p>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
{% include 'proctoring/seq_proctored_exam_footer.html' %} {% include 'proctored_exam/footer.html' %}
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</p> </p>
{% endif %} {% endif %}
</div> </div>
{% include 'proctoring/seq_proctored_exam_footer.html' %} {% include 'proctored_exam/footer.html' %}
<script type="text/javascript"> <script type="text/javascript">
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</div> </div>
</div> </div>
</div> </div>
{% include 'proctoring/seq_proctored_exam_footer.html' %} {% include 'proctored_exam/footer.html' %}
<script type="text/javascript"> <script type="text/javascript">
......
...@@ -33,4 +33,4 @@ ...@@ -33,4 +33,4 @@
</p> </p>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
{% include 'proctoring/seq_proctored_exam_footer.html' %} {% include 'proctored_exam/footer.html' %}
...@@ -30,4 +30,4 @@ ...@@ -30,4 +30,4 @@
{% endblocktrans %} {% endblocktrans %}
</p> </p>
</div> </div>
{% include 'proctoring/seq_proctored_exam_footer.html' %} {% include 'proctored_exam/footer.html' %}
...@@ -26,4 +26,4 @@ ...@@ -26,4 +26,4 @@
{% endblocktrans %} {% endblocktrans %}
</p> </p>
</div> </div>
{% include 'proctoring/seq_proctored_exam_footer.html' %} {% include 'proctored_exam/seq_proctored_exam_footer.html' %}
{% load i18n %}
<div class="critical-time sequence proctored-exam entrance" data-exam-id="{{exam_id}}">
<h3>
{% blocktrans %}
You did not complete the exam in the allotted time
{% endblocktrans %}
</h3>
<p>
{% blocktrans %}
You are not eligible to receive credit for this exam because you did not submit
your exam responses before time expired. Other work that you have completed in this
course contributes to your final grade. See the <a href="{{progress_page_url}}">Progress page</a>
for your current grade in the course.
{% endblocktrans %}
</p>
<div class="proctored-exam-message">
<p>
{% blocktrans %}
Other work that you have completed in this course contributes to your final grade.
{% endblocktrans %}
</p>
</div>
</div>
{% include 'proctoring/seq_timed_exam_footer.html' %}
"""
We need python think this is a python module
"""
...@@ -12,16 +12,16 @@ ...@@ -12,16 +12,16 @@
</strong> </strong>
{% trans "As soon as you indicate that you are ready to start the exam, you will have "%} {{total_time|lower}} {% trans " to complete the exam." %} {% trans "As soon as you indicate that you are ready to start the exam, you will have "%} {{total_time|lower}} {% trans " to complete the exam." %}
</p> </p>
<div class="gated-sequence"> <button class="gated-sequence start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}">
<a class='start-timed-exam' data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}"> <a>
{% blocktrans %} {% blocktrans %}
I'm ready! Start this timed exam. I'm ready! Start this timed exam.
{% endblocktrans %} {% endblocktrans %}
<i class="fa fa-arrow-circle-right"></i> <i class="fa fa-arrow-circle-right"></i>
</a> </a>
</div> </button>
</div> </div>
{% include 'proctoring/seq_timed_exam_footer.html' %} {% include 'timed_exam/footer.html' %}
<script type="text/javascript"> <script type="text/javascript">
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="sequence timed-exam completed" data-exam-id="{{exam_id}}"> <div class="sequence timed-exam completed" data-exam-id="{{exam_id}}">
<h3> <h3>
{% blocktrans %} {% blocktrans %}
This is the end of your timed exam Are you sure you want to end your timed exam?
{% endblocktrans %} {% endblocktrans %}
</h3> </h3>
<p> <p>
...@@ -11,11 +11,22 @@ ...@@ -11,11 +11,22 @@
and your worked will then be graded. and your worked will then be graded.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
<button type="button" name="submit-timed-exam" class="exam-action-button" data-action="submit" data-exam-id="{{exam_id}}" data-change-state-url="{{change_state_url}}" > <div>
<button type="button" name="submit-proctored-exam" class="exam-action-button" data-action="submit" data-exam-id="{{exam_id}}" data-change-state-url="{{change_state_url}}">
{% blocktrans %} {% blocktrans %}
I'm ready! Submit my answers and end my timed exam Yes, end my timed exam
{% endblocktrans %} {% endblocktrans %}
</button> </button>
</div>
{% if does_time_remain %}
<div>
<button type="button" name="goback-proctored-exam" class="exam-action-button" data-action="start" data-exam-id="{{exam_id}}" data-change-state-url="{{change_state_url}}">
{% blocktrans %}
No, I'd like to continue working
{% endblocktrans %}
</button>
</div>
{% endif %}
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$('.exam-action-button').click( $('.exam-action-button').click(
......
{% load i18n %}
<div class="sequence proctored-exam completed" data-exam-id="{{exam_id}}">
<h3>
{% blocktrans %}
You have submitted your timed exam
{% endblocktrans %}
</h3>
<h4>
{% blocktrans %}
Your timed exam status: <b> Completed </b>
{% endblocktrans %}
</h4>
<hr>
<p>
{% blocktrans %}
As you have submitted your exam, you will not be able to re-enter it. Your grades for this timed exam will be immediately available on the <a href="{{progress_page_url}}">Progress</a> page.
{% endblocktrans %}
</p>
</div>
...@@ -300,8 +300,6 @@ class StudentProctoredExamAttempt(AuthenticatedAPIView): ...@@ -300,8 +300,6 @@ class StudentProctoredExamAttempt(AuthenticatedAPIView):
remaining_time=humanized_time(int(round(time_remaining_seconds / 60.0, 0))) remaining_time=humanized_time(int(round(time_remaining_seconds / 60.0, 0)))
) )
print attempt['accessibility_time_string']
return Response( return Response(
data=attempt, data=attempt,
status=status.HTTP_200_OK status=status.HTTP_200_OK
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment