.
This commit is contained in:
@@ -1,82 +1,83 @@
|
||||
{% extends 'longs/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><br />
|
||||
History: <span id="history"></span><br />
|
||||
Images: <span id="series"></span>
|
||||
<div id="single-dicom-viewer" class="dicom-viewer" data-images="" data-annotations=''>
|
||||
</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><br />
|
||||
History: <span id="history"></span><br />
|
||||
Images: <span id="series"></span>
|
||||
<div id="single-dicom-viewer" class="dicom-viewer" data-images="" data-annotations=''>
|
||||
</div>
|
||||
</div>
|
||||
<div class="longs">
|
||||
<h2>Exam: {{ exam.name }}</h2>
|
||||
<h3>Candidate: {{ cid }}</h3>
|
||||
Scores:
|
||||
<ul>{% for score in answers_marks %}
|
||||
<li class="user-answer-li">Question {{forloop.counter}}</li>
|
||||
<span class="user-answer-score user-answer-score-{{score}}">
|
||||
<pre>{{ans}}</pre> ({{score}})</span>
|
||||
</div>
|
||||
<div class="longs">
|
||||
<h2>Exam: {{ exam.name }}</h2>
|
||||
<h3>Candidate: {{ cid }}</h3>
|
||||
Scores:
|
||||
<ul>{% for score in answers_marks %}
|
||||
<li class="user-answer-li">Question {{forloop.counter}}</li>
|
||||
<span class="user-answer-score user-answer-score-{{score}}">
|
||||
<pre>{{ans}}</pre> ({{score}})
|
||||
</span>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<br /> Total mark: {{ total_score }} / {{max_score}}
|
||||
<br /> Normalised score: {{normalised_score}}
|
||||
<div>
|
||||
<h4>Answers</h4>
|
||||
<ul class="long-answer">{% for a,b,c,d,e in answer_text %}
|
||||
<li class="user-answer-li"><b>Question {{forloop.counter}}</b> <span class="view-question-link-longs"
|
||||
</ul>
|
||||
<br /> Total mark: {{ total_score }} / {{max_score}}
|
||||
<br /> Normalised score: {{normalised_score}}
|
||||
<div>
|
||||
<h4>Answers</h4>
|
||||
<ul class="long-answer">{% for a,b,c,d,e in answer_text %}
|
||||
<li class="user-answer-li"><b>Question {{forloop.counter}}</b> <span class="view-question-link-longs"
|
||||
data-qn={{forloop.counter0}}>View</span></li>
|
||||
|
||||
<ul>
|
||||
<li class="user-answer-li">Observation</br>
|
||||
<pre>{{a}}</pre>
|
||||
</li>
|
||||
<li class="user-answer-li">Interpretation</br>
|
||||
<pre>{{b}}</pre>
|
||||
</li>
|
||||
<li class="user-answer-li">Principle Diagnosis</br>
|
||||
<pre>{{c}}</pre>
|
||||
</li>
|
||||
<li class="user-answer-li">Differential Diagnosis</br>
|
||||
<pre>{{d}}</pre>
|
||||
</li>
|
||||
<li class="user-answer-li">Management</br>
|
||||
<pre>{{e}}</pre>
|
||||
</li>
|
||||
</ul>
|
||||
{% endfor %}
|
||||
<ul>
|
||||
<li class="user-answer-li">Observation</br>
|
||||
<pre>{{a}}</pre>
|
||||
</li>
|
||||
<li class="user-answer-li">Interpretation</br>
|
||||
<pre>{{b}}</pre>
|
||||
</li>
|
||||
<li class="user-answer-li">Principle Diagnosis</br>
|
||||
<pre>{{c}}</pre>
|
||||
</li>
|
||||
<li class="user-answer-li">Differential Diagnosis</br>
|
||||
<pre>{{d}}</pre>
|
||||
</li>
|
||||
<li class="user-answer-li">Management</br>
|
||||
<pre>{{e}}</pre>
|
||||
</li>
|
||||
</ul>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<a href="{% url 'cid_scores' cid %}">Other exams</a>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<a href="{% url 'cid_scores' cid passcode %}">Other exams</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block js %}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$(".hide-show").click((evt, el) => {
|
||||
$(".inner-display-block").toggle();
|
||||
})
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$(".hide-show").click((evt, el) => {
|
||||
$(".inner-display-block").toggle();
|
||||
})
|
||||
|
||||
$(".view-question-link-longs").on("click", function (e) {
|
||||
console.log("click", e)
|
||||
question_number = e.currentTarget.dataset.qn;
|
||||
$("#single-dicom-viewer").empty();
|
||||
$.ajax({
|
||||
url: `{% url 'longs:question_review' pk=exam.pk %}`,
|
||||
data: {
|
||||
csrfmiddlewaretoken: "{{ csrf_token }}",
|
||||
question_number: question_number
|
||||
},
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
})
|
||||
$(".view-question-link-longs").on("click", function (e) {
|
||||
console.log("click", e)
|
||||
question_number = e.currentTarget.dataset.qn;
|
||||
$("#single-dicom-viewer").empty();
|
||||
$.ajax({
|
||||
url: `{% url 'longs: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', {
|
||||
@@ -93,7 +94,7 @@
|
||||
$("#series").empty();
|
||||
data.image_titles.forEach((element, index) => {
|
||||
$("#series").append($(
|
||||
`<span class="image-link" title="click to view">${index+1}: ${element}</span> `
|
||||
`<span class="image-link" title="click to view">${index + 1}: ${element}</span> `
|
||||
).click(() => {
|
||||
$("#single-dicom-viewer").empty();
|
||||
let event = new CustomEvent('loadDicomViewerUrls', {
|
||||
@@ -110,13 +111,13 @@
|
||||
})
|
||||
$(".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 %}
|
||||
+16
-4
@@ -66,9 +66,21 @@ urlpatterns = [
|
||||
views.question_review,
|
||||
name="question_review",
|
||||
),
|
||||
path("exam/<int:exam_id>/<int:question_number>/<int:cid>/mark", views.mark_answer, name="mark_answer"),
|
||||
path("exam/<int:exam_id>/<int:question_number>/<int:cid>/mark_override", views.mark_answer_override, name="mark_answer_override"),
|
||||
path("exam/<int:exam_id>/<int:sk>/mark", views.mark_question_overview, name="mark_question_overview"),
|
||||
path(
|
||||
"exam/<int:exam_id>/<int:question_number>/<int:cid>/mark",
|
||||
views.mark_answer,
|
||||
name="mark_answer",
|
||||
),
|
||||
path(
|
||||
"exam/<int:exam_id>/<int:question_number>/<int:cid>/mark_override",
|
||||
views.mark_answer_override,
|
||||
name="mark_answer_override",
|
||||
),
|
||||
path(
|
||||
"exam/<int:exam_id>/<int:sk>/mark",
|
||||
views.mark_question_overview,
|
||||
name="mark_question_overview",
|
||||
),
|
||||
path("exam/<int:pk>/mark", views.LongExamViews.mark_overview, name="mark_overview"),
|
||||
# path("exam/<int:pk>/<int:sk>/", views.exam_take, name="exam_take"),
|
||||
path(
|
||||
@@ -89,7 +101,7 @@ urlpatterns = [
|
||||
),
|
||||
path("exam/<int:pk>/scores", views.exam_scores_cid, name="exam_scores_cid"),
|
||||
path(
|
||||
"exam/<int:pk>/scores/<int:sk>/",
|
||||
"exam/<int:pk>/scores/<int:sk>/<str:passcode>/",
|
||||
views.exam_scores_cid_user,
|
||||
name="exam_scores_cid_user",
|
||||
),
|
||||
|
||||
+2
-1
@@ -1032,7 +1032,7 @@ def exam_scores_cid(request, pk):
|
||||
)
|
||||
|
||||
|
||||
def exam_scores_cid_user(request, pk, sk):
|
||||
def exam_scores_cid_user(request, pk, sk, passcode):
|
||||
exam = get_object_or_404(Exam, pk=pk)
|
||||
|
||||
# TODO:Need some kind of test for cid
|
||||
@@ -1104,6 +1104,7 @@ def exam_scores_cid_user(request, pk, sk):
|
||||
{
|
||||
"exam": exam,
|
||||
"cid": cid,
|
||||
"passcode" : passcode,
|
||||
"questions": questions,
|
||||
# "answers": answers,
|
||||
"answers_marks": answers_marks,
|
||||
|
||||
Reference in New Issue
Block a user