From e88d73565fe37f0cb7bc326de4155eba83f65155 Mon Sep 17 00:00:00 2001 From: Adil Mohak Date: Sat, 5 Oct 2024 02:04:09 +0300 Subject: [PATCH] Fix: template does not exist --- quiz/templatetags/quiz_tags.py | 7 +++---- templates/{ => quiz}/correct_answer.html | 0 templates/{ => quiz}/question.html | 0 templates/{ => quiz}/result.html | 0 4 files changed, 3 insertions(+), 4 deletions(-) rename templates/{ => quiz}/correct_answer.html (100%) rename templates/{ => quiz}/question.html (100%) rename templates/{ => quiz}/result.html (100%) diff --git a/quiz/templatetags/quiz_tags.py b/quiz/templatetags/quiz_tags.py index d256bb0..c5acced 100644 --- a/quiz/templatetags/quiz_tags.py +++ b/quiz/templatetags/quiz_tags.py @@ -3,21 +3,20 @@ from django import template register = template.Library() -@register.inclusion_tag('correct_answer.html', takes_context=True) +@register.inclusion_tag("quiz/correct_answer.html", takes_context=True) def correct_answer_for_all(context, question): """ processes the correct answer based on a given question object if the answer is incorrect, informs the user """ answers = question.get_choices() - incorrect_list = context.get('incorrect_questions', []) + incorrect_list = context.get("incorrect_questions", []) if question.id in incorrect_list: user_was_incorrect = True else: user_was_incorrect = False - return {'previous': {'answers': answers}, - 'user_was_incorrect': user_was_incorrect} + return {"previous": {"answers": answers}, "user_was_incorrect": user_was_incorrect} @register.filter diff --git a/templates/correct_answer.html b/templates/quiz/correct_answer.html similarity index 100% rename from templates/correct_answer.html rename to templates/quiz/correct_answer.html diff --git a/templates/question.html b/templates/quiz/question.html similarity index 100% rename from templates/question.html rename to templates/quiz/question.html diff --git a/templates/result.html b/templates/quiz/result.html similarity index 100% rename from templates/result.html rename to templates/quiz/result.html