more fixes
This commit is contained in:
@@ -116,7 +116,6 @@ button a {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.marking-list {
|
.marking-list {
|
||||||
float: right;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.save {
|
.save {
|
||||||
@@ -147,12 +146,13 @@ button a {
|
|||||||
|
|
||||||
#dicom-image {
|
#dicom-image {
|
||||||
width: 60%;
|
width: 60%;
|
||||||
float: left;
|
position: fixed;
|
||||||
|
right: 0px;
|
||||||
height: 600px;
|
height: 600px;
|
||||||
|
bottom: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.marking {
|
.marking {
|
||||||
float: right;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#question-mark-list {
|
#question-mark-list {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<h2>Marking question {{question_details.current}} of {{question_details.total}}</h2>
|
<h2>Marking question {{question_details.current}} of {{question_details.total}}</h2>
|
||||||
<a href="{% url 'anatomy:anatomy_question_update' question.id %}" title="Edit the Question">Edit</a> <a href="{% url 'admin:anatomy_anatomyquestion_change' question.id %}" title="Edit the Question using the admin interface">Admin Edit</a>
|
<a href="{% url 'anatomy:anatomy_question_update' question.id %}" title="Edit the Question">Edit</a> <a href="{% url 'admin:anatomy_anatomyquestion_change' question.id %}" title="Edit the Question using the admin interface">Admin Edit</a>
|
||||||
<p>{{ question.question_type }}</p>
|
<h3>{{ question.question_type }}</h3>
|
||||||
|
|
||||||
<div id="dicom-image" data-url="{{ question.image.url}}" data-annotations='{{question.image_annotations}}'>
|
<div id="dicom-image" data-url="{{ question.image.url}}" data-annotations='{{question.image_annotations}}'>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -25,6 +25,10 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<p>Active exams will be available to take at the below url:
|
||||||
|
<a href="{% url 'physics:active_exams' %}">Available exams</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -5,13 +5,25 @@
|
|||||||
<div class="physics">
|
<div class="physics">
|
||||||
<h1>Exam: {{ exam.name }}</h1>
|
<h1>Exam: {{ exam.name }}</h1>
|
||||||
|
|
||||||
|
<div class="alert alert-info" role="alert">
|
||||||
|
<h3>Instructions</h3>
|
||||||
|
<p>
|
||||||
|
Please make sure you submit answers before closing or navigating from this page (as otherwise they will not
|
||||||
|
be saved). The submit button is at the bottom of the page.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Click on a question to toggle between true / false.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Ensure your candidate number is entered in the below box.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
Candidate number: <input type="number" id="cid" name="cid" title="please enter your candidate number">
|
Candidate number: <input type="number" id="cid" name="cid" title="please enter your candidate number">
|
||||||
</div>
|
</div>
|
||||||
<p>
|
|
||||||
Please make sure you submit answers before closing or navigating from this page (as otherwise they will not be
|
<h2>Questions</h2>
|
||||||
saved)
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{% autoescape off %}
|
{% autoescape off %}
|
||||||
<ol id="full-question-list-physics">
|
<ol id="full-question-list-physics">
|
||||||
@@ -22,31 +34,36 @@
|
|||||||
<ol type="a" class="abcde">
|
<ol type="a" class="abcde">
|
||||||
<li>
|
<li>
|
||||||
<span class="question-text">{{ question.a }}:</span> <label class="truefalse-switch"> <input
|
<span class="question-text">{{ question.a }}:</span> <label class="truefalse-switch"> <input
|
||||||
type="checkbox" class="question a" id="{{question.pk}}-a-checkbox" data-q="{{question.pk}}" data-a="a">
|
type="checkbox" class="question a" id="{{question.pk}}-a-checkbox" data-q="{{question.pk}}"
|
||||||
|
data-a="a">
|
||||||
<div class="slider round a"></div>
|
<div class="slider round a"></div>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<span class="question-text">{{ question.b }}:</span> <label class="truefalse-switch"> <input
|
<span class="question-text">{{ question.b }}:</span> <label class="truefalse-switch"> <input
|
||||||
type="checkbox" class="question b" id="{{question.pk}}-b-checkbox" data-q="{{question.pk}}" data-a="b">
|
type="checkbox" class="question b" id="{{question.pk}}-b-checkbox" data-q="{{question.pk}}"
|
||||||
|
data-a="b">
|
||||||
<div class="slider round b"></div>
|
<div class="slider round b"></div>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<span class="question-text">{{ question.c }}:</span> <label class="truefalse-switch"> <input
|
<span class="question-text">{{ question.c }}:</span> <label class="truefalse-switch"> <input
|
||||||
type="checkbox" class="question c" id="{{question.pk}}-c-checkbox" data-q="{{question.pk}}" data-a="c">
|
type="checkbox" class="question c" id="{{question.pk}}-c-checkbox" data-q="{{question.pk}}"
|
||||||
|
data-a="c">
|
||||||
<div class="slider round c"></div>
|
<div class="slider round c"></div>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<span class="question-text">{{ question.d }}:</span> <label class="truefalse-switch"> <input
|
<span class="question-text">{{ question.d }}:</span> <label class="truefalse-switch"> <input
|
||||||
type="checkbox" class="question d" id="{{question.pk}}-d-checkbox" data-q="{{question.pk}}" data-a="d">
|
type="checkbox" class="question d" id="{{question.pk}}-d-checkbox" data-q="{{question.pk}}"
|
||||||
|
data-a="d">
|
||||||
<div class="slider round d"></div>
|
<div class="slider round d"></div>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<span class="question-text">{{ question.e }}:</span> <label class="truefalse-switch"> <input
|
<span class="question-text">{{ question.e }}:</span> <label class="truefalse-switch"> <input
|
||||||
type="checkbox" class="question e" id="{{question.pk}}-e-checkbox" data-q="{{question.pk}}" data-a="e">
|
type="checkbox" class="question e" id="{{question.pk}}-e-checkbox" data-q="{{question.pk}}"
|
||||||
|
data-a="e">
|
||||||
<div class="slider round e"></div>
|
<div class="slider round e"></div>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
@@ -71,7 +88,7 @@
|
|||||||
$(evt.target).parent().find("input").click();
|
$(evt.target).parent().find("input").click();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#submit").click(() =>{
|
$("#submit").click(() => {
|
||||||
let cid = $("#cid").val()
|
let cid = $("#cid").val()
|
||||||
if (cid == "") {
|
if (cid == "") {
|
||||||
alert("You need to enter a valid candidate number.");
|
alert("You need to enter a valid candidate number.");
|
||||||
@@ -106,31 +123,31 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function postAnswers(ans) {
|
function postAnswers(ans) {
|
||||||
console.log(ans);
|
console.log(ans);
|
||||||
$.post("{% url 'physics:exam_answers_submit' %}", JSON.stringify(ans)).done((data) => {
|
$.post("{% url 'physics:exam_answers_submit' %}", JSON.stringify(ans)).done((data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
let ret = confirm(
|
let ret = confirm(
|
||||||
`Answers sucessfully submitted. Click OK to finish the exam.`
|
`Answers sucessfully submitted. Click OK to finish the exam.`
|
||||||
);
|
);
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
//window.saveSession();
|
//window.saveSession();
|
||||||
$("#exams-button-link").remove();
|
$("#exams-button-link").remove();
|
||||||
$("#submit").after('<button id="exams-button-link">Return to exam list</button>');
|
$("#submit").after('<button id="exams-button-link">Return to exam list</button>');
|
||||||
$("#exams-button-link").click(() => {
|
$("#exams-button-link").click(() => {
|
||||||
window.location.href = "{% url 'physics:active_exams' %}";
|
window.location.href = "{% url 'physics:active_exams' %}";
|
||||||
})
|
})
|
||||||
window.answers_submitted = true;
|
window.answers_submitted = true;
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
alert(`Error submitting answers: ${data.error}`);
|
alert(`Error submitting answers: ${data.error}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// $.post( "http://localhost:8000/submit_answers", JSON.stringify(ans));
|
||||||
}
|
}
|
||||||
});
|
|
||||||
// $.post( "http://localhost:8000/submit_answers", JSON.stringify(ans));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -2,13 +2,22 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="">
|
<div class="">
|
||||||
<h2>Please enter your CID</h2>
|
<h2>Score / Results checker</h2>
|
||||||
|
<p>Please enter your CID</p>
|
||||||
<p>CID: <input type="text" name="cid" id="cid-input"></p>
|
<p>CID: <input type="text" name="cid" id="cid-input"></p>
|
||||||
<button id="cid-selector-go-button">Go...</button>
|
<button id="cid-selector-go-button">Go...</button>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
||||||
|
$("#cid-input").keypress(function(e) {
|
||||||
|
// Enter pressed?
|
||||||
|
console.log(e)
|
||||||
|
if(e.which == 10 || e.which == 13) {
|
||||||
|
$("#cid-selector-go-button").click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$("#cid-selector-go-button").click(() => {
|
$("#cid-selector-go-button").click(() => {
|
||||||
cid = document.getElementById("cid-input").value;
|
cid = document.getElementById("cid-input").value;
|
||||||
window.location = window.location + cid;
|
window.location = window.location + cid;
|
||||||
|
|||||||
Reference in New Issue
Block a user