Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx
edx-platform
Commits
31ed1081
Commit
31ed1081
authored
Feb 14, 2013
by
Vasyl Nakvasiuk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add required_html_ids for ConditionalModule
parent
0f200ae8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
common/lib/xmodule/xmodule/conditional_module.py
+7
-1
lms/templates/conditional_ajax.html
+8
-1
No files found.
common/lib/xmodule/xmodule/conditional_module.py
View file @
31ed1081
...
@@ -65,6 +65,7 @@ class ConditionalModule(XModule):
...
@@ -65,6 +65,7 @@ class ConditionalModule(XModule):
def
is_condition_satisfied
(
self
):
def
is_condition_satisfied
(
self
):
self
.
required_modules
=
[
self
.
system
.
get_module
(
descriptor
.
location
)
for
self
.
required_modules
=
[
self
.
system
.
get_module
(
descriptor
.
location
)
for
descriptor
in
self
.
descriptor
.
get_required_module_descriptors
()]
descriptor
in
self
.
descriptor
.
get_required_module_descriptors
()]
xml_value
,
attr_name
=
self
.
_get_condition
()
xml_value
,
attr_name
=
self
.
_get_condition
()
if
xml_value
and
self
.
required_modules
:
if
xml_value
and
self
.
required_modules
:
...
@@ -85,10 +86,15 @@ class ConditionalModule(XModule):
...
@@ -85,10 +86,15 @@ class ConditionalModule(XModule):
return
False
return
False
def
get_html
(
self
):
def
get_html
(
self
):
# Calculate html ids of dependencies
self
.
required_html_ids
=
[
descriptor
.
location
.
html_id
()
for
descriptor
in
self
.
descriptor
.
get_required_module_descriptors
()]
return
self
.
system
.
render_template
(
'conditional_ajax.html'
,
{
return
self
.
system
.
render_template
(
'conditional_ajax.html'
,
{
'element_id'
:
self
.
location
.
html_id
(),
'element_id'
:
self
.
location
.
html_id
(),
'id'
:
self
.
id
,
'id'
:
self
.
id
,
'ajax_url'
:
self
.
system
.
ajax_url
'ajax_url'
:
self
.
system
.
ajax_url
,
'depends'
:
';'
.
join
(
self
.
required_html_ids
)
})
})
def
handle_ajax
(
self
,
dispatch
,
post
):
def
handle_ajax
(
self
,
dispatch
,
post
):
...
...
lms/templates/conditional_ajax.html
View file @
31ed1081
<div
id=
"conditional_${element_id}"
class=
"conditional-wrapper"
data-problem-id=
"${id}"
data-url=
"${ajax_url}"
></div>
<div
id=
"conditional_${element_id}"
class=
"conditional-wrapper"
data-problem-id=
"${id}"
data-url=
"${ajax_url}"
depends=
"${depends}"
>
</div>
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