idx
int64
0
60.3k
question
stringlengths
99
4.85k
target
stringlengths
5
718
3,400
public function setValues ( ValueCollection $ values ) { if ( count ( $ values ) > 0 ) { $ this -> values = $ values ; } else { $ msg = "Values must contain at lease one Value." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set the intrinsic values of the CorrectResponse .
3,401
public function process ( ) { $ rule = $ this -> getRule ( ) ; $ state = $ this -> getState ( ) ; $ variableIdentifier = $ rule -> getIdentifier ( ) ; $ var = $ state -> getVariable ( $ variableIdentifier ) ; if ( is_null ( $ var ) === true ) { $ msg = "No variable with identifier '${variableIdentifier}' to be set in t...
Apply the current SetCorrectResponse rule on the current state .
3,402
public function setComponent ( QtiComponent $ responseProcessing ) { if ( $ responseProcessing instanceof ResponseProcessing ) { parent :: setComponent ( $ responseProcessing ) ; } else { $ msg = "The ResponseProcessingEngine class only accepts ResponseProcessing objects to be executed." ; throw new InvalidArgumentExce...
Set the ResponseProcessing object to be executed .
3,403
public function addTemplateMapping ( $ uri , $ url ) { if ( gettype ( $ uri ) !== 'string' ) { $ msg = "The uri argument must be a string, '" . gettype ( $ uri ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } if ( gettype ( $ url ) !== 'string' ) { $ msg = "The url argument must be a string, '" . getty...
Add a template mapping .
3,404
public function process ( ) { $ responseProcessing = $ this -> getComponent ( ) ; $ template = $ responseProcessing -> getTemplate ( ) ; $ templateLocation = $ responseProcessing -> getTemplateLocation ( ) ; if ( count ( $ responseProcessing -> getResponseRules ( ) ) > 0 ) { $ rules = $ responseProcessing -> getRespons...
Execute the ResponseProcessing according to the current context .
3,405
protected function marshall ( QtiComponent $ component ) { $ element = $ this -> createElement ( $ component ) ; $ this -> fillElement ( $ element , $ component ) ; $ this -> setDOMElementAttribute ( $ element , 'responseIdentifier' , $ component -> getResponseIdentifier ( ) ) ; $ this -> setDOMElementAttribute ( $ ele...
Marshall a MediaInteraction object into a DOMElement object .
3,406
protected function unmarshall ( DOMElement $ element ) { if ( ( $ responseIdentifier = $ this -> getDOMElementAttributeAs ( $ element , 'responseIdentifier' ) ) !== null ) { if ( ( $ autostart = $ this -> getDOMElementAttributeAs ( $ element , 'autostart' , 'boolean' ) ) !== null ) { $ objectElts = $ this -> getChildEl...
Unmarshall a DOMElement object corresponding to a MediaInteraction element .
3,407
public function setMinChoices ( $ minChoices ) { if ( is_int ( $ minChoices ) === true && $ minChoices >= 0 ) { $ this -> minChoices = $ minChoices ; } else { $ msg = "The 'minChoices' argument must be a positive integer, '" . gettype ( $ minChoices ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set the minimum number of choices that the candidate is allowed to select .
3,408
public function setX ( $ x ) { if ( is_int ( $ x ) ) { $ this -> x = $ x ; } else { $ msg = "The X argument must be an integer value, '" . gettype ( $ x ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set the position on the x - axis .
3,409
public function setY ( $ y ) { if ( is_int ( $ y ) ) { $ this -> y = $ y ; } else { $ msg = "The Y argument must be an integer value, '" . gettype ( $ x ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set the position on y - axis .
3,410
protected function setBaseType ( $ baseType ) { if ( in_array ( $ baseType , BaseType :: asArray ( ) ) ) { $ this -> baseType = $ baseType ; } else { $ msg = 'The baseType argument must be a valid QTI baseType value from the BaseType enumeration.' ; throw new InvalidArgumentException ( $ msg ) ; } }
Set a baseType to this marshaller implementation in order to force the datatype used for the unserialization of the mapKey attribute .
3,411
protected function marshall ( QtiComponent $ component ) { $ element = static :: getDOMCradle ( ) -> createElement ( $ component -> getQtiClassName ( ) ) ; $ this -> setDOMElementAttribute ( $ element , 'mapKey' , $ component -> getMapKey ( ) ) ; $ this -> setDOMElementAttribute ( $ element , 'mappedValue' , $ componen...
Marshall a MapEntry object into a DOMElement object .
3,412
protected function unmarshall ( DOMElement $ element ) { try { $ mapKey = $ this -> getDOMElementAttributeAs ( $ element , 'mapKey' ) ; $ mapKey = Utils :: stringToDatatype ( $ mapKey , $ this -> getBaseType ( ) ) ; if ( ( $ mappedValue = $ this -> getDOMElementAttributeAs ( $ element , 'mappedValue' , 'float' ) ) !== ...
Unmarshall a DOMElement object corresponding to a QTI mapEntry element .
3,413
public function setSourceValue ( $ sourceValue ) { if ( is_float ( $ sourceValue ) ) { $ this -> sourceValue = $ sourceValue ; } else { $ msg = "SourceValue must be a float value, '" . gettype ( $ sourceValue ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set the lower bound for the source value to match this entry .
3,414
public function setIncludeBoundary ( $ includeBoundary ) { if ( is_bool ( $ includeBoundary ) ) { $ this -> includeBoundary = $ includeBoundary ; } else { $ msg = "IncludeBoudary must be a boolean value, '" . gettype ( $ includeBoundary ) . "' given" ; throw new InvalidArgumentException ( $ msg ) ; } }
Set if an exact match of the sourceValue attribute matches this entry .
3,415
public function readRecordField ( $ isNull = false ) { try { $ key = $ this -> readString ( ) ; if ( $ isNull === false ) { $ baseType = $ this -> readTinyInt ( ) ; $ toCall = 'read' . ucfirst ( BaseType :: getNameByConstant ( $ baseType ) ) ; $ value = Utils :: valueToRuntime ( call_user_func ( array ( $ this , $ toCa...
Read a record field value from the current binary stream . A record field is composed of a key string and a value .
3,416
public function writeRecordField ( array $ recordField , $ isNull = false ) { try { $ this -> writeBoolean ( $ isNull ) ; $ key = $ recordField [ 0 ] ; $ this -> writeString ( $ key ) ; if ( $ isNull === false ) { $ value = $ recordField [ 1 ] ; $ baseType = Utils :: inferBaseType ( $ value ) ; $ this -> writeTinyInt (...
Write a record field value in the current binary stream . A record field is composed of a key string and a value .
3,417
public function readIdentifier ( ) { try { return $ this -> readString ( ) ; } catch ( BinaryStreamAccessException $ e ) { $ msg = "An error occured while reading an identifier." ; throw new QtiBinaryStreamAccessException ( $ msg , $ this , QtiBinaryStreamAccessException :: IDENTIFIER , $ e ) ; } }
Read an identifier from the current binary stream .
3,418
public function writeIdentifier ( $ identifier ) { try { $ this -> writeString ( $ identifier ) ; } catch ( BinaryStreamAccessException $ e ) { $ msg = "An error occured while writing an identifier." ; throw new QtiBinaryStreamAccessException ( $ msg , $ this , QtiBinaryStreamAccessException :: IDENTIFIER , $ e ) ; } }
Write an identifier in the current binary stream .
3,419
public function readPoint ( ) { try { return new QtiPoint ( $ this -> readShort ( ) , $ this -> readShort ( ) ) ; } catch ( BinaryStreamAccessException $ e ) { $ msg = "An error occured while reading a point." ; throw new QtiBinaryStreamAccessException ( $ msg , $ this , QtiBinaryStreamAccessException :: POINT , $ e ) ...
Read a Point from the current binary stream .
3,420
public function writePoint ( QtiPoint $ point ) { try { $ this -> writeShort ( $ point -> getX ( ) ) ; $ this -> writeShort ( $ point -> getY ( ) ) ; } catch ( BinaryStreamAccessException $ e ) { $ msg = "An error occured while writing a point." ; throw new QtiBinaryStreamAccessException ( $ msg , $ this , QtiBinaryStr...
Write a Point in the current binary stream .
3,421
public function readPair ( ) { try { return new QtiPair ( $ this -> readString ( ) , $ this -> readString ( ) ) ; } catch ( BinaryStreamAccessException $ e ) { $ msg = "An error occured while reading a pair." ; throw new QtiBinaryStreamAccessException ( $ msg , $ this , QtiBinaryStreamAccessException :: PAIR , $ e ) ; ...
Read a Pair from the current binary stream .
3,422
public function writePair ( QtiPair $ pair ) { try { $ this -> writeString ( $ pair -> getFirst ( ) ) ; $ this -> writeString ( $ pair -> getSecond ( ) ) ; } catch ( BinaryStreamAccessException $ e ) { $ msg = "An error occured while writing a pair." ; throw new QtiBinaryStreamAccessException ( $ msg , $ this , QtiBina...
Write a Pair in the current binary stream .
3,423
public function readDirectedPair ( ) { try { return new QtiDirectedPair ( $ this -> readString ( ) , $ this -> readString ( ) ) ; } catch ( BinaryStreamAccessException $ e ) { $ msg = "An error occured while reading a directedPair." ; throw new QtiBinaryStreamAccessException ( $ msg , $ this , QtiBinaryStreamAccessExce...
Read a DirectedPair from the current binary stream .
3,424
public function writeDirectedPair ( QtiDirectedPair $ directedPair ) { try { $ this -> writeString ( $ directedPair -> getFirst ( ) ) ; $ this -> writeString ( $ directedPair -> getSecond ( ) ) ; } catch ( BinaryStreamAccessException $ e ) { $ msg = "An error occured while writing a directedPair." ; throw new QtiBinary...
Write a DirectedPair in the current binary stream .
3,425
public function readShufflingGroup ( ) { try { $ identifiers = new IdentifierCollection ( ) ; $ fixedIdentifiers = new IdentifierCollection ( ) ; $ identifiersCount = $ this -> readTinyInt ( ) ; for ( $ i = 0 ; $ i < $ identifiersCount ; $ i ++ ) { $ identifiers [ ] = $ this -> readString ( ) ; } $ shufflingGroup = new...
Read a ShufflingGroup from the current binary stream .
3,426
public function writeShufflingGroup ( ShufflingGroup $ shufflingGroup ) { try { $ identifiers = $ shufflingGroup -> getIdentifiers ( ) ; $ this -> writeTinyInt ( count ( $ identifiers ) ) ; foreach ( $ identifiers as $ identifier ) { $ this -> writeString ( $ identifier ) ; } $ fixedIdentifiers = $ shufflingGroup -> ge...
Write a ShufflingGroup in the current binary stream .
3,427
public function readShufflingState ( ) { try { $ responseIdentifier = $ this -> readIdentifier ( ) ; $ shufflingGroupCount = $ this -> readTinyInt ( ) ; $ shufflingGroups = new ShufflingGroupCollection ( ) ; for ( $ i = 0 ; $ i < $ shufflingGroupCount ; $ i ++ ) { $ shufflingGroups [ ] = $ this -> readShufflingGroup ( ...
Read a Shuffling object from the current binary stream .
3,428
public function writeShufflingState ( Shuffling $ shufflingState ) { try { $ this -> writeIdentifier ( $ shufflingState -> getResponseIdentifier ( ) ) ; $ shufflingGroups = $ shufflingState -> getShufflingGroups ( ) ; $ this -> writeTinyInt ( count ( $ shufflingGroups ) ) ; foreach ( $ shufflingGroups as $ shufflingGro...
Write a Shuffling object in the current binary stream .
3,429
public function readDuration ( ) { try { return new QtiDuration ( $ this -> readString ( ) ) ; } catch ( BinaryStreamAccessException $ e ) { $ msg = "An error occured while reading a duration." ; throw new QtiBinaryStreamAccessException ( $ msg , $ this , QtiBinaryStreamAccessException :: DURATION , $ e ) ; } }
Read a Duration from the current binary stream .
3,430
public function writeDuration ( QtiDuration $ duration ) { try { $ this -> writeString ( $ duration -> __toString ( ) ) ; } catch ( BinaryStreamAccessException $ e ) { $ msg = "An error occured while writing a duration." ; throw new QtiBinaryStreamAccessException ( $ msg , $ this , QtiBinaryStreamAccessException :: DUR...
Write a Duration in the current binary stream .
3,431
public function readIntOrIdentifier ( ) { try { $ isInt = $ this -> readBoolean ( ) ; return ( $ isInt === true ) ? $ this -> readInteger ( ) : $ this -> readIdentifier ( ) ; } catch ( BinaryStreamAccessException $ e ) { $ msg = "An error occured while reading an intOrIdentifier." ; throw new QtiBinaryStreamAccessExcep...
Read an intOrIdentifier from the current binary stream .
3,432
public function writeIntOrIdentifier ( $ intOrIdentifier ) { try { if ( gettype ( $ intOrIdentifier ) === 'integer' ) { $ this -> writeBoolean ( true ) ; $ this -> writeInteger ( $ intOrIdentifier ) ; } elseif ( gettype ( $ intOrIdentifier ) === 'string' ) { $ this -> writeBoolean ( false ) ; $ this -> writeString ( $ ...
Write an intOrIdentifier in the current binary stream .
3,433
public function readRouteItem ( AssessmentTestSeeker $ seeker ) { try { $ occurence = $ this -> readTinyInt ( ) ; $ itemRef = $ seeker -> seekComponent ( 'assessmentItemRef' , $ this -> readShort ( ) ) ; $ testPart = $ seeker -> seekComponent ( 'testPart' , $ this -> readShort ( ) ) ; $ sectionsCount = $ this -> readTi...
Read a route item from the current binary stream .
3,434
public function writeRouteItem ( AssessmentTestSeeker $ seeker , RouteItem $ routeItem ) { try { $ this -> writeTinyInt ( $ routeItem -> getOccurence ( ) ) ; $ this -> writeShort ( $ seeker -> seekPosition ( $ routeItem -> getAssessmentItemRef ( ) ) ) ; $ this -> writeShort ( $ seeker -> seekPosition ( $ routeItem -> g...
Write a route item in the current binary stream .
3,435
public function readPendingResponses ( AssessmentTestSeeker $ seeker ) { try { $ state = new State ( ) ; $ varCount = $ this -> readTinyInt ( ) ; for ( $ i = 0 ; $ i < $ varCount ; $ i ++ ) { $ responseDeclaration = $ seeker -> seekComponent ( 'responseDeclaration' , $ this -> readShort ( ) ) ; $ responseVariable = Res...
Read a PendingResponse object from the current binary stream .
3,436
public function writePendingResponses ( AssessmentTestSeeker $ seeker , PendingResponses $ pendingResponses ) { try { $ state = $ pendingResponses -> getState ( ) ; $ itemRef = $ pendingResponses -> getAssessmentItemRef ( ) ; $ occurence = $ pendingResponses -> getOccurence ( ) ; $ responseDeclarations = $ itemRef -> g...
Write a PendingResponses object in the current binary stream .
3,437
public function writeFile ( QtiFile $ file ) { try { $ this -> writeString ( $ file -> getIdentifier ( ) ) ; } catch ( QtiBinaryStreamAccessException $ e ) { $ msg = "An error occured while reading a QTI File." ; throw new QtiBinaryStreamAccessException ( $ msg , $ this , QtiBinaryStreamAccessException :: FILE , $ e ) ...
Write a QtiFile object in the current binary stream .
3,438
public function readFile ( ) { try { $ id = $ this -> readString ( ) ; return $ this -> getFileManager ( ) -> retrieve ( $ id ) ; } catch ( \ Exception $ e ) { $ msg = "An error occured while writing a QTI File." ; throw new QtiBinaryStreamAccessException ( $ msg , $ this , QtiBinaryStreamAccessException :: FILE , $ e ...
Read a QtiFile object from the current binary stream .
3,439
public function readPath ( ) { try { $ pathCount = $ this -> readShort ( ) ; $ path = array ( ) ; for ( $ i = 0 ; $ i < $ pathCount ; $ i ++ ) { $ path [ ] = $ this -> readShort ( ) ; } return $ path ; } catch ( BinaryStreamAccessException $ e ) { $ msg = "An error occured while reading the path." ; throw new QtiBinary...
Read the path from the current binary stream .
3,440
public function writePath ( array $ path ) { try { $ this -> writeShort ( count ( $ path ) ) ; foreach ( $ path as $ p ) { $ this -> writeShort ( $ p ) ; } } catch ( BinaryStreamAccessException $ e ) { $ msg = "An error occured while writing the path." ; throw new QtiBinaryStreamAccessException ( $ msg , $ this , QtiBi...
Write the path in the current binary stream .
3,441
protected function marshall ( QtiComponent $ component ) { $ element = static :: getDOMCradle ( ) -> createElement ( $ component -> getQtiClassName ( ) ) ; if ( $ component -> hasLowerBound ( ) === true ) { $ this -> setDOMElementAttribute ( $ element , 'lowerBound' , $ component -> getLowerBound ( ) ) ; } if ( $ compo...
Marshall a Mapping object into a DOMElement object .
3,442
protected function unmarshall ( DOMElement $ element ) { $ mapEntriesElts = $ this -> getChildElementsByTagName ( $ element , 'mapEntry' ) ; $ mapEntries = new MapEntryCollection ( ) ; foreach ( $ mapEntriesElts as $ mapEntryElt ) { $ marshaller = $ this -> getMarshallerFactory ( ) -> createMarshaller ( $ mapEntryElt ,...
Unmarshall a DOMElement object corresponding to a QTI mapping element .
3,443
public function setTraceMessage ( $ traceMessage ) { if ( gettype ( $ traceMessage ) === 'string' ) { $ this -> traceMessage = $ traceMessage ; } else { $ msg = "The traceMessage argument must be a string, '" . gettype ( $ traceMessage ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Get the message about the traced QtiComponent object .
3,444
public function process ( ) { $ state = $ this -> getState ( ) ; $ variableIdentifier = $ this -> getExpression ( ) -> getIdentifier ( ) ; $ weightIdentifier = $ this -> getExpression ( ) -> getWeightIdentifier ( ) ; $ variable = $ state -> getVariable ( $ variableIdentifier ) ; if ( empty ( $ variable ) ) { return nul...
Process the Variable expression .
3,445
public function getDefaultRendering ( $ something ) { $ renderer = new QtiPLRenderer ( $ this -> getCRO ( ) ) ; return $ something -> getQtiClassName ( ) . $ renderer -> writeChildElements ( $ something -> getExpressions ( ) ) ; }
Returns the default QtiPL rendering for an Operator .
3,446
public function setResponseIdentifier ( $ responseIdentifier ) { if ( is_string ( $ responseIdentifier ) === false || empty ( $ responseIdentifier ) === true ) { throw new InvalidArgumentException ( "The 'responseIdentifier' argument must be a non-empty string." ) ; } $ this -> responseIdentifier = $ responseIdentifier...
Set the identifier of the response the validity constraint applies to .
3,447
public function setPatternMask ( $ patternMask ) { if ( is_string ( $ patternMask ) === false ) { throw new InvalidArgumentException ( "The 'patternMask' argument must be a string, '" . gettype ( $ patternMask ) . "' given." ) ; } $ this -> patternMask = $ patternMask ; }
Set the PatternMask for the ResponseValidityConstraint .
3,448
protected function marshall ( QtiComponent $ component ) { $ element = self :: getDOMCradle ( ) -> createElement ( 'table' ) ; if ( $ component -> hasSummary ( ) === true ) { $ this -> setDOMElementAttribute ( $ element , 'summary' , $ component -> getSummary ( ) ) ; } if ( $ component -> hasXmlBase ( ) === true ) { se...
Marshall a Table object into a DOMElement object .
3,449
static public function formatMessage ( \ Exception $ e , $ withClassName = true ) { $ returnValue = '' ; do { $ className = get_class ( $ e ) ; $ message = $ e -> getMessage ( ) ; $ returnValue .= ( $ withClassName === true ) ? "[${className}] ${message}" : $ message ; if ( $ e = $ e -> getPrevious ( ) ) { $ returnValu...
Format an Exception message .
3,450
protected function marshall ( QtiComponent $ component ) { $ element = static :: getDOMCradle ( ) -> createElement ( $ component -> getQtiClassName ( ) ) ; $ fieldIdentifer = $ component -> getFieldIdentifier ( ) ; $ baseType = $ component -> getBaseType ( ) ; self :: setDOMElementValue ( $ element , $ component -> get...
Marshall a Value object into a DOMElement object .
3,451
protected function unmarshall ( DOMElement $ element ) { $ object = null ; if ( ( $ baseType = $ this -> getDOMElementAttributeAs ( $ element , 'baseType' , 'string' ) ) !== null ) { $ baseTypeCst = BaseType :: getConstantByName ( $ baseType ) ; if ( $ baseTypeCst !== false ) { $ object = new Value ( Utils :: stringToD...
Unmarshall a DOMElement object corresponding to a QTI Value element .
3,452
public function instantiate ( $ config = 0 , $ sessionId = '' ) { if ( empty ( $ sessionId ) === true ) { $ sessionId = uniqid ( 'qtism' , true ) ; } try { $ session = $ this -> getManager ( ) -> createAssessmentTestSession ( $ this -> getAssessmentTest ( ) , null , $ config ) ; $ session -> setSessionId ( $ sessionId ...
Instantiate a new AssessmentTestSession .
3,453
public function setSource ( $ source ) { if ( Format :: isIdentifier ( $ source ) ) { $ this -> source = $ source ; } else { $ msg = "'${source}' is not a valid QTI identifier." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set the source variable identifier .
3,454
public function setTarget ( $ target ) { if ( Format :: isIdentifier ( $ target ) ) { $ this -> target = $ target ; } else { $ msg = "'${target}' is not a valid QTI identifier." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set the target variable identifier .
3,455
protected function marshall ( QtiComponent $ component ) { $ element = static :: getDOMCradle ( ) -> createElement ( $ component -> getQtiClassName ( ) ) ; $ this -> setDOMElementAttribute ( $ element , 'identifier' , $ component -> getIdentifier ( ) ) ; $ weightIdentifier = $ component -> getWeightIdentifier ( ) ; if ...
Marshall a Variable object into a DOMElement object .
3,456
protected function unmarshall ( DOMElement $ element ) { if ( ( $ identifier = $ this -> getDOMElementAttributeAs ( $ element , 'identifier' ) ) !== null ) { $ object = new Variable ( $ identifier ) ; if ( ( $ weightIdentifier = $ this -> getDOMElementAttributeAs ( $ element , 'weightIdentifier' ) ) !== null ) { $ obje...
Unmarshall a DOMElement object corresponding to a QTI Variable element .
3,457
protected function marshall ( QtiComponent $ component ) { $ element = static :: getDOMCradle ( ) -> createElement ( $ component -> getQtiClassName ( ) ) ; $ this -> setDOMElementAttribute ( $ element , 'href' , $ component -> getHref ( ) ) ; $ this -> setDOMElementAttribute ( $ element , 'media' , $ component -> getMe...
Marshall a Stylesheet object into a DOMElement object .
3,458
protected function unmarshall ( DOMElement $ element ) { if ( ( $ value = $ this -> getDOMElementAttributeAs ( $ element , 'href' , 'string' ) ) !== null ) { $ object = new Stylesheet ( $ value ) ; if ( ( $ value = $ this -> getDOMElementAttributeAs ( $ element , 'type' , 'string' ) ) !== null ) { $ object -> setType (...
Unmarshall a DOMElement object corresponding to a QTI stylesheet element .
3,459
public function setOutcomeRules ( OutcomeRuleCollection $ outcomeRules ) { if ( count ( $ outcomeRules ) > 0 ) { $ this -> outcomeRules = $ outcomeRules ; } else { $ msg = "An OutcomeIf object must be bound to at least one OutcomeRule." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set the OutcomeRule objects to be evaluated as sub expressions if the expression evaluated with the If statement returns true .
3,460
protected function marshall ( QtiComponent $ component ) { $ element = $ this -> createElement ( $ component ) ; $ this -> fillElement ( $ element , $ component ) ; $ this -> setDOMElementAttribute ( $ element , 'responseIdentifier' , $ component -> getResponseIdentifier ( ) ) ; if ( $ component -> hasXmlBase ( ) === t...
Marshall a DrawingInteraction object into a DOMElement object .
3,461
protected function unmarshall ( DOMElement $ element ) { if ( ( $ responseIdentifier = $ this -> getDOMElementAttributeAs ( $ element , 'responseIdentifier' ) ) !== null ) { $ objectElts = $ this -> getChildElementsByTagName ( $ element , 'object' ) ; if ( count ( $ objectElts ) > 0 ) { $ objectElt = $ objectElts [ 0 ]...
Unmarshall a DOMElement object corresponding to a DrawingInteraction element .
3,462
protected function marshall ( QtiComponent $ component ) { $ element = static :: getDOMCradle ( ) -> createElement ( $ component -> getQtiClassName ( ) ) ; $ interpretation = $ component -> getInterpretation ( ) ; if ( ! empty ( $ interpretation ) ) { $ this -> setDOMElementAttribute ( $ element , 'interpretation' , $ ...
Marshall a CorrectResponse object into a DOMElement object .
3,463
protected function marshall ( QtiComponent $ component ) { $ element = parent :: marshall ( $ component ) ; $ baseType = $ component -> getBaseType ( ) ; if ( $ component -> getCorrectResponse ( ) !== null ) { $ marshaller = $ this -> getMarshallerFactory ( ) -> createMarshaller ( $ component -> getCorrectResponse ( ) ...
Marshall a ResponseDeclaration object into a DOMElement object .
3,464
protected function unmarshall ( DOMElement $ element ) { try { $ baseComponent = parent :: unmarshall ( $ element ) ; $ object = new ResponseDeclaration ( $ baseComponent -> getIdentifier ( ) ) ; $ object -> setBaseType ( $ baseComponent -> getBaseType ( ) ) ; $ object -> setCardinality ( $ baseComponent -> getCardinal...
Unmarshall a DOMElement object corresponding to a QTI responseDeclaration element .
3,465
public function setMaxAttempts ( $ maxAttempts ) { if ( is_int ( $ maxAttempts ) ) { $ this -> maxAttempts = $ maxAttempts ; } else { $ msg = "MaxAttempts must be an integer, '" . gettype ( $ maxAttempts ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set the maximum number of attempts in the given test context .
3,466
public function setShowFeedback ( $ showFeedback ) { if ( is_bool ( $ showFeedback ) ) { $ this -> showFeedback = $ showFeedback ; } else { $ msg = "ShowFeedback must be a boolean, '" . gettype ( $ showFeedback ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set if feedbacks must be shown in the given test context .
3,467
public function setAllowReview ( $ allowReview ) { if ( is_bool ( $ allowReview ) ) { $ this -> allowReview = $ allowReview ; } else { $ msg = "AllowReview must be a boolean, '" . gettype ( $ allowReview ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set that the candidate is allowed to review item body and given responses after the last item .
3,468
public function setShowSolution ( $ showSolution ) { if ( is_bool ( $ showSolution ) ) { $ this -> showSolution = $ showSolution ; } else { $ msg = "ShowSolution must be a boolean, '" . gettype ( $ showSolution ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set if the candidate is provided a way to enter the solution state .
3,469
public function setAllowComment ( $ allowComment ) { if ( is_bool ( $ allowComment ) ) { $ this -> allowComment = $ allowComment ; } else { $ msg = "AllowComment must be a boolean, '" . gettype ( $ allowComment ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set if the candidate is allowed to communicate comments during the session .
3,470
public function setAllowSkipping ( $ allowSkipping ) { if ( is_bool ( $ allowSkipping ) ) { $ this -> allowSkipping = $ allowSkipping ; } else { $ msg = "AllowSkipping must be a boolean, '" . gettype ( $ allowSkipping ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set if the candidate is allowed to skip items .
3,471
public function isDefault ( ) { return $ this -> getMaxAttempts ( ) === 1 && $ this -> mustShowFeedback ( ) === false && $ this -> doesAllowReview ( ) === true && $ this -> mustShowSolution ( ) === false && $ this -> doesAllowComment ( ) === false && $ this -> mustValidateResponses ( ) === false && $ this -> doesAllowS...
Is a default Item Session Control?
3,472
public function setValidateResponses ( $ validateResponses ) { if ( is_bool ( $ validateResponses ) ) { $ this -> validateResponses = $ validateResponses ; } else { $ msg = "ValidateResponses must be a boolean value, '" . gettype ( $ validateResponses ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set if the responses must be validated .
3,473
public static function createFromDataModel ( ValueCollection $ valueCollection ) { $ container = new static ( ) ; foreach ( $ valueCollection as $ value ) { $ fieldIdentifier = $ value -> getFieldIdentifier ( ) ; if ( ! empty ( $ fieldIdentifier ) ) { $ container [ $ value -> getFieldIdentifier ( ) ] = RuntimeUtils :: ...
Create a RecordContainer object from a Data Model ValueCollection object .
3,474
public function marshall ( ) { $ ctx = $ this -> getContext ( ) ; $ access = $ ctx -> getStreamAccess ( ) ; $ array = $ this -> getToMarshall ( ) ; $ args = new PhpArgumentCollection ( ) ; foreach ( $ array as $ a ) { if ( PhpUtils :: isScalar ( $ a ) === false ) { $ msg = "The PhpArrayMarshaller class only deals with ...
Marshall an array into PHP source code .
3,475
public function readTinyInt ( ) { try { $ bin = $ this -> getStream ( ) -> read ( 1 ) ; return ord ( $ bin ) ; } catch ( StreamException $ e ) { $ this -> handleStreamException ( $ e , BinaryStreamAccessException :: TINYINT ) ; } }
Read a single byte unsigned integer from the current binary stream .
3,476
public function writeTinyInt ( $ tinyInt ) { try { $ this -> getStream ( ) -> write ( chr ( $ tinyInt ) ) ; } catch ( StreamException $ e ) { $ this -> handleStreamException ( $ e , BinaryStreamAccessException :: TINYINT , false ) ; } }
Write a single byte unsigned integer in the current binary stream .
3,477
public function readShort ( ) { try { $ bin = $ this -> getStream ( ) -> read ( 2 ) ; return current ( unpack ( 'S' , $ bin ) ) ; } catch ( StreamException $ e ) { $ this -> handleStreamException ( $ e , BinaryStreamAccessException :: SHORT ) ; } }
Read a 2 bytes unsigned integer from the current binary stream .
3,478
public function writeShort ( $ short ) { try { $ this -> getStream ( ) -> write ( pack ( 'S' , $ short ) ) ; } catch ( StreamException $ e ) { $ this -> handleStreamException ( $ e , BinaryStreamAccessException :: SHORT , false ) ; } }
Write a 2 bytes unsigned integer in the current binary stream .
3,479
public function readInteger ( ) { try { $ bin = $ this -> getStream ( ) -> read ( 4 ) ; return current ( unpack ( 'l' , $ bin ) ) ; } catch ( StreamException $ e ) { $ this -> handleStreamException ( $ e , BinaryStreamAccessException :: INT ) ; } }
Read a 8 bytes signed integer from the current binary stream .
3,480
public function writeInteger ( $ int ) { try { $ this -> getStream ( ) -> write ( pack ( 'l' , $ int ) ) ; } catch ( StreamException $ e ) { $ this -> handleStreamException ( $ e , BinaryStreamAccessException :: INT , false ) ; } }
Write a 8 bytes signed integer in the current binary stream .
3,481
public function readFloat ( ) { try { $ bin = $ this -> getStream ( ) -> read ( 8 ) ; return current ( unpack ( 'd' , $ bin ) ) ; } catch ( StreamException $ e ) { $ this -> handleStreamException ( $ e , BinaryStreamAccessException :: FLOAT ) ; } }
Read a double precision float from the current binary stream .
3,482
public function writeFloat ( $ float ) { try { $ this -> getStream ( ) -> write ( pack ( 'd' , $ float ) ) ; } catch ( StreamException $ e ) { $ this -> handleStreamException ( $ e , BinaryStreamAccessException :: FLOAT , false ) ; } }
Write a double precision float in the current binary stream .
3,483
public function readBoolean ( ) { try { $ int = ord ( $ this -> getStream ( ) -> read ( 1 ) ) ; return ( $ int === 0 ) ? false : true ; } catch ( StreamException $ e ) { $ this -> handleStreamException ( $ e , BinaryStreamAccessException :: BOOLEAN ) ; } }
Read a boolean value from the current binary stream .
3,484
public function writeBoolean ( $ boolean ) { try { $ val = ( $ boolean === true ) ? 1 : 0 ; $ this -> getStream ( ) -> write ( chr ( $ val ) ) ; } catch ( StreamException $ e ) { $ this -> handleStreamException ( $ e , BinaryStreamAccessException :: FLOAT , false ) ; } }
Write a boolean value from the current binary stream .
3,485
public function readString ( ) { try { $ binLength = $ this -> getStream ( ) -> read ( 2 ) ; $ length = current ( unpack ( 'S' , $ binLength ) ) ; return $ this -> getStream ( ) -> read ( $ length ) ; } catch ( StreamException $ e ) { $ this -> handleStreamException ( $ e , BinaryStreamAccessException :: STRING ) ; } }
Read a string value from the current binary stream .
3,486
public function writeString ( $ string ) { $ maxLen = 65535 ; $ len = strlen ( $ string ) ; if ( $ len > $ maxLen ) { $ len = $ maxLen ; $ string = substr ( $ string , 0 , $ maxLen ) ; } try { $ this -> getStream ( ) -> write ( pack ( 'S' , $ len ) . $ string ) ; } catch ( StreamException $ e ) { $ this -> handleStream...
Write a string value from in the current binary string .
3,487
public function readDateTime ( ) { try { $ timeStamp = current ( unpack ( 'l' , $ this -> getStream ( ) -> read ( 4 ) ) ) ; $ date = new DateTime ( 'now' , new \ DateTimeZone ( 'UTC' ) ) ; return $ date -> setTimestamp ( $ timeStamp ) ; } catch ( StreamException $ e ) { $ this -> handleStreamException ( $ e , BinaryStr...
Read a DateTime from the current binary stream .
3,488
public function writeDateTime ( DateTime $ dateTime ) { try { $ timeStamp = $ dateTime -> getTimestamp ( ) ; $ this -> getStream ( ) -> write ( pack ( 'l' , $ timeStamp ) ) ; } catch ( StreamException $ e ) { $ this -> handleStreamException ( $ e , BinaryStreamAccessException :: DATETIME , false ) ; } }
Write a DateTime from the current binary stream .
3,489
protected function handleStreamException ( StreamException $ e , $ typeError , $ read = true ) { $ strType = 'unknown datatype' ; switch ( $ typeError ) { case BinaryStreamAccessException :: BOOLEAN : $ strType = 'boolean' ; break ; case BinaryStreamAccessException :: BINARY : $ strType = 'binary data' ; break ; case B...
Handle a StreamException in order to throw the relevant BinaryStreamAccessException .
3,490
public function getComponentsByClassName ( $ classNames , $ recursive = true ) { if ( gettype ( $ classNames ) !== 'string' && ! is_array ( $ classNames ) ) { $ msg = "The QtiComponent::getComponentsByClassName method only accepts " ; $ msg .= "a string or an array as its main argument, '" . gettype ( $ classNames ) . ...
Get QtiComponents object which is contained by this one the basis of a given QTI className . If nothing found an empty QtiComponentCollection object is returned .
3,491
public function process ( ) { $ operands = $ this -> getOperands ( ) ; if ( $ operands -> containsNull ( ) === true ) { return null ; } if ( $ operands -> exclusivelySingle ( ) === false ) { $ msg = "The IntegerDivide operator only accepts operands with single cardinality." ; throw new OperatorProcessingException ( $ m...
Process the IntegerDivide operator .
3,492
public function setLowerBound ( $ lowerBound ) { if ( is_float ( $ lowerBound ) === true ) { $ this -> lowerBound = $ lowerBound ; } else { $ msg = "The 'lowerBound' argument must be a float value, '" . gettype ( $ lowerBound ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Get the value of the lowerBound attribute .
3,493
public function setUpperBound ( $ upperBound ) { if ( is_float ( $ upperBound ) === true ) { $ this -> upperBound = $ upperBound ; } else { $ msg = "The 'upperBound' argument must be a float value, '" . gettype ( $ upperBound ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set the value of the upperBound attribute .
3,494
public function setStepLabel ( $ stepLabel ) { if ( is_bool ( $ stepLabel ) === true ) { $ this -> stepLabel = $ stepLabel ; } else { $ msg = "The 'stepLabel' argument must be a boolean value, '" . gettype ( $ stepLabel ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set whether or not each step on the slider has to be labelled .
3,495
public function setReverse ( $ reverse ) { if ( is_bool ( $ reverse ) === true ) { $ this -> reverse = $ reverse ; } else { $ msg = "The 'reverse' argument must be a boolean value, '" . gettype ( $ reverse ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set whether or not the upper and lower bounds are reversed .
3,496
public function setType ( $ type ) { if ( gettype ( $ type ) === 'string' ) { $ this -> type = $ type ; } else { $ msg = "Type must be a string, '" . gettype ( $ type ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set the mime - type of the stylesheet .
3,497
public function setMedia ( $ media ) { if ( is_string ( $ media ) ) { $ this -> media = $ media ; } else { $ msg = "Media must be a string, '" . gettype ( $ media ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set the media to apply the stylesheet on .
3,498
public function offsetGet ( $ offset ) { if ( gettype ( $ offset ) !== 'string' ) { $ msg = "The requested offset must be a non-empty string." ; throw new OutOfRangeException ( $ msg ) ; } $ returnValue = null ; $ data = & $ this -> getDataPlaceHolder ( ) ; if ( isset ( $ data [ $ offset ] ) === true ) { $ returnValue ...
Retrieve a QtiIdentifiable object from the collection .
3,499
protected function unmarshall ( DOMElement $ element ) { if ( ( $ identifier = $ this -> getDOMElementAttributeAs ( $ element , 'identifier' ) ) !== null ) { $ expressionElt = self :: getFirstChildElement ( $ element ) ; if ( $ expressionElt !== false ) { $ marshaller = $ this -> getMarshallerFactory ( ) -> createMarsh...
Unmarshall a DOMElement object corresponding to a QTI setTemplateValue element .