davemckain / qtiworks

**This project will be closed in early 2023!** IMS QTI 2.1 assessment delivery engine and Java development library (JQTI+). Supports the MathAssess extensions. Replacement for QTIEngine/JQTI and MathAssessEngine/JQTI. Note that this project has now ended and no further work is currently planned.
Other
67 stars 55 forks source link

Rendering of printedVariable blows up if @index is a variable reference #57

Open davemckain opened 9 years ago

davemckain commented 9 years ago

The rendering XSLT for printedVariable is currently expecting @index to be an integer, rather than integerOrVariableRef, and is consequently blowing up if the attribute is a variable reference.

davemckain commented 9 years ago

This one is going to require some effort to fix. The current rendering of printedVariable does all of the variable de-referencing within the XSLT. Handling integerOrVariableRef is non-trivial (as one can see from the corresponding implementation of this within the Java classes). I think it might be better to add an XML filter to the rendering pipeline the computes the final value for each printedVariable (using the existing Java logic) and substitutes the result into the XML before it gets passed to the rendering XSLT. That would simplify the amount of work the XSLT has to do here.