From 5114133608bf43dc6ca3442a61005fe531cca27f Mon Sep 17 00:00:00 2001
From: Ross
Date: Sun, 26 Jun 2022 23:04:40 +0100
Subject: [PATCH] .
---
.../atlas/collection_case_view_take.html | 24 ++++++++++---------
atlas/templates/atlas/collection_review.html | 12 ++++++++++
atlas/templates/atlas/collection_take.html | 4 ----
atlas/urls.py | 1 +
atlas/views.py | 9 ++++++-
.../templates/generic/exam_scores_base.html | 1 +
6 files changed, 35 insertions(+), 16 deletions(-)
create mode 100644 atlas/templates/atlas/collection_review.html
diff --git a/atlas/templates/atlas/collection_case_view_take.html b/atlas/templates/atlas/collection_case_view_take.html
index acd1aaa9..0f0ff16e 100644
--- a/atlas/templates/atlas/collection_case_view_take.html
+++ b/atlas/templates/atlas/collection_case_view_take.html
@@ -64,17 +64,19 @@
{% endif %}
+ {% if collection.collection_type == "REP" %}
+
+
+
+
+ {% if collection.publish_results %}
+
Answer score: {{answer.score}}
+ Answer feedback: {{answer.feedback|safe}}
+ {% endif %}
+
+ {% endif %}
{% if previous > -1 %}
{% endif %}
diff --git a/atlas/templates/atlas/collection_review.html b/atlas/templates/atlas/collection_review.html
new file mode 100644
index 00000000..da509873
--- /dev/null
+++ b/atlas/templates/atlas/collection_review.html
@@ -0,0 +1,12 @@
+{% extends 'atlas/base.html' %}
+
+{% block content %}
+ Collection: {{exam.name}}
+
+
+
+{% endblock %}
diff --git a/atlas/templates/atlas/collection_take.html b/atlas/templates/atlas/collection_take.html
index 19be6665..c1dba53d 100644
--- a/atlas/templates/atlas/collection_take.html
+++ b/atlas/templates/atlas/collection_take.html
@@ -2,9 +2,6 @@
{% block content %}
{{collection.name}}
-
- {% if collection.collection_type == "REP" %}
Start: {{exam.name}}
Enter your CID and passcode in the below boxes.
@@ -48,6 +45,5 @@
});
});
- {% endif %}
{% endblock %}
diff --git a/atlas/urls.py b/atlas/urls.py
index 1cf523c7..a790ccd2 100755
--- a/atlas/urls.py
+++ b/atlas/urls.py
@@ -29,6 +29,7 @@ urlpatterns = [
path("collection//take//", views.collection_take_overview, name="collection_take_overview"),
path("collection//", views.collection_case_view, name="collection_case_view"),
path("collection///take//", views.collection_case_view_take, name="collection_case_view_take"),
+ path("collection///review", views.collection_case_view_review, name="collection_case_view_review"),
path(
"collection//json_edit",
views.GenericExamViews.exam_json_edit,
diff --git a/atlas/views.py b/atlas/views.py
index 13846df4..51928ede 100755
--- a/atlas/views.py
+++ b/atlas/views.py
@@ -1050,7 +1050,12 @@ def collection_detail(request, pk):
def collection_take(request, pk):
collection = get_object_or_404(CaseCollection, pk=pk)
- return render(request, "atlas/collection_take.html", {"collection": collection})
+ match collection.collection_type:
+ case "REP":
+ return render(request, "atlas/collection_take.html", {"collection": collection})
+ case "REV":
+ return render(request, "atlas/collection_review.html", {"collection": collection})
+
@user_is_collection_author_or_atlas_editor
@@ -1232,6 +1237,8 @@ def collection_take_overview(request, pk, cid, passcode):
},
)
+def collection_case_view_review(request, pk, case_number):
+ return collection_case_view_take(request, pk, case_number, None, None)
def collection_case_view_take(request, pk, case_number, cid, passcode):
collection = get_object_or_404(CaseCollection, pk=pk)
diff --git a/generic/templates/generic/exam_scores_base.html b/generic/templates/generic/exam_scores_base.html
index 932daaa9..91290a67 100644
--- a/generic/templates/generic/exam_scores_base.html
+++ b/generic/templates/generic/exam_scores_base.html
@@ -92,6 +92,7 @@
User results emailed: {{exam.exam_results_emailed|default:"Never"}}
+ Note: currently only works with registered users