.
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
{% extends 'anatomy/base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="anatomy">
|
||||
<h2>Please enter your CID</h2>
|
||||
<p>CID: <input type="text" name="cid" id="cid-input"></p>
|
||||
<button id="cid-selector-go-button">Go...</button>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
||||
$("#cid-selector-go-button").click(() => {
|
||||
cid = document.getElementById("cid-input").value;
|
||||
window.location = window.location + cid;
|
||||
})
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -16,8 +16,50 @@
|
||||
{% endif %}
|
||||
</li>
|
||||
|
||||
{% if take %}
|
||||
<h1>TAKE</h1>
|
||||
{% if collection.collection_type == "REV" %}
|
||||
<h2>Start: {{exam.name}}</h2>
|
||||
|
||||
Enter your CID and passcode in the below boxes.<br />
|
||||
<p><input id="cid-box" type="text" value="Candidate ID"></p>
|
||||
<p><input id="passcode-box" type="text" value="Passcode"></p>
|
||||
|
||||
<button>Start</button>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
window.location.search.substr(1).split("&").forEach((item) =>
|
||||
{
|
||||
s = item.split("=");
|
||||
if (s[0] == "cid") {
|
||||
$("#cid-box").val(s[1]);
|
||||
|
||||
}
|
||||
if (s[0] == "passcode") {
|
||||
$("#passcode-box").val(s[1]);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$("#cid-box, #passcode-box").keypress(function(e) {
|
||||
// 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 'atlas:collection_case_view_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>
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ urlpatterns = [
|
||||
path("collection/<int:pk>/delete", views.CaseCollectionDelete.as_view(), name="collection_delete"),
|
||||
path("collection/<int:pk>/update", views.CaseCollectionUpdate.as_view(), name="collection_update"),
|
||||
path("collection/<int:pk>", views.collection_detail_view, name="collection_detail_view"),
|
||||
path("collection/<int:pk>/take/<int:cid>/<str:passcode>", views.collection_detail_view_take, name="collection_detail_view_take"),
|
||||
#path("collection/<int:pk>/take/<int:cid>/<str:passcode>", views.collection_detail_view_take, name="collection_detail_view_take"),
|
||||
path("collection/<int:pk>/<int:case_number>", views.collection_case_view, name="collection_case_view"),
|
||||
path("collection/<int:pk>/<int:case_number>/take/<int:cid>/<str:passcode>", views.collection_case_view_take, name="collection_case_view_take"),
|
||||
path("condition/", views.ConditionView.as_view(), name="condition_view"),
|
||||
|
||||
+6
-6
@@ -1050,12 +1050,12 @@ def collection_detail_view(request, pk):
|
||||
request, "atlas/collection_detail_view.html", {"collection": collection}
|
||||
)
|
||||
|
||||
def collection_detail_view_take(request, pk, cid, passcode):
|
||||
collection = get_object_or_404(CaseCollection, pk=pk)
|
||||
|
||||
return render(
|
||||
request, "atlas/collection_detail_view.html", {"collection": collection}
|
||||
)
|
||||
#def collection_detail_view_take(request, pk, cid, passcode):
|
||||
# collection = get_object_or_404(CaseCollection, pk=pk)
|
||||
#
|
||||
# return render(
|
||||
# request, "atlas/collection_detail_view.html", {"collection": collection}
|
||||
# )
|
||||
|
||||
def collection_case_view_take(request, pk, case_number, cid, passcode):
|
||||
return collection_case_view(request, pk, case_number, True, cid, passcode)
|
||||
|
||||
Reference in New Issue
Block a user