diff --git a/composer.json b/composer.json index 0baa27851..d7b4502ed 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "qtism/qtism", "description": "OAT QTI Software Module Library", "type": "library", - "version": "0.9.31", + "version": "0.9.32", "authors": [ { "name": "Open Assessment Technologies S.A.", diff --git a/qtism/data/storage/xml/Utils.php b/qtism/data/storage/xml/Utils.php index 511909ebf..0fe4604e5 100644 --- a/qtism/data/storage/xml/Utils.php +++ b/qtism/data/storage/xml/Utils.php @@ -67,21 +67,25 @@ public static function inferQTIVersion(DOMDocument $document) { } else { switch (trim($root->lookupNamespaceURI(null))) { - case 'http://www.imsglobal.org/xsd/imsqti_v2p1': - return '2.1'; - break; - - case 'http://www.imsglobal.org/xsd/apip/apipv1p0/qtiitem/imsqti_v2p1': - return '2.1'; - break; - - case 'http://www.imsglobal.org/xsd/imsqti_v2p0': - return '2.0'; - break; - - default: - return false; - break; + case 'http://www.imsglobal.org/xsd/imsqti_v2p1': + return '2.1'; + break; + + case 'http://www.imsglobal.org/xsd/apip/apipv1p0/qtiitem/imsqti_v2p1': + return '2.1'; + break; + + case 'http://www.imsglobal.org/xsd/apip/apipv1p0/qtiitem/imsqti_v2p2': + return '2.2'; + break; + + case 'http://www.imsglobal.org/xsd/imsqti_v2p0': + return '2.0'; + break; + + default: + return false; + break; } } } diff --git a/qtism/data/storage/xml/XmlDocument.php b/qtism/data/storage/xml/XmlDocument.php index b40ba005a..61ebf98c6 100644 --- a/qtism/data/storage/xml/XmlDocument.php +++ b/qtism/data/storage/xml/XmlDocument.php @@ -369,6 +369,11 @@ protected function decorateRootElement(DOMElement $rootElement) { $qtiSuffix = 'v2p0'; $xsdLocation = 'http://www.imsglobal.org/xsd/imsqti_v2p0.xsd'; break; + + case '2.2': + $qtiSuffix = 'v2p2'; + $xsdLocation = 'http://www.imsglobal.org/xsd/qti/qtiv2p2/imsqti_v2p2.xsd'; + break; } $rootElement->setAttribute('xmlns', "http://www.imsglobal.org/xsd/imsqti_${qtiSuffix}");