/** * Retrieve the current test session as an AssessmentTestSession object from * persistent storage. * */ protected function retrieveTestSession() { $qtiStorage = $this->getStorage(); $sessionId = $this->getServiceCallId(); if ($qtiStorage->exists($sessionId) === false) { common_Logger::i("Instantiating QTI Assessment Test Session"); $this->setTestSession($qtiStorage->instantiate($this->getTestDefinition(), $sessionId)); $testTaker = \common_session_SessionManager::getSession()->getUser(); taoQtiTest_helpers_TestRunnerUtils::setInitialOutcomes($this->getTestSession(), $testTaker); } else { common_Logger::i("Retrieving QTI Assessment Test Session '{$sessionId}'..."); $this->setTestSession($qtiStorage->retrieve($this->getTestDefinition(), $sessionId)); } taoQtiTest_helpers_TestRunnerUtils::preserveOutcomes($this->getTestSession()); }