def _get_mapping(self):
numbers = string.digits
mapping = {x: random.choice(numbers) + '.' for x in numbers}
def feedback_provider(is_correct, question):
key = self.get_original_question(question)
do_prepend = random.choice([True, False])
if do_prepend:
prepend = random.choice(numbers)
else:
prepend = ''
return prepend + mapping[key]
self.task_gen_kwargs['provide_feedback'] = feedback_provider
return mapping
# stems from 5.7
# TODO: description says "either 3 or 4 or 5 chars. Shown example for 3
# chars". So will it be always the same size of feedback for on task
# instance? Or can it be mixed? - this version is mixed
# same question for 5.13, 5.14, 5.15, 5.16, 5.17 and 5.18
评论列表
文章目录