Skip to content
This repository
Browse code

ignore hint nodes in the wrong location

Change-Id: I6cf3716827ef25ee2d69aaff70351abdb109bc18
Reviewed-on: https://gerrit.instructure.com/5093
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Bracken Mosbacker <bracken@instructure.com>
  • Loading branch information...
commit 97e1c6a83c6c3d1bddc8538ee63011d4e97fb9ad 1 parent ac6e662
Bracken Mosbacker bracken authored

Showing 1 changed file with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. +5 2 lib/imsqtiv1.py
7 lib/imsqtiv1.py
@@ -292,6 +292,8 @@ def CheckLocation (self, expected_parents, tag, do_assert=True):
292 292 raise QTIException(eInvalidStructure,tag)
293 293 else:
294 294 print "Tag (%s) in unexpected location - parent: (%s)" % (tag, self.parent)
  295 + return False
  296 + return True
295 297
296 298
297 299 # Unsupported
@@ -4812,7 +4814,7 @@ def __init__(self,name,attrs,parent):
4812 4814 self.feedbackstyle="complete"
4813 4815 self.ParseAttributes(attrs)
4814 4816 # itemfeedback
4815   - self.CheckLocation((ItemFeedback),"<hint>")
  4817 + self.in_correct_location = self.CheckLocation((ItemFeedback),"<hint>", False)
4816 4818 self.div=xhtml_div()
4817 4819 if self.feedbackstyle!="complete":
4818 4820 hintclass='hint.'+self.feedbackstyle
@@ -4831,7 +4833,8 @@ def AppendElement (self,element):
4831 4833 self.div.AppendElement(element)
4832 4834
4833 4835 def CloseObject (self):
4834   - self.parent.AppendElement(self.div)
  4836 + if self.in_correct_location:
  4837 + self.parent.AppendElement(self.div)
4835 4838
4836 4839
4837 4840 # HintMaterial

0 comments on commit 97e1c6a

Please sign in to comment.
Something went wrong with that request. Please try again.