diff --git a/anatomy/models.py b/anatomy/models.py index d204a133..70ce9b0f 100644 --- a/anatomy/models.py +++ b/anatomy/models.py @@ -136,6 +136,9 @@ class AnatomyQuestion(models.Model): return unmarked_answers + def GetUnmarkedAnswerCount(self): + return len(self.GetUnmarkedAnswers()) + def GetMarkedAnswers(self): return set([i.get_compare_string() for i in self.answers.all() if i.status != i.MarkOptions.UNMARKED]) correct_answers = set([i.answer.lower() for i in self.answers.all()]) @@ -289,4 +292,15 @@ class CidUserAnswer(models.Model): self.answer.strip() def get_compare_string(self): - return self.answer.lower() \ No newline at end of file + return self.answer.lower() + + def get_answer_score(self): + q = self.question + ans = self.answer + if q.answers.filter(answer__iexact=ans, status=Answer.MarkOptions.CORRECT).first() is not None: + mark = 2 + elif q.answers.filter(answer__iexact=ans, status=Answer.MarkOptions.HALF_MARK).first() is not None: + mark = 1 + else: + mark = 0 + return mark \ No newline at end of file diff --git a/anatomy/static/css/anatomy.css b/anatomy/static/css/anatomy.css index 7b6218fa..cdd471a0 100644 --- a/anatomy/static/css/anatomy.css +++ b/anatomy/static/css/anatomy.css @@ -3,6 +3,10 @@ body { background-color: black; } +a, a:link { + color: #3282b8; +} + .warn { color: red; } @@ -107,4 +111,16 @@ button a { .marking { float: right; +} + +#question-mark-list { + padding: 20px +} + +#question-mark-list a { + color: #bbe1fa +} + +#question-mark-list li { + padding-bottom: 5px; } \ No newline at end of file diff --git a/anatomy/static/js/anatomy.js b/anatomy/static/js/anatomy.js index 6757c773..6bec6d96 100644 --- a/anatomy/static/js/anatomy.js +++ b/anatomy/static/js/anatomy.js @@ -82,6 +82,20 @@ cornerstone.loadAndCacheImage(imageId).then(function(image) { }); } +if ($("#question-mark-list").length) { +$(".show-all-button").click(() => { + $("#question-mark-list li").show(); +}); +$(".show-unmarked-button").click(() => { + console.log("TESTIG"); + $("#question-mark-list li").each((n, el) => { + console.log(el); + if (el.dataset.markcount < 1) { $(el).hide(); } + }) +}); + +} + }); function prepAnswerData() { diff --git a/anatomy/templates/anatomy/cid_scores.html b/anatomy/templates/anatomy/cid_scores.html new file mode 100644 index 00000000..fcde81bf --- /dev/null +++ b/anatomy/templates/anatomy/cid_scores.html @@ -0,0 +1,13 @@ +{% extends 'anatomy/base.html' %} + +{% block content %} +
+

CID: {{ cid }}

+ The following exams have been found (click to view answers and scores): + +
+{% endblock %} diff --git a/anatomy/templates/anatomy/exam_overview.html b/anatomy/templates/anatomy/exam_overview.html index f8020a77..6cf139cb 100644 --- a/anatomy/templates/anatomy/exam_overview.html +++ b/anatomy/templates/anatomy/exam_overview.html @@ -6,6 +6,10 @@

Exam: {{ exam.name }}

This exam has {{question_number}} questions. + +
+Exam active: +

@@ -22,4 +26,29 @@ Exams: {{ question.GetExams }} / Modality: {{ question.modality }} Refresh JSON cache
+ {% endblock %} \ No newline at end of file diff --git a/anatomy/templates/anatomy/exam_scores_user.html b/anatomy/templates/anatomy/exam_scores_user.html index 9e30e089..1bbce2f1 100644 --- a/anatomy/templates/anatomy/exam_scores_user.html +++ b/anatomy/templates/anatomy/exam_scores_user.html @@ -1,4 +1,4 @@ -{% extends 'anatomy/exams.html' %} +{% extends 'anatomy/base.html' %} {% block content %}
diff --git a/anatomy/templates/anatomy/mark_overview.html b/anatomy/templates/anatomy/mark_overview.html index 3921f773..977fdd01 100644 --- a/anatomy/templates/anatomy/mark_overview.html +++ b/anatomy/templates/anatomy/mark_overview.html @@ -3,11 +3,15 @@ {% block content %}

Marking exam: {{ exam.name }}

- Question order will be different on the test system (as it is randomly generated) + Question order may be different on the test system (as json order is not guaranteed to be maintained) -