Commit ee49a273 by Braden MacDonald

Fix error when editing the review component blocks

parent 755ba357
from lazy import lazy from lazy import lazy
from xblock.fields import String, Boolean, Float, Scope, UNIQUE_ID from xblock.fields import String, Boolean, Float, Scope, UNIQUE_ID
from xblock.fragment import Fragment
from xblockutils.helpers import child_isinstance from xblockutils.helpers import child_isinstance
from xblockutils.resources import ResourceLoader from xblockutils.resources import ResourceLoader
...@@ -167,3 +168,11 @@ class QuestionMixin(EnumerableChildMixin): ...@@ -167,3 +168,11 @@ class QuestionMixin(EnumerableChildMixin):
decorative elements/instructions. decorative elements/instructions.
""" """
return self.mentoring_view(context) return self.mentoring_view(context)
class NoSettingsMixin(object):
""" Mixin for an XBlock that has no settings """
def studio_view(self, _context=None):
""" Studio View """
return Fragment(u'<p>{}</p>'.format(self._("This XBlock does not have any settings.")))
...@@ -28,7 +28,7 @@ from xblockutils.studio_editable import ( ...@@ -28,7 +28,7 @@ from xblockutils.studio_editable import (
NestedXBlockSpec, StudioEditableXBlockMixin, StudioContainerWithNestedXBlocksMixin, XBlockWithPreviewMixin NestedXBlockSpec, StudioEditableXBlockMixin, StudioContainerWithNestedXBlocksMixin, XBlockWithPreviewMixin
) )
from .mixins import XBlockWithTranslationServiceMixin from .mixins import XBlockWithTranslationServiceMixin, NoSettingsMixin
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
...@@ -133,7 +133,7 @@ class ConditionalMessageBlock( ...@@ -133,7 +133,7 @@ class ConditionalMessageBlock(
@XBlock.needs("i18n") @XBlock.needs("i18n")
class ScoreSummaryBlock(XBlockWithTranslationServiceMixin, XBlockWithPreviewMixin, XBlock): class ScoreSummaryBlock(XBlockWithTranslationServiceMixin, XBlockWithPreviewMixin, NoSettingsMixin, XBlock):
""" """
Summarize the score that the student earned. Summarize the score that the student earned.
""" """
...@@ -174,7 +174,7 @@ class ScoreSummaryBlock(XBlockWithTranslationServiceMixin, XBlockWithPreviewMixi ...@@ -174,7 +174,7 @@ class ScoreSummaryBlock(XBlockWithTranslationServiceMixin, XBlockWithPreviewMixi
@XBlock.needs("i18n") @XBlock.needs("i18n")
class PerQuestionFeedbackBlock(XBlockWithTranslationServiceMixin, XBlockWithPreviewMixin, XBlock): class PerQuestionFeedbackBlock(XBlockWithTranslationServiceMixin, XBlockWithPreviewMixin, NoSettingsMixin, XBlock):
""" """
Summaryize the score that the student earned. Summaryize the score that the student earned.
""" """
...@@ -210,7 +210,11 @@ class PerQuestionFeedbackBlock(XBlockWithTranslationServiceMixin, XBlockWithPrev ...@@ -210,7 +210,11 @@ class PerQuestionFeedbackBlock(XBlockWithTranslationServiceMixin, XBlockWithPrev
@XBlock.needs("i18n") @XBlock.needs("i18n")
class ReviewStepBlock( class ReviewStepBlock(
StudioContainerWithNestedXBlocksMixin, XBlockWithTranslationServiceMixin, XBlockWithPreviewMixin, XBlock StudioContainerWithNestedXBlocksMixin,
XBlockWithTranslationServiceMixin,
XBlockWithPreviewMixin,
NoSettingsMixin,
XBlock
): ):
""" """
A dedicated step for reviewing results as the last step of a Step Builder sequence. A dedicated step for reviewing results as the last step of a Step Builder sequence.
...@@ -275,10 +279,6 @@ class ReviewStepBlock( ...@@ -275,10 +279,6 @@ class ReviewStepBlock(
mentoring_view = student_view mentoring_view = student_view
def studio_view(self, _context=None):
""" Studio View """
return Fragment(u'<p>{}</p>'.format(self._("This XBlock does not have any settings.")))
def author_edit_view(self, context): def author_edit_view(self, context):
""" """
Add some HTML to the author view that allows authors to add child blocks. Add some HTML to the author view that allows authors to add child blocks.
......
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