.
This commit is contained in:
@@ -1,58 +1,57 @@
|
|||||||
{% extends 'rapids/base.html' %}
|
{% extends 'rapids/base.html' %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="question-display-block">
|
<div class="question-display-block">
|
||||||
<div class="hide-show">HIDE/SHOW</div>
|
<div class="hide-show">HIDE/SHOW</div>
|
||||||
<div class="inner-display-block">
|
<div class="inner-display-block">
|
||||||
Question <span class="question-number">1</span>
|
Question <span class="question-number">1</span>
|
||||||
<div id="single-dicom-viewer" class="dicom-viewer" data-images="" data-annotations=''>
|
<div id="single-dicom-viewer" class="dicom-viewer" data-images="" data-annotations=''>
|
||||||
|
</div>
|
||||||
|
<div class="answers">Answers: </div>
|
||||||
</div>
|
</div>
|
||||||
<div class="answers">Answers: </div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="rapids">
|
||||||
<div class="rapids">
|
<h2>Exam: {{ exam.name }}</h2>
|
||||||
<h2>Exam: {{ exam.name }}</h2>
|
<h3>Candidate: {{ cid }}</h3>
|
||||||
<h3>Candidate: {{ cid }}</h3>
|
Answers:
|
||||||
Answers:
|
<ul class="score-answer-list">{% for ans, score, correct_answer in answers_and_marks %}
|
||||||
<ul class="score-answer-list">{% for ans, score, correct_answer in answers_and_marks %}
|
<li class="user-answer-li">Question {{forloop.counter}} - Correct answer: <span class="correct-answer">{{ correct_answer }}</span></li>
|
||||||
<li class="user-answer-li">Question {{forloop.counter}} - Correct answer: <span class="correct-answer">{{
|
<span class="user-answer-score user-answer-score-{{score}} rapid-ans">
|
||||||
correct_answer }}</span></li>
|
<pre>{{ans}}</pre> ({{score}})
|
||||||
<span class="user-answer-score user-answer-score-{{score}} rapid-ans">
|
</span>
|
||||||
<pre>{{ans}}</pre> ({{score}})
|
<span class="view-question-link" data-qn={{forloop.counter0}}>View</span>
|
||||||
</span>
|
|
||||||
<span class="view-question-link" data-qn={{forloop.counter0}}>View</span>
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
<br /> Total mark: {{ total_score }} / {{max_score}}
|
<br /> Total mark: {{ total_score }} / {{max_score}}
|
||||||
<br /> Normalised score: {{ normalised_score }}
|
<br /> Normalised score: {{ normalised_score }}
|
||||||
<div>
|
<div>
|
||||||
<a href="{% url 'cid_scores' cid passcode %}">Other exams</a>
|
<a href="{% url 'cid_scores' cid passcode %}">Other exams</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block js %}
|
{% block js %}
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$(".hide-show").click((evt, el) => {
|
$(".hide-show").click((evt, el) => {
|
||||||
$(".inner-display-block").toggle();
|
$(".inner-display-block").toggle();
|
||||||
})
|
|
||||||
|
|
||||||
$(".view-question-link").on("click", function (e) {
|
|
||||||
console.log("click", e)
|
|
||||||
question_number = e.currentTarget.dataset.qn;
|
|
||||||
$("#single-dicom-viewer").empty();
|
|
||||||
$.ajax({
|
|
||||||
url: `{% url 'rapids:question_review' pk=exam.pk %}`,
|
|
||||||
data: {
|
|
||||||
csrfmiddlewaretoken: "{{ csrf_token }}",
|
|
||||||
question_number: question_number
|
|
||||||
},
|
|
||||||
type: "POST",
|
|
||||||
dataType: "json",
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$(".view-question-link").on("click", function (e) {
|
||||||
|
console.log("click", e)
|
||||||
|
question_number = e.currentTarget.dataset.qn;
|
||||||
|
$("#single-dicom-viewer").empty();
|
||||||
|
$.ajax({
|
||||||
|
url: `{% url 'rapids:question_review' pk=exam.pk %}`,
|
||||||
|
data: {
|
||||||
|
csrfmiddlewaretoken: "{{ csrf_token }}",
|
||||||
|
question_number: question_number
|
||||||
|
},
|
||||||
|
type: "POST",
|
||||||
|
dataType: "json",
|
||||||
|
})
|
||||||
// $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly
|
// $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly
|
||||||
.done(function (data) {
|
.done(function (data) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
|
||||||
let event = new CustomEvent('loadDicomViewerUrls', {
|
let event = new CustomEvent('loadDicomViewerUrls', {
|
||||||
@@ -67,13 +66,13 @@
|
|||||||
// For eg. A message box showing that the status has been changed
|
// For eg. A message box showing that the status has been changed
|
||||||
$(".inner-display-block").show();
|
$(".inner-display-block").show();
|
||||||
})
|
})
|
||||||
.always(function () {
|
.always(function () {
|
||||||
console.log('[Done]');
|
console.log('[Done]');
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
$(".view-question-link").first().click();
|
$(".view-question-link").first().click();
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user