.
This commit is contained in:
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h2>Start exam: {{exam.name}}</h2>
|
<h2>Start exam: {{exam.name}}</h2>
|
||||||
|
|
||||||
Enter your CID and passcode in the below boxes.<br />
|
Enter your CID and passcode in the below boxes.<br />
|
||||||
<p><input id="cid-box" type="text" value="Candidate ID"></p>
|
<p><input id="cid-box" type="text" value="Candidate ID"></p>
|
||||||
<p><input id="passcode-box" type="text" value="Passcode"></p>
|
<p><input id="passcode-box" type="text" value="Passcode"></p>
|
||||||
|
|
||||||
<button>Start exam</button>
|
<button>Start exam</button>
|
||||||
|
|
||||||
@@ -32,4 +32,4 @@ Enter your CID and passcode in the below boxes.<br />
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ CID: {{cid}}
|
|||||||
{{answer_count}} out of {{exam_length}} questions answered. Click to go to question.
|
{{answer_count}} out of {{exam_length}} questions answered. Click to go to question.
|
||||||
<div class="sba-finish-list">
|
<div class="sba-finish-list">
|
||||||
{% for question, answer in question_answer_tuples %}
|
{% for question, answer in question_answer_tuples %}
|
||||||
<a href="{% url 'sbas:exam_take' pk=exam.id sk=forloop.counter0 cid=cid %}"><button {% if not answer %}class="unanswered"{% endif %}>{{forloop.counter}}: {{answer.answer}}</button></a>
|
<a href="{% url 'sbas:exam_take' pk=exam.id sk=forloop.counter0 cid=cid passcode=passcode %}"><button {% if not answer %}class="unanswered"{% endif %}>{{forloop.counter}}: {{answer.answer}}</button></a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,6 @@
|
|||||||
{% if exam.publish_results %}checked{% endif %}> <span class="help-text">[When checked the exam results will
|
{% if exam.publish_results %}checked{% endif %}> <span class="help-text">[When checked the exam results will
|
||||||
be available on this site]</span>
|
be available on this site]</span>
|
||||||
</div>
|
</div>
|
||||||
<!--<p><button><a href="{% url 'anatomy:exam_take' pk=exam.pk sk=0 %}">Click here to start</a></button></p>-->
|
|
||||||
This exam will be available to take <a href="{% url 'sbas:exam_start' pk=exam.pk %}">here</a> (when active).
|
This exam will be available to take <a href="{% url 'sbas:exam_start' pk=exam.pk %}">here</a> (when active).
|
||||||
|
|
||||||
{% autoescape off %}
|
{% autoescape off %}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
Answers:
|
Answers:
|
||||||
<ul>
|
<ul>
|
||||||
{% for question, a, score, correct_answer in answers_and_marks %}
|
{% for question, a, score, correct_answer in answers_and_marks %}
|
||||||
<li class="user-answer-li"><a href="{% url 'sbas:exam_take' exam.pk forloop.counter0 cid %}">Question
|
<li class="user-answer-li"><a href="{% url 'sbas:exam_take' exam.pk forloop.counter0 cid passcode %}">Question
|
||||||
{{forloop.counter}}</a> - {{ question.stem |safe}}</li>
|
{{forloop.counter}}</a> - {{ question.stem |safe}}</li>
|
||||||
<span>Correct answer: {{correct_answer|safe}} <br />{{a}} <span class="answer-{{score}}">(Score:
|
<span>Correct answer: {{correct_answer|safe}} <br />{{a}} <span class="answer-{{score}}">(Score:
|
||||||
{{score}})</span></span>
|
{{score}})</span></span>
|
||||||
|
|||||||
@@ -2,24 +2,34 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h2>{{exam.name}}</h2>
|
<h2>Start exam: {{exam.name}}</h2>
|
||||||
|
|
||||||
Enter your CID in the below box.<br />
|
Enter your CID and passcode in the below boxes.<br />
|
||||||
<input id="cid-box" type="text" value="Candidate ID">
|
<p><input id="cid-box" type="text" value="Candidate ID"></p>
|
||||||
|
<p><input id="passcode-box" type="text" value="Passcode"></p>
|
||||||
<button>Start exam</button>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<button>Start exam</button>
|
||||||
$(document).ready(function () {
|
|
||||||
$("button").click(() => {
|
|
||||||
let cid = $("#cid-box").val();
|
|
||||||
|
|
||||||
if (Number.isInteger(parseInt(cid))) {
|
<script type="text/javascript">
|
||||||
window.location.replace("{% url 'sbas:exam_take' pk=exam.pk sk=0 cid='0000000' %}".replace("0000000", cid));
|
$(document).ready(function () {
|
||||||
} else {
|
$("#cid-box, #passcode-box").keypress(function(e) {
|
||||||
alert("Please enter a valid Candidate ID (CID).")
|
// Enter pressed?
|
||||||
}
|
console.log(e)
|
||||||
|
if(e.which == 10 || e.which == 13) {
|
||||||
|
$("button").click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$("button").click(() => {
|
||||||
|
let cid = $("#cid-box").val();
|
||||||
|
let passcode = $("#passcode-box").val();
|
||||||
|
|
||||||
|
if (Number.isInteger(parseInt(cid))) {
|
||||||
|
window.location.replace("{% url 'sbas:exam_take' pk=exam.pk sk=0 cid='0000000' passcode='ZZZZZZ' %}".replace("0000000", cid).replace("ZZZZZZ", passcode));
|
||||||
|
} else {
|
||||||
|
alert("Please enter a valid Candidate ID (CID).")
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
</script>
|
||||||
</script>
|
{% endblock %}
|
||||||
{% endblock %}
|
|
||||||
Reference in New Issue
Block a user