Commit e5e917c2 by Douglas Cerna

Addressed Braden's observations

parent d9b24f43
......@@ -173,7 +173,7 @@ class MCQBlock(SubmittingXBlockMixin, QuestionnaireAbstractBlock):
retrievable from the Course Block API.
"""
return {
'id': self.url_name,
'id': self.name,
'type': self.CATEGORY,
'question': self.question,
'message': self.message,
......@@ -187,22 +187,8 @@ class MCQBlock(SubmittingXBlockMixin, QuestionnaireAbstractBlock):
{'content': tip.content, 'for_choices': tip.values}
for tip in self.get_tips()
],
'user_state': {
'student_choice': self.student_choice,
},
}
@property
def url_name(self):
"""
Get the url_name for this block. In Studio/LMS it is provided by a mixin, so we just
defer to super(). In the workbench or any other platform, we use the name.
"""
try:
return super(MCQBlock, self).url_name
except AttributeError:
return self.name
class RatingBlock(MCQBlock):
"""
......@@ -260,6 +246,17 @@ class RatingBlock(MCQBlock):
self.render_children(context, fragment, can_reorder=True, can_add=False)
return fragment
@property
def url_name(self):
"""
Get the url_name for this block. In Studio/LMS it is provided by a mixin, so we just
defer to super(). In the workbench or any other platform, we use the name.
"""
try:
return super(RatingBlock, self).url_name
except AttributeError:
return self.name
def student_view(self, context):
fragment = super(RatingBlock, self).student_view(context)
rendering_for_studio = None
......
......@@ -917,13 +917,6 @@ class MentoringBlock(BaseMentoringBlock, StudioContainerWithNestedXBlocksMixin,
components.append(block.student_view_data())
return {
'max_attempts': self.max_attempts,
'user_state': {
'num_attempts': self.num_attempts,
'attempted': self.attempted,
'completed': self.completed,
'student_results': self.student_results,
'step': self.step,
},
'extended_feedback': self.extended_feedback,
'feedback_label': self.feedback_label,
'components': components,
......
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