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