Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
problem-builder
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
OpenEdx
problem-builder
Commits
4f5904c3
Commit
4f5904c3
authored
Apr 22, 2015
by
Braden MacDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deal with invalid <tip> elements when the desired meaning can be inferred
parent
b3cb55c8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
problem_builder/v1/xml_changes.py
+6
-2
No files found.
problem_builder/v1/xml_changes.py
View file @
4f5904c3
...
...
@@ -282,7 +282,7 @@ class TipChanges(Change):
elif
self
.
node
.
attrib
.
get
(
"reject"
):
value
=
self
.
node
.
attrib
.
pop
(
"reject"
)
else
:
warnings
.
warn
(
"Invalid <tip> element found."
)
warnings
.
warn
(
u"Invalid <tip> element found: {}"
.
format
(
etree
.
tostring
(
self
.
node
))
)
return
else
:
# This is an MCQ or Rating question:
...
...
@@ -291,8 +291,12 @@ class TipChanges(Change):
add_to_list
(
"correct_choices"
,
value
)
elif
self
.
node
.
attrib
.
get
(
"reject"
):
value
=
self
.
node
.
attrib
.
pop
(
"reject"
)
elif
self
.
node
.
attrib
.
get
(
"require"
):
value
=
self
.
node
.
attrib
.
pop
(
"require"
)
add_to_list
(
"correct_choices"
,
value
)
warnings
.
warn
(
u"<tip> element in an MCQ/Rating used 'require' rather than 'display'"
)
else
:
warnings
.
warn
(
"Invalid <tip> element found."
)
warnings
.
warn
(
u"Invalid <tip> element found: {}"
.
format
(
etree
.
tostring
(
self
.
node
))
)
return
self
.
node
.
attrib
[
"values"
]
=
value
if
(
self
.
node
.
text
is
None
or
self
.
node
.
text
.
strip
()
==
""
)
and
not
list
(
self
.
node
):
...
...
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