Skip to content

Commit

Permalink
Fix: template does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
adilmohak committed Oct 4, 2024
1 parent aa43040 commit e88d735
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions quiz/templatetags/quiz_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@
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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit e88d735

Please sign in to comment.