{% load i18n %}
<div class="sequence proctored-exam success-left-bar instructions" data-exam-id="{{exam_id}}" data-exam-started-poll-url="{{exam_started_poll_url}}">
  <div>
    <h3>
    {% blocktrans %}
      Important
    {% endblocktrans %}
    </h3>
    <p>
      {% blocktrans %}
        &#8226; You have {{ total_time }} to complete this exam. </br>
        &#8226; Once you start the exam, you cannot stop the timer. </br>
        &#8226; For all question types, you must click "submit" to complete your answer. </br>
        &#8226; If time expires before you click "End My Exam", only your submitted answers will be graded.
      {% endblocktrans %}</br>
    </p>
    <h3>
    {% blocktrans %}
      Proctored Exam Rules
    {% endblocktrans %}
    </h3>
    <p>
      {% blocktrans %}
         You must adhere to the following rules while you complete this exam.
         <strong>If you violate these rules, you will receive a score of 0 on the exam, and you will not be eligible for academic course credit.
         </strong></br>
      {% endblocktrans %}
        <a href="{{link_urls.online_proctoring_rules}}" target="_blank">
      {% blocktrans %}
          {{ platform_name }} Rules for Online Proctored Exams
      {% endblocktrans %}
        </a> </br>
    </p>
    {% if exam_review_policy %}
    <h3>
    {% blocktrans %}
      Additional Exam Rules
    {% endblocktrans %}
    </h3>
    <p>
      {% blocktrans %}
        The following additional rules apply to this exam. These rules take precedence over the Rules for Online Proctored Exams.</br> </br>

        {{ exam_review_policy }} </br>
      {% endblocktrans %}
    </p>
    {% endif %}
    <div>
      {% trans "Start my exam" as start_exam %}
      <button type="button" class="exam-action-button proctored-enter-exam btn btn-pl-primary btn-base" data-action="start" data-exam-id="{{exam_id}}" data-change-state-url="{{change_state_url}}" data-loading-text="<span class='fa fa-circle-o-notch fa-spin'></span> {% trans 'Starting Exam' %}" data-cta-text="{{ start_exam }}">
        {{ start_exam }}
      </button>
    </div>
  </div>
</div>
{% include 'proctored_exam/error_modal.html' %}
{% include 'proctored_exam/footer.html' %}

<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 }}";


  $('.proctored-enter-exam').click(
      edx.courseware.proctored_exam.examStartHandler
  );
</script>
