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
ff999d76
Commit
ff999d76
authored
Jul 13, 2016
by
Ehtesham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test fixes
parent
62059b58
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
12 deletions
+7
-12
common/lib/capa/capa/capa_problem.py
+1
-8
common/lib/capa/capa/inputtypes.py
+1
-1
common/lib/capa/capa/tests/test_input_templates.py
+5
-3
No files found.
common/lib/capa/capa/capa_problem.py
View file @
ff999d76
...
@@ -862,17 +862,10 @@ class LoncapaProblem(object):
...
@@ -862,17 +862,10 @@ class LoncapaProblem(object):
entry
.
attrib
[
'id'
]
=
"
%
s_
%
i_
%
i"
%
(
self
.
problem_id
,
response_id
,
answer_id
)
entry
.
attrib
[
'id'
]
=
"
%
s_
%
i_
%
i"
%
(
self
.
problem_id
,
response_id
,
answer_id
)
answer_id
=
answer_id
+
1
answer_id
=
answer_id
+
1
p_ids
=
[]
for
p_index
,
p_element
in
enumerate
(
response
.
findall
(
'.//p'
)):
p_tag_id
=
'{}_q{}_desc{}'
.
format
(
self
.
problem_id
,
response_id
,
p_index
)
p_element
.
attrib
[
'id'
]
=
p_tag_id
p_ids
.
append
(
p_tag_id
)
# Find the label and save it for html transformation step
# Find the label and save it for html transformation step
responsetype_label
=
response
.
find
(
'label'
)
responsetype_label
=
response
.
find
(
'label'
)
problem_data
[
self
.
problem_id
+
'_'
+
str
(
response_id
)]
=
{
problem_data
[
self
.
problem_id
+
'_'
+
str
(
response_id
)]
=
{
'label'
:
responsetype_label
.
text
if
responsetype_label
is
not
None
else
''
,
'label'
:
responsetype_label
.
text
if
responsetype_label
is
not
None
else
''
'p_ids'
:
p_ids
}
}
# instantiate capa Response
# instantiate capa Response
...
...
common/lib/capa/capa/inputtypes.py
View file @
ff999d76
...
@@ -320,7 +320,7 @@ class InputTypeBase(object):
...
@@ -320,7 +320,7 @@ class InputTypeBase(object):
'STATIC_URL'
:
self
.
capa_system
.
STATIC_URL
'STATIC_URL'
:
self
.
capa_system
.
STATIC_URL
}
}
if
self
.
response_data
is
not
None
:
if
self
.
response_data
and
self
.
response_data
[
'label'
]
!=
''
:
context
[
'response_data'
]
=
self
.
response_data
context
[
'response_data'
]
=
self
.
response_data
context
.
update
(
context
.
update
(
...
...
common/lib/capa/capa/tests/test_input_templates.py
View file @
ff999d76
...
@@ -128,7 +128,9 @@ class ChoiceGroupTemplateTest(TemplateTestCase):
...
@@ -128,7 +128,9 @@ class ChoiceGroupTemplateTest(TemplateTestCase):
'label'
:
'test'
,
'label'
:
'test'
,
'input_type'
:
'checkbox'
,
'input_type'
:
'checkbox'
,
'name_array_suffix'
:
'1'
,
'name_array_suffix'
:
'1'
,
'value'
:
'3'
}
'value'
:
'3'
,
'response_data'
:
{
'label'
:
'test'
}
}
super
(
ChoiceGroupTemplateTest
,
self
)
.
setUp
()
super
(
ChoiceGroupTemplateTest
,
self
)
.
setUp
()
def
test_problem_marked_correct
(
self
):
def
test_problem_marked_correct
(
self
):
...
@@ -340,8 +342,8 @@ class ChoiceGroupTemplateTest(TemplateTestCase):
...
@@ -340,8 +342,8 @@ class ChoiceGroupTemplateTest(TemplateTestCase):
def
test_label
(
self
):
def
test_label
(
self
):
xml
=
self
.
render_to_xml
(
self
.
context
)
xml
=
self
.
render_to_xml
(
self
.
context
)
xpath
=
"//
fieldset[@aria-label='
%
s']"
%
self
.
context
[
'label'
]
xpath
=
"//
legend"
self
.
assert_has_
xpath
(
xml
,
xpath
,
self
.
context
)
self
.
assert_has_
text
(
xml
,
xpath
,
self
.
context
[
'label'
]
)
class
TextlineTemplateTest
(
TemplateTestCase
):
class
TextlineTemplateTest
(
TemplateTestCase
):
...
...
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