This commit is contained in:
Ross
2021-10-17 10:51:07 +01:00
parent 14fe8f990d
commit 85e5a34cd6
4 changed files with 28 additions and 9 deletions
+10 -4
View File
@@ -1,7 +1,13 @@
{% extends 'anatomy/base.html' %}
{% block navigation %}
{{block.super}}
<br/>
Exams: {{exam.name}}-> <a href="{% url 'anatomy:exam_overview' pk=exam.pk %}">Overview</a> / <a href="{% url 'anatomy:mark_overview' pk=exam.pk %}">Mark</a> / <a href="{% url 'anatomy:exam_scores_cid' pk=exam.pk %}">Scores</a>
{% endblock %}
{{block.super}}
<br/>
Exams: {{exam.name}}->
<a href="{% url 'anatomy:exam_overview' pk=exam.pk %}">Overview</a> /
{% if exam.exam_mode %}
<a href="{% url 'anatomy:mark_overview' pk=exam.pk %}">Mark</a> /
<a href="{% url 'anatomy:exam_scores_cid' pk=exam.pk %}">Scores</a> /
{% endif %}
<a href="{% url 'anatomy:anatomy_create_exam' pk=exam.pk %}">Add New Question</a>
{% endblock %}
+1
View File
@@ -20,6 +20,7 @@ urlpatterns = [
views.AnatomyQuestionCreate.as_view(),
name="anatomy_question_create",
),
path("create/exam/<int:pk>", views.AnatomyQuestionCreate.as_view(), name="anatomy_create_exam"),
path(
"question/<int:pk>/update",
views.AnatomyQuestionUpdate.as_view(),
+7 -1
View File
@@ -730,7 +730,13 @@ class AnatomyQuestionCreate(AnatomyQuestionCreateBase):
# initial = {'laterality': AnatomyQuestion.NONE}
def get_initial(self):
pass
if "pk" in self.kwargs:
initial = super().get_initial()
exam = get_object_or_404(Exam, pk=self.kwargs["pk"])
initial["exams"] = [exam.id]
return initial
# # There has to be a better way...
+10 -4
View File
@@ -1,7 +1,13 @@
{% extends 'rapids/base.html' %}
{% block navigation %}
{{block.super}}
<br/>
Exams: {{exam.name}}-> <a href="{% url 'rapids:exam_overview' pk=exam.pk %}">Overview</a> / <a href="{% url 'rapids:mark_overview' pk=exam.pk %}">Mark</a> / <a href="{% url 'rapids:exam_scores_cid' pk=exam.pk %}">Scores</a> / <a href="{% url 'rapids:rapid_create_exam' pk=exam.pk %}">Add Question</a>
{% endblock %}
{{block.super}}
<br/>
Exams: {{exam.name}}->
<a href="{% url 'rapids:exam_overview' pk=exam.pk %}">Overview</a> /
{% if exam.exam_mode %}
<a href="{% url 'rapids:mark_overview' pk=exam.pk %}">Mark</a> /
<a href="{% url 'rapids:exam_scores_cid' pk=exam.pk %}">Scores</a> /
{% endif %}
<a href="{% url 'rapids:rapid_create_exam' pk=exam.pk %}">Add New Question</a>
{% endblock %}