public function instantiate($config = 0, $sessionId = '')
    {
        // If not provided, generate a session ID.
        if (empty($sessionId) === true) {
            $sessionId = uniqid('qtism', true);
        }

        try {
            $session = $this->getManager()->createAssessmentTestSession($this->getAssessmentTest(), null, $config);
            $session->setSessionId($sessionId);

            return $session;
        } catch (Exception $e) {
            $msg = "An error occured while instantiating the given AssessmentTest.";
            throw new StorageException($msg, StorageException::INSTANTIATION, $e);
        }
    }
public function instantiate($config = 0, $sessionId = '')
    {
        // If not provided, generate a session ID.
        if (empty($sessionId) === true) {
            $sessionId = uniqid('qtism', true);
        }

        try {
            $session = $this->getManager()->createAssessmentTestSession($this->getAssessmentTest(), null, $config);
            $session->setSessionId($sessionId);

            return $session;
        } catch (Exception $e) {
            $msg = "An error occured while instantiating the given AssessmentTest.";
            throw new StorageException($msg, StorageException::INSTANTIATION, $e);
        }
    }
public function instantiate ( $ config = 0 , $ sessionId = '' ) { // If not provided, generate a session ID. if ( empty ( $ sessionId ) === true ) { $ sessionId = uniqid ( 'qtism' , true ) ; } try { $ session = $ this -> getManager ( ) -> createAssessmentTestSession ( $ this -> getAssessmentTest ( ) , null , $ config ) ; $ session -> setSessionId ( $ sessionId ) ; return $ session ; } catch ( Exception $ e ) { $ msg = "An error occured while instantiating the given AssessmentTest." ; throw new StorageException ( $ msg , StorageException :: INSTANTIATION , $ e ) ; } }
Instantiate a new AssessmentTestSession.

@param integer $config (optional) The configuration to be taken into account for the instantiated AssessmentTestSession object.
@param string $sessionId An session ID. If not provided, a new session ID will be generated and given to the AssessmentTestSession.
@return \qtism\runtime\tests\AssessmentTestSession An AssessmentTestSession object.
Instantiate a new AssessmentTestSession .