Skip to content
Browse files

fix for files used in more than one question, refs #5126

The tool wasn't sharing file data between questions, so the second copy
of the file would be copied and have its filename munged (incorrectly),
causing it to become a broken link.

Change-Id: Ica25a7582d5ccff2589093c350f3871f3c3069fe
Reviewed-on: https://gerrit.instructure.com/4770
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
  • Loading branch information...
1 parent 96a8874 commit 3f286a92e724bb9052cde31f663967e5e6172f7f @codekitchen codekitchen committed
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/imsqtiv1.py
View
8 lib/imsqtiv1.py
@@ -1659,7 +1659,13 @@ def __init__(self,name,attrs,parent):
cp=self.GetRoot().cp
# Reserve space for our preferred file name
self.fName=cp.GetUniqueFileName(os.path.join("assessmentItems", self.resource.id+".xml"))
- self.files={}
+ files_parent = self.parent
+ while files_parent and not hasattr(files_parent, 'files'):
+ files_parent = files_parent.parent
+ if files_parent:
+ self.files = files_parent.files
+ else:
+ self.files={}
def SetAttribute_maxattempts (self,value):
self.PrintWarning("Warning: maxattempts can not be controlled at item level, ignored: maxattempts='"+value+"'")

0 comments on commit 3f286a9

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