Commit 6c5db884 by Eugeny Kolpakov

Added `display_name` parameter to all XBlocks having student_view_data

parent 21e21468
......@@ -267,6 +267,7 @@ class AnswerBlock(SubmittingXBlockMixin, AnswerMixin, QuestionMixin, StudioEdita
return {
'id': self.name,
'block_id': unicode(self.scope_ids.usage_id),
'display_name': self.display_name,
'type': self.CATEGORY,
'weight': self.weight,
'question': self.question,
......
......@@ -74,8 +74,10 @@ class ChoiceBlock(
Returns a JSON representation of the student_view of this XBlock,
retrievable from the Course Block API.
"""
# display_name_with_default gives out correctness - not adding it here
return {
'block_id': unicode(self.scope_ids.usage_id),
'display_name': self._(u"Choice ({content})").format(content=self.content)
'value': self.value,
'content': self.content,
}
......
......@@ -116,6 +116,7 @@ class CompletionBlock(
return {
'id': self.name,
'block_id': unicode(self.scope_ids.usage_id),
'display_name': self.display_name_with_default,
'type': self.CATEGORY,
'question': self.question,
'answer': self.answer,
......
......@@ -177,6 +177,7 @@ class MCQBlock(SubmittingXBlockMixin, StudentViewUserStateMixin, QuestionnaireAb
return {
'id': self.name,
'block_id': unicode(self.scope_ids.usage_id),
'display_name': self.display_name_with_default,
'type': self.CATEGORY,
'question': self.question,
'message': self.message,
......
......@@ -923,6 +923,7 @@ class MentoringBlock(
components.append(block.student_view_data())
return {
'block_id': unicode(self.scope_ids.usage_id),
'display_name': self.display_name,
'max_attempts': self.max_attempts,
'extended_feedback': self.extended_feedback,
'feedback_label': self.feedback_label,
......@@ -1272,6 +1273,7 @@ class MentoringWithExplicitStepsBlock(BaseMentoringBlock, StudioContainerWithNes
return {
'title': self.display_name,
'block_id': unicode(self.scope_ids.usage_id),
'display_name': self.display_name,
'show_title': self.show_title,
'weight': self.weight,
'extended_feedback': self.extended_feedback,
......
......@@ -207,6 +207,7 @@ class MRQBlock(SubmittingXBlockMixin, StudentViewUserStateMixin, QuestionnaireAb
return {
'id': self.name,
'block_id': unicode(self.scope_ids.usage_id),
'display_name': self.display_name,
'title': self.display_name,
'type': self.CATEGORY,
'weight': self.weight,
......
......@@ -362,6 +362,7 @@ class PlotBlock(
retrievable from the Course XBlock API.
"""
return {
'display_name': self.display_name,
'type': self.CATEGORY,
'title': self.display_name,
'q1_label': self.q1_label,
......
......@@ -128,6 +128,7 @@ class SliderBlock(
return {
'id': self.name,
'block_id': unicode(self.scope_ids.usage_id),
'display_name': self.display_name_with_default,
'type': self.CATEGORY,
'question': self.question,
'min_label': self.min_label,
......
......@@ -283,6 +283,7 @@ class MentoringStepBlock(
return {
'block_id': unicode(self.scope_ids.usage_id),
'display_name': self.display_name_with_default,
'type': self.CATEGORY,
'title': self.display_name_with_default,
'show_title': self.show_title,
......
......@@ -112,6 +112,7 @@ class ConditionalMessageBlock(
def student_view_data(self, context=None):
return {
'block_id': unicode(self.scope_ids.usage_id),
'display_name': self.display_name_with_default,
'type': self.CATEGORY,
'content': self.content,
'score_condition': self.score_condition,
......@@ -163,6 +164,7 @@ class ScoreSummaryBlock(XBlockWithTranslationServiceMixin, XBlockWithPreviewMixi
def student_view_data(self, context=None):
return {
'block_id': unicode(self.scope_ids.usage_id),
'display_name': self.display_name_with_default,
'type': self.CATEGORY,
}
......@@ -217,6 +219,7 @@ class PerQuestionFeedbackBlock(XBlockWithTranslationServiceMixin, XBlockWithPrev
def student_view_data(self, context=None):
return {
'block_id': unicode(self.scope_ids.usage_id),
'display_name': self.display_name_with_default,
'type': self.CATEGORY,
}
......@@ -314,6 +317,7 @@ class ReviewStepBlock(
return {
'block_id': unicode(self.scope_ids.usage_id),
'display_name': self.display_name,
'type': self.CATEGORY,
'title': self.display_name,
'components': components,
......
......@@ -97,6 +97,7 @@ class TipBlock(StudioEditableXBlockMixin, XBlockWithTranslationServiceMixin, XBl
def student_view_data(self, context=None):
return {
'display_name': self.display_name_with_default,
'content': self.content,
'for_choices': self.values,
}
......
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