getItemSessionSubject($qtiXmlDoc); try { $itemSession->beginAttempt(); $itemSession->endAttempt(new State($variables)); } catch (AssessmentItemSessionException $e) { $msg = 'An error occurred while processing the responses.'; throw new RuntimeException($msg, 0, $e); } catch (taoQtiCommon_helpers_ResultTransmissionException $e) { $msg = 'An error occurred while transmitting a result to the target Result Server.'; throw new RuntimeException($msg, 0, $e); } return $itemSession; } /** * @param XmlDocument $qtiXmlDoc * @return AssessmentItemSession */ private function getItemSessionSubject($qtiXmlDoc) { $sessionManager = new SessionManager(); $itemSession = new AssessmentItemSession($qtiXmlDoc->getDocumentComponent(), $sessionManager); $itemSession->beginItemSession(); return $itemSession; } }