This commit is contained in:
Ross
2021-08-16 14:26:34 +00:00
parent 471e1acd2f
commit 7b5458202a
4 changed files with 24 additions and 0 deletions
@@ -22,6 +22,7 @@
<a href="{% url 'rapids:rapid_add_note' pk=question.pk %}"> Add Note</a>
{% if request.user.is_superuser %}
<a href="{% url 'admin:rapids_rapid_change' question.id %}" title="Edit the Rapid using the admin interface">Admin Edit</a>
<a href="{% url 'rapids:question_user_answers' question.id %}" title="Edit the Rapid using the admin interface">Admin Edit</a>
{% endif %}
{% include 'rapids/question_display_block.html' %}
{% endblock %}
@@ -0,0 +1,10 @@
{% extends 'rapids/base.html' %}
{% block content %}
<ul>
{% for answer in answers %}
<li><a href="{% url 'rapids:rapid_user_answer_view' pk=answer.pk %}">{{answer}}</a></li>
{% endfor %}
</ul>
{% endblock %}
+1
View File
@@ -18,6 +18,7 @@ urlpatterns = [
#path("all_questions/", views.all_questions, name="all_questions"),
path("question/<int:pk>/scrap", views.rapid_scrap, name="rapid_scrap"),
path("question/<int:pk>/delete", views.QuestionDelete.as_view(), name="question_delete"),
path("question/<int:pk>/user_answers", views.question_user_answers, name="question_user_answers"),
path("exam/<int:pk>/<int:sk>/mark", views.mark, name="mark"),
path("exam/<int:pk>/mark", views.RapidExamViews.mark_overview, name="mark_overview"),
# path("exam/<int:pk>/<int:sk>/", views.exam_take, name="exam_take"),
+12
View File
@@ -126,6 +126,18 @@ def question_detail(request, pk):
)
@login_required
def question_user_answers(request, pk):
rapid = get_object_or_404(Rapid, pk=pk)
answers = CidUserAnswer.objects.filter(question__id=rapid.pk)
return render(
request,
"rapids/question_user_answers.html",
{"question": rapid, "answers": answers},
)
@login_required
def rapid_split(request, pk):
rapid = get_object_or_404(Rapid, pk=pk)