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
ed20fe34
Commit
ed20fe34
authored
Dec 18, 2012
by
Alexander Kryklia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix inputs id
parent
5ab1abf5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
common/lib/xmodule/xmodule/gst_module.py
+7
-7
No files found.
common/lib/xmodule/xmodule/gst_module.py
View file @
ed20fe34
...
...
@@ -126,19 +126,18 @@ class GraphicalSliderToolModule(XModule):
# substitute inputs if we have them
input_el
=
'<input class="{element_class}_input"
\
id="{element_id}_input_{var}"
\
id="{element_id}_input_{var}
_{input_index}
"
\
data-var="{var}" style="{style}"
\
data-el_readonly="{readonly}"/>'
for
var
in
variables
:
input_index
=
0
# make multiple inputs for same variable have
# different id
for
var
in
variables
:
input_index
=
+
1
instances
=
re
.
findall
(
r'\$\s*input\s+(?=.*var\=[\"\']'
+
var
+
'[
\"\'
])'
\
+
r'[^\$]*\$'
,
html_string
)
# import ipdb; ipdb.set_trace()
for
input_def
in
instances
:
# for multiple inputs per var
input_index
+=
1
# extract var and readonly before style!
var_substring
=
re
.
search
(
r'(var\=[\"\']'
+
var
+
r'[\"\'])'
,
input_def
)
.
group
()
...
...
@@ -154,10 +153,11 @@ class GraphicalSliderToolModule(XModule):
style
=
style
.
groups
()[
0
]
else
:
style
=
''
# import ipdb; ipdb.set_trace()
replacement
=
input_el
.
format
(
element_class
=
self
.
html_class
,
element_id
=
self
.
html_id
+
'_'
+
str
(
input_index
),
var
=
var
,
readonly
=
readonly
,
style
=
style
)
element_id
=
self
.
html_id
,
var
=
var
,
readonly
=
readonly
,
style
=
style
,
input_index
=
input_index
)
# import ipdb; ipdb.set_trace()
html_string
=
re
.
sub
(
r'\$\s*input\s+(?=.*var\=[\"\']('
+
\
var
+
')[
\"\'
])'
+
r'[^\$]*\$'
,
...
...
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