arleyschrock / qtimigration

Automatically exported from code.google.com/p/qtimigration
0 stars 0 forks source link

Not all identifiers output match QTI2 standard #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The QTI2 spec says all identifiers have to match the "only certain chars,
must start with XML Letter or underscore". Only certain identifiers are
fixed at present.

The attached patch fixes all other identifiers. May not be necessary in all
three classes modified in imsqti.py -- didn't investigate what they're all
for in too much detail.

--bart

Original issue reported on code.google.com by wemoloht...@gmail.com on 10 Sep 2009 at 5:21

Attachments:

GoogleCodeExporter commented 8 years ago
I should probably say that the particular identifier which was giving us 
problems was
that of the assessmentItem element.

Original comment by wemoloht...@gmail.com on 10 Sep 2009 at 5:26

GoogleCodeExporter commented 8 years ago
I should have spotted this before but the assessmentItem element does not have 
an identifier that conforms to the definition of the identifier type.  This is 
a bit confusing but assessmentItem.identifier is actually broadly defined as 
'string' for compatibility with the metadata usage of identifier.  In 
particular, it is designed to encompass the use of URNs, which is at odds with 
in-document references conforming to XML IDs.

In all other cases, the identifiers are checked against the "ReadIdentifier" 
method before being used to set attributes of QTI v2 elements.  I take the 
point that the QTI v2 elements should have methods to allow unchecked values to 
be assigned and this is the approach I've taken in the new pyslet module where 
attributes can be set by name, e.g. 
element.SetAttribute('identifier',"RESPONSE") when untrusted values are being 
used.

Triggered by this investigation I have made one change though, in developing 
the new pyslet module I discovered a bug in the ReadIdentifier method so I've 
linked in the new validation function instead to fix an issue with identifiers 
that started with a ':'.  The new routine also supports validation of 
international identifiers which previously generated warnings about being 
unchecked.

Original comment by steve.w....@gmail.com on 8 Jun 2011 at 8:16