Commit dd5bc60c by Braden MacDonald

Debugging

parent d240c922
...@@ -20,10 +20,17 @@ class BeeperBlock(StudioEditableXBlockMixin, XBlock): ...@@ -20,10 +20,17 @@ class BeeperBlock(StudioEditableXBlockMixin, XBlock):
editable_fields = ('content',) editable_fields = ('content',)
def student_view(self, context): def student_view(self, context):
normalized_id = self.scope_ids.usage_id.replace(run=None, branch=None, version_guid=None) normalized_id = self.scope_ids.usage_id.replace(branch=None, version_guid=None)
fragment = Fragment() fragment = Fragment()
if context.get('activate_block_id', None) == normalized_id: fragment.add_content(u'<div><h4>Beeper</h4>')
fragment.add_content(u'<p>normalized_id: {}</p>'.format(unicode(normalized_id)))
fragment.add_content(u'<p>activated: {}</p>'.format(context.get('activate_block_id', '')))
if context.get('activate_block_id', None) == unicode(normalized_id):
fragment.add_javascript("alert('{content}')".format(content=self.content)) fragment.add_javascript("alert('{content}')".format(content=self.content))
fragment.add_content(u'<p>Activated!</p>')
else:
fragment.add_content(u'<p>Not Activated.</p>')
fragment.add_content(u'</div>')
return fragment return fragment
def author_view(self, content): def author_view(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