Fix: template does not exist
This commit is contained in:
parent
aa43040c30
commit
e88d73565f
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user