fix to work with unicode answers
This commit is contained in:
parent
a8f2bd1025
commit
2e089c894e
|
@ -63,8 +63,11 @@ class EffectiveQuizForm(form.Form):
|
|||
question_title = question_lines[0]
|
||||
question_answers = [x[2:] for x in question_lines[1:]]
|
||||
self.good_answers['q%s' % (i+1)] = [x[2:] for x in question_lines[1:] if x.startswith('o')]
|
||||
terms = [SimpleVocabulary.createTerm(x, x.encode('ascii', 'ignore'), x)
|
||||
for x in question_answers]
|
||||
question_vocabulary = SimpleVocabulary(terms)
|
||||
question_field = schema.Choice(title=question_title,
|
||||
values=question_answers,
|
||||
vocabulary=question_vocabulary,
|
||||
required=False)
|
||||
question_field.__name__ = 'q%s' % (i+1)
|
||||
question_field.widgetFactory = RadioFieldWidget
|
||||
|
|
Reference in New Issue