Browse files

make sections within a bank their own banks

refs #5857

Change-Id: Id0748810e95427c805a4f5c3b92623a7e1afbf62
Reviewed-on: https://gerrit.instructure.com/6497
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Bracken Mosbacker <bracken@instructure.com>
  • Loading branch information...
1 parent cfa87ed commit 09d0df8ce8850f161a77d98846b2a2715ffa234c @bracken bracken committed Oct 26, 2011
Showing with 14 additions and 5 deletions.
  1. +14 −5 lib/imsqtiv1.py
View
19 lib/imsqtiv1.py
@@ -1324,13 +1324,16 @@ def __init__(self,name,attrs,parent):
InstructureHelperContainer.__init__(self)
self.parent=parent
self.CheckLocation((QTIAssessment,QTISection, QTIObjectBank, QuesTestInterop),"<section>")
- self.question_bank = None
+ if isinstance(self.parent, QTIObjectBank):
+ self.question_bank = self
+ else:
+ self.question_bank = None
if hasattr(self.parent, 'question_bank'):
self.question_bank = self.parent.question_bank
self.parser=self.GetParser()
self.section=AssessmentSection()
self.ParseAttributes(attrs)
-
+
def SetAttribute_ident (self,value):
self.section.SetIdentifier(value)
@@ -1339,7 +1342,7 @@ def SetAttribute_title (self,value):
def SetAttribute_visible(self, visible):
self.section.SetVisible(visible)
-
+
def SetDuration(self, duration):
#todo: if it's a testPart it can be set...
pass
@@ -1369,10 +1372,16 @@ def AddItemReference(self, ref, fName, weight=None):
self.section.AddItemReference(ref, fName, weight)
def GetBankId(self):
- return self.parent.GetBankId()
+ if isinstance(self.parent, QTIObjectBank):
+ return self.section.identifier
+ else:
+ return self.parent.GetBankId()
def GetBankName(self):
- return self.parent.GetBankName()
+ if isinstance(self.parent, QTIObjectBank):
+ return self.section.title
+ else:
+ return self.parent.GetBankName()
def GetItemV1 (self):
return self

0 comments on commit 09d0df8

Please sign in to comment.