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

Make it possible for JQTI+ to identify XHTML nodes #64

Open schmod opened 9 years ago

schmod commented 9 years ago

Would it be possible (or sensible) to add some sort of annotation or interface to the XHTML-derived nodes so that users of JQTI+ can determine the QTI elements that can be cleanly mapped to XHTML elements?

While the specification describes these elements as being a subset of XHTML, they are still a part of the QTI namespace, and the XSD does not provide any indication that they extend or derive from similar XHTML elements.

As a result of this, it becomes surprisingly difficult to perform seemingly-simple operations, eg. extracting the HTML content from a <simpleChoice>, while discarding any non-XHTML elements such as <feedbackInline> that are contained within the choice.

If this sounds like a desirable feature, I'd be willing to take a stab at an initial implementation.

davemckain commented 9 years ago

Hi there! That does sound like a useful feature to have, and hopefully shouldn't be too difficult to implement.

If you're willing to have a go at implementing this then that would be great. I guess you might want to create a marker interface called uk.ac.ed.ph.jqtiplus.node.XhtmlElement and then have the various XHTML classes implement it. (There are quite a lot so it might be a bit tedious. The class hierarchy gets a bit more complex than the QTI spec in places due to Java's single inheritance restriction.)

You may also want to look at adding some new methods to uk.ac.ed.ph.jqtiplus.utils.QueryUtils to perform the types of searches you suggested.

Does that sounds reasonable enough? Please do give a shout if you need any more from me and thanks for offering to help out.

Regards, David,