public function readPendingResponses(AssessmentTestSeeker $seeker)
    {
        try {
            // Read the state.
            $state = new State();
            $varCount = $this->readTinyInt();

            for ($i = 0; $i < $varCount; $i++) {
                $responseDeclaration = $seeker->seekComponent('responseDeclaration', $this->readShort());
                $responseVariable = ResponseVariable::createFromDataModel($responseDeclaration);
                $this->readVariableValue($responseVariable);
                $state->setVariable($responseVariable);
            }

            // Read the assessmentItemRef.
            $itemRef = $seeker->seekComponent('assessmentItemRef', $this->readShort());

            // Read the occurence number.
            $occurence = $this->readTinyInt();

            return new PendingResponses($state, $itemRef, $occurence);
        } catch (BinaryStreamAccessException $e) {
            $msg = "An error occured while reading some pending responses.";
            throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::PENDING_RESPONSES, $e);
        } catch (OutOfBoundsException $e) {
            $msg = "A QTI component was not found in the assessmentTest tree structure.";
            throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::PENDING_RESPONSES, $e);
        }
    }
public function readPendingResponses(AssessmentTestSeeker $seeker)
    {
        try {
            // Read the state.
            $state = new State();
            $varCount = $this->readTinyInt();

            for ($i = 0; $i < $varCount; $i++) {
                $responseDeclaration = $seeker->seekComponent('responseDeclaration', $this->readShort());
                $responseVariable = ResponseVariable::createFromDataModel($responseDeclaration);
                $this->readVariableValue($responseVariable);
                $state->setVariable($responseVariable);
            }

            // Read the assessmentItemRef.
            $itemRef = $seeker->seekComponent('assessmentItemRef', $this->readShort());

            // Read the occurence number.
            $occurence = $this->readTinyInt();

            return new PendingResponses($state, $itemRef, $occurence);
        } catch (BinaryStreamAccessException $e) {
            $msg = "An error occured while reading some pending responses.";
            throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::PENDING_RESPONSES, $e);
        } catch (OutOfBoundsException $e) {
            $msg = "A QTI component was not found in the assessmentTest tree structure.";
            throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::PENDING_RESPONSES, $e);
        }
    }
public function readPendingResponses ( AssessmentTestSeeker $ seeker ) { try { // Read the state. $ state = new State ( ) ; $ varCount = $ this -> readTinyInt ( ) ; for ( $ i = 0 ; $ i < $ varCount ; $ i ++ ) { $ responseDeclaration = $ seeker -> seekComponent ( 'responseDeclaration' , $ this -> readShort ( ) ) ; $ responseVariable = ResponseVariable :: createFromDataModel ( $ responseDeclaration ) ; $ this -> readVariableValue ( $ responseVariable ) ; $ state -> setVariable ( $ responseVariable ) ; } // Read the assessmentItemRef. $ itemRef = $ seeker -> seekComponent ( 'assessmentItemRef' , $ this -> readShort ( ) ) ; // Read the occurence number. $ occurence = $ this -> readTinyInt ( ) ; return new PendingResponses ( $ state , $ itemRef , $ occurence ) ; } catch ( BinaryStreamAccessException $ e ) { $ msg = "An error occured while reading some pending responses." ; throw new QtiBinaryStreamAccessException ( $ msg , $ this , QtiBinaryStreamAccessException :: PENDING_RESPONSES , $ e ) ; } catch ( OutOfBoundsException $ e ) { $ msg = "A QTI component was not found in the assessmentTest tree structure." ; throw new QtiBinaryStreamAccessException ( $ msg , $ this , QtiBinaryStreamAccessException :: PENDING_RESPONSES , $ e ) ; } }
Read a PendingResponse object from the current binary stream.

@param \qtism\runtime\storage\common\AssessmentTestSeeker $seeker An AssessmentTestSeeker object in order to know tree position for involved QTI Components.
@return \qtism\runtime\tests\PendingResponses A PendingResponses object.
@throws \qtism\runtime\storage\binary\QtiBinaryStreamAccessException
Read a PendingResponse object from the current binary stream .