Commit a30fcbe9 by chrisndodge

Merge pull request #84 from edx/muhhshoaib/PHX-104-PHX-105-bugs

Bugs reported by kashif
parents d0e6a50e 0486918a
...@@ -59,11 +59,13 @@ ...@@ -59,11 +59,13 @@
rules for online proctoring. rules for online proctoring.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
{% if not is_sample_attempt %}
<p class="proctored-exam-instruction"> <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 "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." %} {% trans "Take this exam as an open exam instead." %}
</a> </a>
</p> </p>
{% endif %}
</div> </div>
{% include 'proctoring/seq_proctored_exam_footer.html' %} {% include 'proctoring/seq_proctored_exam_footer.html' %}
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
var action_url = $(this).data('change-state-url'); var action_url = $(this).data('change-state-url');
var exam_id = $(this).data('exam-id'); var exam_id = $(this).data('exam-id');
var action = $(this).data('action') var action = $(this).data('action');
// Update the state of the attempt // Update the state of the attempt
$.ajax({ $.ajax({
......
...@@ -11,9 +11,35 @@ ...@@ -11,9 +11,35 @@
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" > <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 %} {% blocktrans %}
I'm ready! Submit my answers and end my timed exam I'm ready! Submit my answers and end my timed exam
{% endblocktrans %} {% endblocktrans %}
</button> </button>
</div> </div>
<script type="text/javascript">
$('.exam-action-button').click(
function(event) {
// cancel any warning messages to end user about leaving timed 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