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
4f8dbc15
Commit
4f8dbc15
authored
Apr 24, 2014
by
Waheed Ahmed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed accessibility labels are not always created in problems.
STUD-1524
parent
c747ebdd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
common/lib/xmodule/xmodule/js/spec/problem/edit_spec.coffee
+1
-1
common/lib/xmodule/xmodule/js/src/problem/edit.coffee
+4
-3
No files found.
common/lib/xmodule/xmodule/js/spec/problem/edit_spec.coffee
View file @
4f8dbc15
...
@@ -538,7 +538,7 @@ describe 'MarkdownEditingDescriptor', ->
...
@@ -538,7 +538,7 @@ describe 'MarkdownEditingDescriptor', ->
<p>What is the capital of Germany?</p>
<p>What is the capital of Germany?</p>
<multiplechoiceresponse>
<multiplechoiceresponse>
<choicegroup type="MultipleChoice">
<choicegroup
label="What is the capital of Germany?"
type="MultipleChoice">
<choice correct="false">Bonn</choice>
<choice correct="false">Bonn</choice>
<choice correct="false">Hamburg</choice>
<choice correct="false">Hamburg</choice>
<choice correct="true">Berlin</choice>
<choice correct="true">Berlin</choice>
...
...
common/lib/xmodule/xmodule/js/src/problem/edit.coffee
View file @
4f8dbc15
...
@@ -359,7 +359,7 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
...
@@ -359,7 +359,7 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
//
looks
for
>>
arbitrary
text
<<
and
inserts
it
into
the
label
attribute
of
the
input
type
directly
below
the
text
.
//
looks
for
>>
arbitrary
text
<<
and
inserts
it
into
the
label
attribute
of
the
input
type
directly
below
the
text
.
var
split
=
xml
.
split
(
'
\n
'
);
var
split
=
xml
.
split
(
'
\n
'
);
var
new_xml
=
[];
var
new_xml
=
[];
var
line
,
i
,
curlabel
=
''
;
var
line
,
i
,
curlabel
,
prevlabel
=
''
;
var
didinput
=
false
;
var
didinput
=
false
;
for
(
i
=
0
;
i
<
split
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
split
.
length
;
i
++
)
{
line
=
split
[
i
];
line
=
split
[
i
];
...
@@ -370,13 +370,14 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
...
@@ -370,13 +370,14 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
.
replace
(
/"/g
,
'"'
)
.
replace
(
/"/g
,
'"'
)
.
replace
(
/'/g
,
'''
);
.
replace
(
/'/g
,
'''
);
line
=
line
.
replace
(
/>>|<</g
,
''
);
line
=
line
.
replace
(
/>>|<</g
,
''
);
}
else
if
(
line
.
match
(
/<\w+response/
)
&&
didinput
)
{
}
else
if
(
line
.
match
(
/<\w+response/
)
&&
didinput
&&
curlabel
==
prevlabel
)
{
//
reset
label
to
prevent
gobbling
up
previous
one
(
if
multiple
questions
)
//
reset
label
to
prevent
gobbling
up
previous
one
(
if
multiple
questions
)
curlabel
=
''
;
curlabel
=
''
;
didinput
=
false
;
didinput
=
false
;
}
else
if
(
line
.
match
(
/<(textline|optioninput|formulaequationinput|choicegroup|checkboxgroup)/
)
&&
curlabel
!=
''
)
{
}
else
if
(
line
.
match
(
/<(textline|optioninput|formulaequationinput|choicegroup|checkboxgroup)/
)
&&
curlabel
!=
''
&&
curlabel
!=
undefined
)
{
line
=
line
.
replace
(
/<(textline|optioninput|formulaequationinput|choicegroup|checkboxgroup)/
,
'<$1 label="'
+
curlabel
+
'"'
);
line
=
line
.
replace
(
/<(textline|optioninput|formulaequationinput|choicegroup|checkboxgroup)/
,
'<$1 label="'
+
curlabel
+
'"'
);
didinput
=
true
;
didinput
=
true
;
prevlabel
=
curlabel
;
}
}
new_xml
.
push
(
line
);
new_xml
.
push
(
line
);
}
}
...
...
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