{% load i18n %}
<div class="sequence proctored-exam completed" data-exam-id="{{exam_id}}">
  <h3>
    {% blocktrans %}
      Are you sure you want to end your proctored exam?
    {% endblocktrans %}
  </h3>
  <p>
    {% blocktrans %}
      Make sure that you have selected "Submit" for each problem before you submit your exam.
    {% endblocktrans %}
  </p>
  <p>
    {% blocktrans %}
      After you submit your exam, your responses are graded and your proctoring session is reviewed.
    {% endblocktrans %}
  </p>
  <button type="button" name="submit-proctored-exam" class="exam-action-button btn btn-pl-primary btn-base" data-action="submit" data-exam-id="{{exam_id}}" data-change-state-url="{{change_state_url}}">
    {% blocktrans %}
      Yes, end my proctored exam
    {% endblocktrans %}
  </button>
  {% if does_time_remain %}
    <button type="button" name="goback-proctored-exam" class="exam-action-button btn btn-secondary btn-base" data-action="start" data-exam-id="{{exam_id}}" data-change-state-url="{{change_state_url}}" style="box-shadow: none">
      {% blocktrans %}
        No, I'd like to continue working
      {% endblocktrans %}
    </button>
  {% endif %}
</div>
<script type="text/javascript">
  var edx = edx || {};
  edx.courseware = edx.courseware || {};
  edx.courseware.proctored_exam = edx.courseware.proctored_exam || {};
  edx.courseware.proctored_exam.configuredWorkerURL = "{{ backend_js_bundle }}";

  $('.exam-action-button').click(
      edx.courseware.proctored_exam.examEndHandler
  );
</script>
