Commit b645683d by Xavier Antoviaque

Remove `student_view()` calls when they aren't implemented by blocks

parent 04f74620
...@@ -71,10 +71,6 @@ class AnswerBlock(XBlock): ...@@ -71,10 +71,6 @@ class AnswerBlock(XBlock):
return student_input return student_input
def student_view(self, context=None): # pylint: disable=W0613
"""Returns default student view."""
return Fragment(u"<p>I can only appear inside mentoring blocks.</p>")
def mentoring_view(self, context=None): def mentoring_view(self, context=None):
if not self.read_only: if not self.read_only:
html = render_template('templates/html/answer_editable.html', { html = render_template('templates/html/answer_editable.html', {
......
...@@ -27,7 +27,6 @@ import logging ...@@ -27,7 +27,6 @@ import logging
from xblock.core import XBlock from xblock.core import XBlock
from xblock.fields import Scope, String from xblock.fields import Scope, String
from xblock.fragment import Fragment
from .utils import render_template, XBlockWithChildrenFragmentsMixin from .utils import render_template, XBlockWithChildrenFragmentsMixin
...@@ -48,10 +47,6 @@ class MentoringMessageBlock(XBlock, XBlockWithChildrenFragmentsMixin): ...@@ -48,10 +47,6 @@ class MentoringMessageBlock(XBlock, XBlockWithChildrenFragmentsMixin):
type = String(help="Type of message", scope=Scope.content, default="completed") type = String(help="Type of message", scope=Scope.content, default="completed")
has_children = True has_children = True
def student_view(self, context=None): # pylint: disable=W0613
"""Returns default student view."""
return Fragment(u"<p>I can only appear inside mentoring blocks.</p>")
def mentoring_view(self, context=None): def mentoring_view(self, context=None):
fragment, named_children = self.get_children_fragment(context, view_name='mentoring_view') fragment, named_children = self.get_children_fragment(context, view_name='mentoring_view')
fragment.add_content(render_template('templates/html/message.html', { fragment.add_content(render_template('templates/html/message.html', {
......
...@@ -84,10 +84,6 @@ class QuizzBlock(XBlock): ...@@ -84,10 +84,6 @@ class QuizzBlock(XBlock):
return block return block
def student_view(self, context=None): # pylint: disable=W0613
"""Returns default student view."""
return Fragment(u"<p>I can only appear inside mentoring blocks.</p>")
def mentoring_view(self, context=None): def mentoring_view(self, context=None):
if self.type not in ('rating', 'choices'): if self.type not in ('rating', 'choices'):
raise ValueError, u'Invalid value for QuizzBlock.type: `{}`'.format(self.type) raise ValueError, u'Invalid value for QuizzBlock.type: `{}`'.format(self.type)
......
...@@ -27,7 +27,6 @@ import logging ...@@ -27,7 +27,6 @@ import logging
from xblock.core import XBlock from xblock.core import XBlock
from xblock.fields import Scope, String from xblock.fields import Scope, String
from xblock.fragment import Fragment
from .utils import load_resource, render_template, XBlockWithChildrenFragmentsMixin from .utils import load_resource, render_template, XBlockWithChildrenFragmentsMixin
...@@ -82,10 +81,6 @@ class MentoringTableColumnBlock(XBlock, XBlockWithChildrenFragmentsMixin): ...@@ -82,10 +81,6 @@ class MentoringTableColumnBlock(XBlock, XBlockWithChildrenFragmentsMixin):
header = String(help="Header of the column", scope=Scope.content, default=None) header = String(help="Header of the column", scope=Scope.content, default=None)
has_children = True has_children = True
def student_view(self, context=None): # pylint: disable=W0613
"""Returns default student view."""
return Fragment(u"<p>I can only appear inside mentoring-table blocks.</p>")
def mentoring_table_view(self, context): def mentoring_table_view(self, context):
""" """
The content of the column The content of the column
...@@ -120,10 +115,6 @@ class MentoringTableColumnHeaderBlock(XBlock, XBlockWithChildrenFragmentsMixin): ...@@ -120,10 +115,6 @@ class MentoringTableColumnHeaderBlock(XBlock, XBlockWithChildrenFragmentsMixin):
content = String(help="Body of the header", scope=Scope.content, default='') content = String(help="Body of the header", scope=Scope.content, default='')
has_children = True has_children = True
def student_view(self, context=None): # pylint: disable=W0613
"""Returns default student view."""
return Fragment(u"<p>I can only appear inside mentoring-table blocks.</p>")
def mentoring_table_header_view(self, context): def mentoring_table_header_view(self, context):
fragment = super(MentoringTableColumnHeaderBlock, self).children_view(context) fragment = super(MentoringTableColumnHeaderBlock, self).children_view(context)
fragment.add_content(unicode(self.content)) fragment.add_content(unicode(self.content))
......
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