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
6ef2031f
Commit
6ef2031f
authored
Aug 31, 2016
by
Muzaffar yousaf
Committed by
GitHub
Aug 31, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13337 from edx/ekafeel/tnl-5321
tnl-5321 Remove formatting error label
parents
9221450e
d0bfdd2b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
48 deletions
+9
-48
common/lib/capa/capa/capa_problem.py
+0
-9
common/lib/capa/capa/templates/choicetext.html
+3
-3
common/lib/capa/capa/templates/textline.html
+3
-3
common/lib/capa/capa/tests/test_capa_problem.py
+0
-28
common/lib/capa/capa/tests/test_html_render.py
+1
-2
common/lib/xmodule/xmodule/tests/test_capa_module.py
+2
-3
No files found.
common/lib/capa/capa/capa_problem.py
View file @
6ef2031f
...
...
@@ -72,8 +72,6 @@ log = logging.getLogger(__name__)
#-----------------------------------------------------------------------------
# main class for this module
DEFAULT_QUESTION_TEXT
=
"Formatting error: You must explicitly specify the question text."
class
LoncapaSystem
(
object
):
"""
...
...
@@ -967,17 +965,10 @@ class LoncapaProblem(object):
label
=
label_tag
[
0
]
.
text
element_to_be_deleted
=
label_tag
[
0
]
label
=
label
.
strip
()
or
DEFAULT_QUESTION_TEXT
# delete label or p element only if responsetype is fully accessible
if
response
.
tag
in
ACCESSIBLE_CAPA_RESPONSE_TYPES
and
element_to_be_deleted
is
not
None
:
element_to_be_deleted
.
getparent
()
.
remove
(
element_to_be_deleted
)
# for non-accessible responsetypes it may be possible that label attribute is not present
# in this case pass an empty label. remember label attribute is only used as value for aria-label
if
response
.
tag
not
in
ACCESSIBLE_CAPA_RESPONSE_TYPES
and
label
==
DEFAULT_QUESTION_TEXT
:
label
=
''
# Extract descriptions and set unique id on each description tag
description_tags
=
response
.
findall
(
'description'
)
description_id
=
1
...
...
common/lib/capa/capa/templates/choicetext.html
View file @
6ef2031f
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<
%
element_checked =
False
%
>
% for choice_id, _ in choices:
<
%
choice_id =
choice_id
%
>
<
%
choice_id =
choice_id
%
>
%if choice_id in value:
<
%
element_checked =
True
%
>
%endif
%endfor
%
endfor
<section
id=
"choicetextinput_${id}"
class=
"choicetextinput"
>
<form
class=
"choicetextgroup capa_inputtype"
id=
"inputtype_${id}"
>
<div
class=
"script_placeholder"
data-src=
"${STATIC_URL}js/capa/choicetextinput.js"
/>
<fieldset
aria-label=
"${response_data['label']}"
>
% for choice_id, choice_description in choices:
<
%
choice_id
=
choice_id
%
>
<
%
choice_id
=
choice_id
%
>
<section
id=
"forinput${choice_id}"
%
if
input_type =
=
'
radio
'
and
choice_id
in
value
:
<%
...
...
common/lib/capa/capa/templates/textline.html
View file @
6ef2031f
...
...
@@ -56,8 +56,8 @@
</div>
% endif
% if msg:
<span
class=
"message"
>
${HTML(msg)}
</span>
% endif
% if msg:
<span
class=
"message"
>
${HTML(msg)}
</span>
% endif
</div>
common/lib/capa/capa/tests/test_capa_problem.py
View file @
6ef2031f
...
...
@@ -7,7 +7,6 @@ from lxml import etree
import
unittest
from
.
import
new_loncapa_problem
from
capa.capa_problem
import
DEFAULT_QUESTION_TEXT
class
CAPAProblemTest
(
unittest
.
TestCase
):
...
...
@@ -159,33 +158,6 @@ class CAPAProblemTest(unittest.TestCase):
}
)
def
test_default_question_text
(
self
):
"""
Verify that default question text is shown when question is missing.
"""
xml
=
"""
<problem>
<p>Be sure to check your spelling.</p>
<stringresponse answer="War" type="ci">
<description>Everybody needs somebody to talk to.</description>
<textline size="40"/>
</stringresponse>
</problem>
"""
problem
=
new_loncapa_problem
(
xml
)
self
.
assertEqual
(
problem
.
problem_data
,
{
'1_2_1'
:
{
'label'
:
DEFAULT_QUESTION_TEXT
,
'descriptions'
:
{
'description_1_1_1'
:
"Everybody needs somebody to talk to."
}
}
}
)
def
test_question_is_not_removed
(
self
):
"""
Verify that tag with question text is not removed when responsetype is not fully accessible.
...
...
common/lib/capa/capa/tests/test_html_render.py
View file @
6ef2031f
...
...
@@ -7,7 +7,6 @@ import mock
from
.response_xml_factory
import
StringResponseXMLFactory
,
CustomResponseXMLFactory
from
.
import
test_capa_system
,
new_loncapa_problem
from
capa.capa_problem
import
DEFAULT_QUESTION_TEXT
class
CapaHtmlRenderTest
(
unittest
.
TestCase
):
...
...
@@ -186,7 +185,7 @@ class CapaHtmlRenderTest(unittest.TestCase):
'id'
:
'1_2_1'
,
'trailing_text'
:
''
,
'size'
:
None
,
'response_data'
:
{
'label'
:
DEFAULT_QUESTION_TEXT
,
'descriptions'
:
{}},
'response_data'
:
{
'label'
:
''
,
'descriptions'
:
{}},
'describedby'
:
''
}
...
...
common/lib/xmodule/xmodule/tests/test_capa_module.py
View file @
6ef2031f
...
...
@@ -21,7 +21,6 @@ from webob.multidict import MultiDict
import
xmodule
from
xmodule.tests
import
DATA_DIR
from
capa
import
responsetypes
from
capa.capa_problem
import
DEFAULT_QUESTION_TEXT
from
capa.responsetypes
import
(
StudentInputError
,
LoncapaProblemError
,
ResponseError
)
from
capa.xqueue_interface
import
XQueueInterface
...
...
@@ -2652,7 +2651,7 @@ class TestProblemCheckTracking(unittest.TestCase):
event
=
self
.
get_event_for_answers
(
module
,
answer_input_dict
)
self
.
assertEquals
(
event
[
'submission'
],
{
factory
.
answer_key
(
2
):
{
'question'
:
DEFAULT_QUESTION_TEXT
,
'question'
:
''
,
'answer'
:
'3.14'
,
'response_type'
:
'numericalresponse'
,
'input_type'
:
'textline'
,
...
...
@@ -2783,7 +2782,7 @@ class TestProblemCheckTracking(unittest.TestCase):
event
=
self
.
get_event_for_answers
(
module
,
answer_input_dict
)
self
.
assertEquals
(
event
[
'submission'
],
{
factory
.
answer_key
(
2
):
{
'question'
:
DEFAULT_QUESTION_TEXT
,
'question'
:
''
,
'answer'
:
'3.14'
,
'response_type'
:
'numericalresponse'
,
'input_type'
:
'textline'
,
...
...
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