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
335ee78e
Commit
335ee78e
authored
Mar 04, 2014
by
Xavier Antoviaque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also rewrite jump_to_id URLs in quizz tips & messages
parent
ae01d124
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
9 deletions
+16
-9
mentoring/light_children.py
+13
-7
mentoring/mentoring.py
+2
-1
mentoring/quizz.py
+1
-1
No files found.
mentoring/light_children.py
View file @
335ee78e
...
...
@@ -166,6 +166,17 @@ class XBlockWithLightChildren(LightChildrenMixin, XBlock):
"""
Current HTML view of the XBlock, for refresh by client
"""
frag
=
self
.
student_view
({})
frag
=
self
.
fragment_text_rewriting
(
frag
)
return
{
'html'
:
frag
.
content
,
}
def
fragment_text_rewriting
(
self
,
fragment
):
"""
Do replacements like `/jump_to_id` URL rewriting in the provided text
"""
# TODO: Why do we need to use `xmodule_runtime` and not `runtime`?
try
:
course_id
=
self
.
xmodule_runtime
.
course_id
...
...
@@ -179,13 +190,8 @@ class XBlockWithLightChildren(LightChildrenMixin, XBlock):
# TODO-WORKBENCH-WORKAROUND: To allow to load from the workbench
jump_to_url
=
'/jump_to_id'
frag
=
self
.
student_view
({})
frag
=
replace_jump_to_id_urls
(
course_id
,
jump_to_url
,
self
,
'student_view'
,
frag
,
{})
return
{
'html'
:
frag
.
content
,
}
fragment
=
replace_jump_to_id_urls
(
course_id
,
jump_to_url
,
self
,
'student_view'
,
fragment
,
{})
return
fragment
class
LightChild
(
Plugin
,
LightChildrenMixin
):
"""
...
...
mentoring/mentoring.py
View file @
335ee78e
...
...
@@ -146,7 +146,8 @@ class MentoringBlock(XBlockWithLightChildren):
def
get_message_fragment
(
self
,
message_type
):
for
child
in
self
.
get_children_objects
():
if
isinstance
(
child
,
MentoringMessageBlock
)
and
child
.
type
==
message_type
:
return
self
.
render_child
(
child
,
'mentoring_view'
,
{})
frag
=
self
.
render_child
(
child
,
'mentoring_view'
,
{})
return
self
.
fragment_text_rewriting
(
frag
)
def
get_message_html
(
self
,
message_type
):
fragment
=
self
.
get_message_fragment
(
message_type
)
...
...
mentoring/quizz.py
View file @
335ee78e
...
...
@@ -167,7 +167,7 @@ class QuizzTipBlock(LightChild):
'self'
:
self
,
'named_children'
:
named_children
,
}))
return
fragment
return
self
.
xblock_container
.
fragment_text_rewriting
(
fragment
)
def
is_completed
(
self
,
submission
):
return
submission
and
submission
not
in
self
.
reject_with_defaults
...
...
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