Commit e9e5f81f by Braden MacDonald

Don't preserve empty <tip>s

parent d9c256cd
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
</pb-mcq> </pb-mcq>
<pb-rating name="frog-important" low="Not at all important to me" high="Very important to me" question="How important is it to you?" correct_choices='["4","5","1","2","3","understand"]'> <pb-rating name="frog-important" low="Not at all important to me" high="Very important to me" question="How important is it to you?" correct_choices='["4","5","1","2","3","understand"]'>
<pb-choice value="understand">I don't understand</pb-choice> <pb-choice value="understand">I don't understand</pb-choice>
<pb-tip values='["4","5"]'>Great!</pb-tip>
<pb-tip values='["1","2","3"]'>The Trial of Uruk-Shan helps you uncover some of the core beliefs and assumptions you have held that are preventing you from making change.</pb-tip> <pb-tip values='["1","2","3"]'>The Trial of Uruk-Shan helps you uncover some of the core beliefs and assumptions you have held that are preventing you from making change.</pb-tip>
<pb-tip values='["understand"]'>A frog is important if it is one that could make a big difference in helping you reach your frogs in your work life or your personal life (or both).</pb-tip> <pb-tip values='["understand"]'>A frog is important if it is one that could make a big difference in helping you reach your frogs in your work life or your personal life (or both).</pb-tip>
</pb-rating> </pb-rating>
......
...@@ -40,7 +40,7 @@ This contains a typical problem taken from a live course (content changed) ...@@ -40,7 +40,7 @@ This contains a typical problem taken from a live course (content changed)
<quizz name="frog-important" type="rating" low="Not at all important to me" high="Very important to me"> <quizz name="frog-important" type="rating" low="Not at all important to me" high="Very important to me">
<question>How important is it to you?</question> <question>How important is it to you?</question>
<choice value="understand">I don't understand</choice> <choice value="understand">I don't understand</choice>
<tip display="4,5">Great!</tip> <tip display="4,5"> </tip>
<tip display="1,2,3">The Trial of Uruk-Shan helps you uncover some of the core beliefs and assumptions you have held that are preventing you from making change.</tip> <tip display="1,2,3">The Trial of Uruk-Shan helps you uncover some of the core beliefs and assumptions you have held that are preventing you from making change.</tip>
<tip display="understand">A frog is important if it is one that could make a big difference in helping you reach your frogs in your work life or your personal life (or both).</tip> <tip display="understand">A frog is important if it is one that could make a big difference in helping you reach your frogs in your work life or your personal life (or both).</tip>
</quizz> </quizz>
......
...@@ -283,6 +283,9 @@ class TipChanges(Change): ...@@ -283,6 +283,9 @@ class TipChanges(Change):
warnings.warn("Invalid <tip> element found.") warnings.warn("Invalid <tip> element found.")
return return
self.node.attrib["values"] = value self.node.attrib["values"] = value
if (self.node.text is None or self.node.text.strip() == "") and not list(self.node):
# This tip is blank.
p.remove(self.node)
class AlternatingHTMLToQuestions(Change): class AlternatingHTMLToQuestions(Change):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment