public function readRouteItem(AssessmentTestSeeker $seeker)
    {
        try {
            $occurence = $this->readTinyInt();
            $itemRef = $seeker->seekComponent('assessmentItemRef', $this->readShort());
            $testPart = $seeker->seekComponent('testPart', $this->readShort());

            $sectionsCount = $this->readTinyInt();
            $sections = new AssessmentSectionCollection();

            for ($i = 0; $i < $sectionsCount; $i++) {
                $sections[] = $seeker->seekComponent('assessmentSection', $this->readShort());
            }

            $branchRulesCount = $this->readTinyInt();
            $branchRules = new BranchRuleCollection();

            for ($i = 0; $i < $branchRulesCount; $i++) {
                $branchRules[] = $seeker->seekComponent('branchRule', $this->readShort());
            }

            $preConditionsCount = $this->readTinyInt();
            $preConditions = new PreConditionCollection();

            for ($i = 0; $i < $preConditionsCount; $i++) {
                $preConditions[] = $seeker->seekComponent('preCondition', $this->readShort());
            }

            $routeItem = new RouteItem($itemRef, $sections, $testPart, $seeker->getAssessmentTest());
            $routeItem->setOccurence($occurence);
            $routeItem->setBranchRules($branchRules);
            $routeItem->setPreConditions($preConditions);

            return $routeItem;
        } catch (BinaryStreamAccessException $e) {
            $msg = "An error occured while reading a route item.";
            throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::ROUTE_ITEM, $e);
        } catch (OutOfBoundsException $e) {
            $msg = "A QTI Component was not found in the assessmentTest tree structure.";
            throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::ROUTE_ITEM, $e);
        }
    }
public function readRouteItem(AssessmentTestSeeker $seeker)
    {
        try {
            $occurence = $this->readTinyInt();
            $itemRef = $seeker->seekComponent('assessmentItemRef', $this->readShort());
            $testPart = $seeker->seekComponent('testPart', $this->readShort());

            $sectionsCount = $this->readTinyInt();
            $sections = new AssessmentSectionCollection();

            for ($i = 0; $i < $sectionsCount; $i++) {
                $sections[] = $seeker->seekComponent('assessmentSection', $this->readShort());
            }

            $branchRulesCount = $this->readTinyInt();
            $branchRules = new BranchRuleCollection();

            for ($i = 0; $i < $branchRulesCount; $i++) {
                $branchRules[] = $seeker->seekComponent('branchRule', $this->readShort());
            }

            $preConditionsCount = $this->readTinyInt();
            $preConditions = new PreConditionCollection();

            for ($i = 0; $i < $preConditionsCount; $i++) {
                $preConditions[] = $seeker->seekComponent('preCondition', $this->readShort());
            }

            $routeItem = new RouteItem($itemRef, $sections, $testPart, $seeker->getAssessmentTest());
            $routeItem->setOccurence($occurence);
            $routeItem->setBranchRules($branchRules);
            $routeItem->setPreConditions($preConditions);

            return $routeItem;
        } catch (BinaryStreamAccessException $e) {
            $msg = "An error occured while reading a route item.";
            throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::ROUTE_ITEM, $e);
        } catch (OutOfBoundsException $e) {
            $msg = "A QTI Component was not found in the assessmentTest tree structure.";
            throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::ROUTE_ITEM, $e);
        }
    }
public function readRouteItem ( AssessmentTestSeeker $ seeker ) { try { $ occurence = $ this -> readTinyInt ( ) ; $ itemRef = $ seeker -> seekComponent ( 'assessmentItemRef' , $ this -> readShort ( ) ) ; $ testPart = $ seeker -> seekComponent ( 'testPart' , $ this -> readShort ( ) ) ; $ sectionsCount = $ this -> readTinyInt ( ) ; $ sections = new AssessmentSectionCollection ( ) ; for ( $ i = 0 ; $ i < $ sectionsCount ; $ i ++ ) { $ sections [ ] = $ seeker -> seekComponent ( 'assessmentSection' , $ this -> readShort ( ) ) ; } $ branchRulesCount = $ this -> readTinyInt ( ) ; $ branchRules = new BranchRuleCollection ( ) ; for ( $ i = 0 ; $ i < $ branchRulesCount ; $ i ++ ) { $ branchRules [ ] = $ seeker -> seekComponent ( 'branchRule' , $ this -> readShort ( ) ) ; } $ preConditionsCount = $ this -> readTinyInt ( ) ; $ preConditions = new PreConditionCollection ( ) ; for ( $ i = 0 ; $ i < $ preConditionsCount ; $ i ++ ) { $ preConditions [ ] = $ seeker -> seekComponent ( 'preCondition' , $ this -> readShort ( ) ) ; } $ routeItem = new RouteItem ( $ itemRef , $ sections , $ testPart , $ seeker -> getAssessmentTest ( ) ) ; $ routeItem -> setOccurence ( $ occurence ) ; $ routeItem -> setBranchRules ( $ branchRules ) ; $ routeItem -> setPreConditions ( $ preConditions ) ; return $ routeItem ; } catch ( BinaryStreamAccessException $ e ) { $ msg = "An error occured while reading a route item." ; throw new QtiBinaryStreamAccessException ( $ msg , $ this , QtiBinaryStreamAccessException :: ROUTE_ITEM , $ e ) ; } catch ( OutOfBoundsException $ e ) { $ msg = "A QTI Component was not found in the assessmentTest tree structure." ; throw new QtiBinaryStreamAccessException ( $ msg , $ this , QtiBinaryStreamAccessException :: ROUTE_ITEM , $ e ) ; } }
Read a route item from the current binary stream.

@param \qtism\runtime\storage\common\AssessmentTestSeeker $seeker An AssessmentTestSeeker object where components will be pulled out by position.
@throws \qtism\runtime\storage\binary\QtiBinaryStreamAccessException
@return \qtism\runtime\tests\RouteItem
Read a route item from the current binary stream .