Commit 7f85bd46 by Muhammad Shoaib

Bugs reported by kashif

- PHX 104 User should not be able to to turn practice course into an open exam
- PHX 105 Timed Exam - The submit button at the end of timed exam does not work
parent 0829961b
......@@ -59,11 +59,13 @@
rules for online proctoring.
{% endblocktrans %}
</p>
{% if not is_sample_attempt %}
<p class="proctored-exam-instruction">
{% trans "Don't want to take this exam with online proctoring?" %}<a class="proctored-decline-exam" href='#' data-action="decline" data-exam-id="{{exam_id}}" data-change-state-url="{{change_state_url}}">
{% trans "Take this exam as an open exam instead." %}
</a>
</p>
{% endif %}
</div>
{% include 'proctoring/seq_proctored_exam_footer.html' %}
......
......@@ -38,7 +38,7 @@
var action_url = $(this).data('change-state-url');
var exam_id = $(this).data('exam-id');
var action = $(this).data('action')
var action = $(this).data('action');
// Update the state of the attempt
$.ajax({
......
......@@ -11,9 +11,35 @@
and your worked will then be graded.
{% endblocktrans %}
</p>
<button type="button" name="submit-timed-exam" >
<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}}" >
{% blocktrans %}
I'm ready! Submit my answers and end my timed exam
{% endblocktrans %}
</button>
</div>
<script type="text/javascript">
$('.exam-action-button').click(
function(event) {
// cancel any warning messages to end user about leaving proctored exam
$(window).unbind('beforeunload');
var action_url = $(this).data('change-state-url');
var exam_id = $(this).data('exam-id');
var action = $(this).data('action');
// Update the state of the attempt
$.ajax({
url: action_url,
type: 'PUT',
data: {
action: action
},
success: function() {
// Reloading page will reflect the new state of the attempt
location.reload();
}
});
}
);
</script>
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