/** * Retrieve the Test Definition the test session is built from as an AssessmentTest object. * * @param string $qtiTestCompilation (e.g. <i>'http://sample/first.rdf#i14363448108243883-|http://sample/first.rdf#i14363448109065884+'</i>) * * @return AssessmentTest The AssessmentTest object the current test session is built from. */ public static function getTestDefinition($qtiTestCompilation) { $directoryIds = explode('|', $qtiTestCompilation); $data = \tao_models_classes_service_FileStorage::singleton()->getDirectoryById($directoryIds[0])->read(TAOQTITEST_COMPILED_FILENAME); common_Logger::d("Loading QTI-PHP file from stream"); $doc = new PhpDocument(); $doc->loadFromString($data); return $doc->getDocumentComponent(); }