Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
problem-builder
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
problem-builder
Commits
dd5bc60c
Commit
dd5bc60c
authored
Jun 12, 2015
by
Braden MacDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Debugging
parent
d240c922
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
problem_builder/beeper.py
+9
-2
No files found.
problem_builder/beeper.py
View file @
dd5bc60c
...
@@ -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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment