Commit b21f37f1 by Xavier Antoviaque

LMS fix: Allow workbench to use a default `anonymous_user_id`

`runtime.anonymous_user_id` is unsupported by the workbench
parent d2577cd2
......@@ -113,7 +113,8 @@ class AnswerBlock(XBlock):
if not name:
raise ValueError, 'AnswerBlock.name field need to be set to a non-null/empty value'
student_id = self.runtime.anonymous_student_id
# TODO-WORKBENCH-WORKAROUND: Remove use of getattr(), used to work on both LMS & workbench
student_id = getattr(self.runtime, 'anonymous_student_id', 'student1')
answer_data, created = Answer.objects.get_or_create(
student_id=student_id,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment