.
This commit is contained in:
+66
-66
@@ -1,67 +1,67 @@
|
|||||||
{% extends 'atlas/base.html' %}
|
{% extends 'atlas/base.html' %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if request.user.is_authenticated %}
|
{% if request.user.is_authenticated %}
|
||||||
<div class="floating-header">
|
<div class="floating-header">
|
||||||
<a href="{% url 'atlas:collection_update' pk=collection.pk %}" title="Edit the Collection">Edit</a>
|
<a href="{% url 'atlas:collection_update' pk=collection.pk %}" title="Edit the Collection">Edit</a>
|
||||||
<a href="{% url 'atlas:collection_delete' pk=collection.pk %}" title="Delete the Collection">Delete</a>
|
<a href="{% url 'atlas:collection_delete' pk=collection.pk %}" title="Delete the Collection">Delete</a>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<h2>{{collection.name}}
|
<h2>{{collection.name}}
|
||||||
<ul>
|
<ul>
|
||||||
{% for case in collection.cases.all %}
|
{% for case in collection.cases.all %}
|
||||||
<li>{% if collection.collection_type == "REV" %}<a href="{% url 'atlas:collection_case_view' pk=collection.pk case_number=forloop.counter0 %}">Case {{forloop.counter}}</a>{% else %}Case {{forloop.counter}}{% endif %}
|
<li>{% if collection.collection_type == "REV" %}<a href="{% url 'atlas:collection_case_view' pk=collection.pk case_number=forloop.counter0 %}">Case {{forloop.counter}}</a>{% else %}Case {{forloop.counter}}{% endif %}
|
||||||
{% if collection.show_title %}
|
{% if collection.show_title %}
|
||||||
: {{case.title}}
|
: {{case.title}}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% if collection.collection_type == "REP" %}
|
{% if collection.collection_type == "REP" %}
|
||||||
<h2>Start: {{exam.name}}</h2>
|
<h2>Start: {{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</button>
|
<button>Start</button>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
window.location.search.substr(1).split("&").forEach((item) =>
|
window.location.search.substr(1).split("&").forEach((item) =>
|
||||||
{
|
{
|
||||||
s = item.split("=");
|
s = item.split("=");
|
||||||
if (s[0] == "cid") {
|
if (s[0] == "cid") {
|
||||||
$("#cid-box").val(s[1]);
|
$("#cid-box").val(s[1]);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (s[0] == "passcode") {
|
if (s[0] == "passcode") {
|
||||||
$("#passcode-box").val(s[1]);
|
$("#passcode-box").val(s[1]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$("#cid-box, #passcode-box").keypress(function(e) {
|
$("#cid-box, #passcode-box").keypress(function(e) {
|
||||||
// Enter pressed?
|
// Enter pressed?
|
||||||
console.log(e)
|
console.log(e)
|
||||||
if(e.which == 10 || e.which == 13) {
|
if(e.which == 10 || e.which == 13) {
|
||||||
$("button").click();
|
$("button").click();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("button").click(() => {
|
$("button").click(() => {
|
||||||
let cid = $("#cid-box").val();
|
let cid = $("#cid-box").val();
|
||||||
let passcode = $("#passcode-box").val();
|
let passcode = $("#passcode-box").val();
|
||||||
|
|
||||||
if (Number.isInteger(parseInt(cid))) {
|
if (Number.isInteger(parseInt(cid))) {
|
||||||
window.location.replace("{% url 'atlas:collection_case_view_take' pk=collection.pk case_number=0 cid='0000000' passcode='ZZZZZZ' %}".replace("0000000", cid).replace("ZZZZZZ", passcode));
|
window.location.replace("{% url 'atlas:collection_case_view_take' pk=collection.pk case_number=0 cid='0000000' passcode='ZZZZZZ' %}".replace("0000000", cid).replace("ZZZZZZ", passcode));
|
||||||
} else {
|
} else {
|
||||||
alert("Please enter a valid Candidate ID (CID).")
|
alert("Please enter a valid Candidate ID (CID).")
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user