<s> from django import template <EOL> register = template . Library ( ) <EOL> @ register . inclusion_tag ( '<STR_LIT>' , takes_context = True ) <EOL> def correct_answer_for_all ( context , question ) : <EOL> """<STR_LIT>""" <EOL> answers = question . get_answers ( ) <EOL> incorrect_list = context . get ( '<STR_LIT>' , [ ] ) <EOL> if question . id in incorrect_list : <EOL> user_was_incorrect = True <EOL> else : <EOL> user_was_incorrect = False <EOL> return { '<STR_LIT>' : { '<STR_LIT>' : answers } , <EOL> '<STR_LIT>' : user_was_incorrect } <EOL> @ register . filter <EOL> def answer_choice_to_string ( question , answer ) : <EOL> return question . answer_choice_to_string ( answer ) </s>
