Commit 04f74620 by Xavier Antoviaque

Make `Answer.__init__()` by returning immediately upon empty name

parent 1a6a5cd9
...@@ -59,10 +59,10 @@ class AnswerBlock(XBlock): ...@@ -59,10 +59,10 @@ class AnswerBlock(XBlock):
Use lazy property instead of XBlock field, as __init__() doesn't support Use lazy property instead of XBlock field, as __init__() doesn't support
overwriting field values overwriting field values
""" """
student_input = ''
# Only attempt to locate a model object for this block when the answer has a name # Only attempt to locate a model object for this block when the answer has a name
if self.name: if not self.name:
return ''
student_input = self.get_model_object().student_input student_input = self.get_model_object().student_input
# Default value can be set from another answer's current value # Default value can be set from another answer's current value
......
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