.
This commit is contained in:
@@ -1,62 +1,62 @@
|
||||
{% extends 'rapids/base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="question-display-block">
|
||||
<div class="hide-show">HIDE/SHOW</div>
|
||||
<div class="inner-display-block">
|
||||
Question <span class="question-number">1</span>
|
||||
<div id="single-dicom-viewer" class="dicom-viewer" data-images="" data-annotations=''>
|
||||
</div>
|
||||
<div class="answers">Answers: </div>
|
||||
<div class="question-display-block">
|
||||
<div class="hide-show">HIDE/SHOW</div>
|
||||
<div class="inner-display-block">
|
||||
Question <span class="question-number">1</span>
|
||||
<div id="single-dicom-viewer" class="dicom-viewer" data-images="" data-annotations=''>
|
||||
</div>
|
||||
<div class="answers">Answers: </div>
|
||||
</div>
|
||||
<div class="rapids">
|
||||
<h2>Exam: {{ exam.name }}</h2>
|
||||
<h3>Candidate: {{ cid }}</h3>
|
||||
Answers:
|
||||
<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>
|
||||
<span class="user-answer-score user-answer-score-{{score}} rapid-ans">
|
||||
<pre>{{ans}}</pre> ({{score}})
|
||||
</span>
|
||||
<span class="view-question-link" data-qn={{forloop.counter0}}>View</span>
|
||||
</div>
|
||||
<div class="rapids">
|
||||
<h2>Exam: {{ exam.name }}</h2>
|
||||
<h3>Candidate: {{ cid }}</h3>
|
||||
Answers:
|
||||
<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>
|
||||
<span class="user-answer-score user-answer-score-{{score}} rapid-ans">
|
||||
<pre>{{ans}}</pre> ({{score}})
|
||||
</span>
|
||||
<span class="view-question-link" data-qn={{forloop.counter0}}>View</span>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<br /> Total mark: {{ total_score }} / {{max_score}}
|
||||
<br /> Normalised score: {{ normalised_score }}
|
||||
<div>
|
||||
<a href="{% url 'cid_scores' cid %}">Other exams</a>
|
||||
</div>
|
||||
</ul>
|
||||
<br /> Total mark: {{ total_score }} / {{max_score}}
|
||||
<br /> Normalised score: {{ normalised_score }}
|
||||
<div>
|
||||
<a href="{% url 'cid_scores' cid passcode %}">Other exams</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block js %}
|
||||
<script>
|
||||
<script>
|
||||
|
||||
$(document).ready(function () {
|
||||
$(".hide-show").click((evt, el) => {
|
||||
$(".inner-display-block").toggle();
|
||||
$(document).ready(function () {
|
||||
$(".hide-show").click((evt, el) => {
|
||||
$(".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
|
||||
.done(function (data) {
|
||||
.done(function (data) {
|
||||
console.log(data);
|
||||
|
||||
let event = new CustomEvent('loadDicomViewerUrls', {
|
||||
"detail": {"images" : data.images, "annotations" : data.annotations}
|
||||
"detail": { "images": data.images, "annotations": data.annotations }
|
||||
});
|
||||
|
||||
window.dispatchEvent(event);
|
||||
@@ -67,13 +67,13 @@
|
||||
// For eg. A message box showing that the status has been changed
|
||||
$(".inner-display-block").show();
|
||||
})
|
||||
.always(function () {
|
||||
.always(function () {
|
||||
console.log('[Done]');
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
$(".view-question-link").first().click();
|
||||
$(".view-question-link").first().click();
|
||||
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
+1
-1
@@ -76,7 +76,7 @@ urlpatterns = [
|
||||
name="exam_scores_cid",
|
||||
),
|
||||
path(
|
||||
"exam/<int:pk>/scores/<int:cid>/",
|
||||
"exam/<int:pk>/scores/<int:cid>/<str:passcode>/",
|
||||
views.exam_scores_cid_user,
|
||||
name="exam_scores_cid_user",
|
||||
),
|
||||
|
||||
+2
-1
@@ -846,7 +846,7 @@ def exam_scores_cid(request, pk):
|
||||
)
|
||||
|
||||
|
||||
def exam_scores_cid_user(request, pk, cid):
|
||||
def exam_scores_cid_user(request, pk, cid, passcode):
|
||||
exam = get_object_or_404(Exam, pk=pk)
|
||||
|
||||
if not exam.exam_mode:
|
||||
@@ -908,6 +908,7 @@ def exam_scores_cid_user(request, pk, cid):
|
||||
{
|
||||
"exam": exam,
|
||||
"cid": cid,
|
||||
"passcode" : passcode,
|
||||
"questions": questions,
|
||||
"answers": answers,
|
||||
"answers_marks": answers_marks,
|
||||
|
||||
Reference in New Issue
Block a user