Permalink
Browse files

properly set altered item identifier

The identifier for an item would get an "ID_" added if it
didn't start with a valid character, but this new id wasn't
getting set for all references to this item

refs #4153

Change-Id: Ib770a2777de8207b2b0899dfa9759d04f395b3a0
Reviewed-on: https://gerrit.instructure.com/5769
Tested-by: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
  • Loading branch information...
1 parent 0de11b3 commit 262afefb5378df74286753b87425fa42e300fe84 @bracken bracken committed Sep 22, 2011
Showing with 4 additions and 3 deletions.
  1. +1 −0 lib/imscp.py
  2. +3 −3 lib/imsqtiv1.py
View
@@ -152,6 +152,7 @@ def __init__ (self):
def SetIdentifier (self,identifier):
self.id=identifier
self.FixIdentifier()
+ return self.id
def FixIdentifier (self):
# Must match correct syntax
View
@@ -1762,12 +1762,12 @@ def SetAttribute_label (self,value):
def SetAttribute_ident (self,value):
if self.item.identifier: return
- self.item.SetIdentifier(value);
- self.resource.GetLOM().GetGeneral().AddIdentifier(LOMIdentifier(None,value))
if ':' in value:
print "Warning: item identifier with colon: replaced with hyphen when making resource identifier."
value=string.join(string.split(value,':'),'-')
- self.resource.SetIdentifier(value);
+ value = self.resource.SetIdentifier(value);
+ self.item.SetIdentifier(value);
+ self.resource.GetLOM().GetGeneral().AddIdentifier(LOMIdentifier(None,value))
cp=self.GetRoot().cp
self.fName=cp.GetUniqueFileName(os.path.join("assessmentItems", self.resource.id+".xml"))

0 comments on commit 262afef

Please sign in to comment.