From 22dd3aeaacb6b23c0744fee1de60d2d4102f3dc4 Mon Sep 17 00:00:00 2001 From: Ross Date: Sun, 27 Dec 2020 23:17:17 +0000 Subject: [PATCH] . --- anatomy/static/css/anatomy.css | 2 +- anatomy/templates/anatomy/exam_overview.html | 2 +- anatomy/templates/anatomy/question_detail.html | 12 ++++++++++++ anatomy/urls.py | 1 + anatomy/views.py | 18 ++++++++++++++++++ 5 files changed, 33 insertions(+), 2 deletions(-) diff --git a/anatomy/static/css/anatomy.css b/anatomy/static/css/anatomy.css index e867fda8..0082135a 100644 --- a/anatomy/static/css/anatomy.css +++ b/anatomy/static/css/anatomy.css @@ -146,7 +146,7 @@ button a { } #dicom-image { - width: 60%; + width: 100%; height: 600px; } diff --git a/anatomy/templates/anatomy/exam_overview.html b/anatomy/templates/anatomy/exam_overview.html index b51a1285..0914c2af 100644 --- a/anatomy/templates/anatomy/exam_overview.html +++ b/anatomy/templates/anatomy/exam_overview.html @@ -25,7 +25,7 @@
{{ question.question_type }}: {{ question.GetPrimaryAnswer }}
- Modality: {{ question.modality }}, View + Modality: {{ question.modality }}, View {% endfor %} diff --git a/anatomy/templates/anatomy/question_detail.html b/anatomy/templates/anatomy/question_detail.html index 23fb6958..f8d95aea 100644 --- a/anatomy/templates/anatomy/question_detail.html +++ b/anatomy/templates/anatomy/question_detail.html @@ -2,6 +2,18 @@ {% block content %} {% load static %} +{% if exam %} +
+ +{% if previous > -1 %} +Previous question +{% endif %} + This question is part of exam: {{exam.name}} +{% if next %} +Next question +{% endif %} +
+{% endif %}
diff --git a/anatomy/urls.py b/anatomy/urls.py index 1bf4dd64..d914a635 100644 --- a/anatomy/urls.py +++ b/anatomy/urls.py @@ -18,6 +18,7 @@ urlpatterns = [ path("exam///mark", views.mark, name="mark"), path("exam//mark", views.mark_overview, name="mark_overview"), path("exam///", views.exam_take, name="exam_take"), + path("exam//question//", views.exam_question_detail, name="exam_question_detail"), path("exam//", views.exam_overview, name="exam_overview"), path("exam//scores", views.exam_scores_cid, name="exam_scores_cid"), diff --git a/anatomy/views.py b/anatomy/views.py index 91783eb7..a510e2f3 100644 --- a/anatomy/views.py +++ b/anatomy/views.py @@ -105,8 +105,26 @@ def index(request): @login_required def question_detail(request, pk): question = get_object_or_404(AnatomyQuestion, pk=pk) + return render(request, "anatomy/question_detail.html", {"question": question}) +@login_required +def exam_question_detail(request, pk, sk): + exam = get_object_or_404(Exam, pk=pk) + + question = exam.exam_questions.all()[sk] + + exam_length = len(exam.exam_questions.all()) + + previous = -1 + if sk > 0: + previous = sk-1 + next = sk+1 + if sk == exam_length-1: + next = False + + return render(request, "anatomy/question_detail.html", {"question": question, "exam": exam, "next" : next, "previous" : previous, "exam_length" : exam_length}) + @login_required def answer_question(request, pk):