idx int64 0 60.3k | question stringlengths 99 4.85k | target stringlengths 5 718 |
|---|---|---|
3,300 | public function setSubstring ( $ substring ) { if ( is_bool ( $ substring ) ) { $ this -> substring = $ substring ; } else { $ msg = "The substring argument must be a boolean, '" . gettype ( $ substring ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } } | Set the substring attribute . |
3,301 | protected function marshall ( QtiComponent $ component ) { $ element = static :: getDOMCradle ( ) -> createElement ( $ component -> getQtiClassName ( ) ) ; $ this -> setDOMElementAttribute ( $ element , 'min' , $ component -> getMin ( ) ) ; $ this -> setDOMElementAttribute ( $ element , 'max' , $ component -> getMax ( ... | Marshall a RandomInteger object into a DOMElement object . |
3,302 | protected function unmarshall ( DOMElement $ element ) { if ( ( $ max = $ this -> getDOMElementAttributeAs ( $ element , 'max' , 'string' ) ) !== null ) { $ max = ( Format :: isVariableRef ( $ max ) ) ? $ max : intval ( $ max ) ; $ object = new RandomInteger ( 0 , $ max ) ; if ( ( $ step = $ this -> getDOMElementAttrib... | Unmarshall a DOMElement object corresponding to a QTI randomInteger element . |
3,303 | protected function marshall ( QtiComponent $ component ) { $ element = parent :: marshall ( $ component ) ; $ version = $ this -> getVersion ( ) ; if ( Version :: compare ( $ version , '2.1.0' , '>=' ) === true && ! in_array ( $ component -> getViews ( ) -> getArrayCopy ( ) , View :: asArray ( ) ) ) { $ arrayViews = ar... | Marshall an OutcomeDeclaration object into a DOMElement object . |
3,304 | protected function unmarshallChildrenKnown ( DOMElement $ element , QtiComponentCollection $ children ) { if ( ( $ min = $ this -> getDOMElementAttributeAs ( $ element , 'min' ) ) !== null ) { if ( Format :: isInteger ( $ min ) ) { $ min = intval ( $ min ) ; } if ( ( $ max = $ this -> getDOMElementAttributeAs ( $ eleme... | Unmarshall a QTI anyN operator element into an AnyN object . |
3,305 | public function setName ( $ name ) { if ( in_array ( $ name , Statistics :: asArray ( ) ) ) { $ this -> name = $ name ; } else { $ msg = "The name argument must be a value from the Statistics enumeration, '" . $ name . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } } | Set the statistics operator to use . |
3,306 | public function setShufflingGroups ( ShufflingGroupCollection $ shufflingGroups ) { if ( count ( $ shufflingGroups ) === 0 ) { $ msg = "A Shuffling object must be composed of at least 1 ShufflingGroup object. None given" ; throw new InvalidArgumentException ( $ msg ) ; } elseif ( ( $ c = count ( $ shufflingGroups ) ) >... | Set the ShufflingGroups . |
3,307 | public function shuffle ( ) { $ shuffling = clone $ this ; $ groups = $ shuffling -> getShufflingGroups ( ) ; for ( $ i = 0 ; $ i < count ( $ groups ) ; $ i ++ ) { $ identifiers = $ groups [ $ i ] -> getIdentifiers ( ) ; $ fixedIdentifiers = $ groups [ $ i ] -> getFixedIdentifiers ( ) -> getArrayCopy ( ) ; $ shufflable... | Shuffles the identifiers of the ShufflingGroups . |
3,308 | protected function marshall ( QtiComponent $ component ) { $ element = self :: getDOMCradle ( ) -> createElement ( $ component -> getQtiClassName ( ) ) ; if ( $ component -> hasTemplate ( ) === true ) { $ this -> setDOMElementAttribute ( $ element , 'template' , $ component -> getTemplate ( ) ) ; } if ( $ component -> ... | Marshall a ResponseProcessing object into a DOMElement object . |
3,309 | protected function unmarshall ( DOMElement $ element , ResponseProcessing $ responseProcessing = null ) { $ responseRuleElts = self :: getChildElements ( $ element ) ; $ responseRules = new ResponseRuleCollection ( ) ; for ( $ i = 0 ; $ i < count ( $ responseRuleElts ) ; $ i ++ ) { $ marshaller = $ this -> getMarshalle... | Unmarshall a DOMElement object corresponding to a QTI responseProcessing element . |
3,310 | public function setXmlBase ( $ xmlBase = '' ) { if ( is_string ( $ xmlBase ) && ( empty ( $ xmlBase ) || Format :: isUri ( $ xmlBase ) ) ) { $ this -> xmlBase = $ xmlBase ; } else { $ msg = "The 'base' argument must be an empty string or a valid URI, '" . $ xmlBase . "' given" ; throw new InvalidArgumentException ( $ m... | Set the base URI of the TemplateBlock . |
3,311 | static public function throwTypingError ( $ value ) { $ givenValue = ( gettype ( $ value ) == 'object' ) ? get_class ( $ value ) : gettype ( $ value ) ; $ acceptedTypes = array ( 'boolean' , 'integer' , 'float' , 'double' , 'string' , 'Duration' , 'Pair' , 'DirectedPair' , 'Point' ) ; $ acceptedTypes = implode ( ", " ,... | Throw an InvalidArgumentException depending on a PHP in - memory value . |
3,312 | static public function floatArrayToInteger ( $ floatArray ) { $ integerArray = array ( ) ; foreach ( $ floatArray as $ f ) { $ integerArray [ ] = ( is_null ( $ f ) === false ) ? intval ( $ f ) : null ; } return $ integerArray ; } | Transforms the content of float array to an integer array . |
3,313 | static public function integerArrayToFloat ( $ integerArray ) { $ floatArray = array ( ) ; foreach ( $ integerArray as $ i ) { $ floatArray [ ] = ( is_null ( $ i ) === false ) ? floatval ( $ i ) : null ; } return $ floatArray ; } | Transforms the content of an integer array to a float array . |
3,314 | static public function valueToRuntime ( $ v , $ baseType ) { if ( $ v !== null ) { if ( is_int ( $ v ) === true ) { if ( $ baseType === - 1 || $ baseType === BaseType :: INTEGER ) { return new QtiInteger ( $ v ) ; } elseif ( $ baseType === BaseType :: INT_OR_IDENTIFIER ) { return new QtiIntOrIdentifier ( $ v ) ; } } el... | Transform a given PHP scalar value to a QtiScalar equivalent object . |
3,315 | static public function isNull ( QtiDatatype $ value = null ) { return is_null ( $ value ) === true || ( $ value instanceof QtiString && $ value -> getValue ( ) === '' ) || ( $ value instanceof Container && count ( $ value ) === 0 ) ; } | Whether or not a QtiDatatype is considered to be null . |
3,316 | static public function equals ( QtiDatatype $ a = null , QtiDatatype $ b = null ) { return ( is_null ( $ a ) ? is_null ( $ b ) : $ a -> equals ( $ b ) ) ; } | Whether or not two QtiDatatype instances are equals . |
3,317 | protected function marshall ( QtiComponent $ component ) { $ element = $ this -> createElement ( $ component ) ; $ version = $ this -> getVersion ( ) ; $ this -> setDOMElementAttribute ( $ element , 'identifier' , $ component -> getIdentifier ( ) ) ; $ this -> setDOMElementAttribute ( $ element , 'base' , $ component -... | Marshall a PrintedVariable object into a DOMElement object . |
3,318 | protected function unmarshall ( DOMElement $ element ) { $ version = $ this -> getVersion ( ) ; if ( ( $ identifier = $ this -> getDOMElementAttributeAs ( $ element , 'identifier' ) ) !== null ) { $ component = new PrintedVariable ( $ identifier ) ; if ( ( $ format = $ this -> getDOMElementAttributeAs ( $ element , 'fo... | Unmarshall a DOMElement object corresponding to a printedVariable element . |
3,319 | public function setObjectLabel ( $ objectLabel ) { if ( is_string ( $ objectLabel ) === true ) { $ this -> objectLabel = $ objectLabel ; } else { $ msg = "The 'objectLabel' argument must be a string, '" . gettype ( $ objectLabel ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } } | Set an optional label for the image object to be inserted . An empty string indicates the GapImg has no objectLabel . |
3,320 | public static function getConstantByName ( $ name ) { switch ( strtolower ( $ name ) ) { case 'single' : return self :: SINGLE ; break ; case 'multiple' : return self :: MULTIPLE ; break ; case 'ordered' : return self :: ORDERED ; break ; case 'record' : return self :: RECORD ; break ; default : return false ; break ; ... | Get a constant value from its name . |
3,321 | public static function getNameByConstant ( $ constant ) { switch ( $ constant ) { case self :: SINGLE : return 'single' ; break ; case self :: MULTIPLE : return 'multiple' ; break ; case self :: ORDERED : return 'ordered' ; break ; case self :: RECORD : return 'record' ; break ; default : return false ; break ; } } | Get the name of a constant from its value . |
3,322 | public function process ( ) { $ operands = $ this -> getOperands ( ) ; $ expression = $ this -> getExpression ( ) ; if ( $ operands -> containsNull ( ) === true ) { return null ; } if ( $ operands -> sameCardinality ( ) === false ) { $ msg = "The Match Expression only accepts operands with the same cardinality." ; thro... | Process the Match Expression object . |
3,323 | public function setTimeDependent ( $ timeDependent ) { if ( gettype ( $ timeDependent ) === 'boolean' ) { $ this -> timeDependent = $ timeDependent ; } else { $ msg = "The timeDependent argument must be a boolean value, '" . gettype ( $ timeDependent ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } } | Set if the referenced Item is considered to be time dependent or not . |
3,324 | public static function createFromAssessmentItemRef ( AssessmentItemRef $ assessmentItemRef ) { $ identifier = $ assessmentItemRef -> getIdentifier ( ) ; $ href = $ assessmentItemRef -> getHref ( ) ; $ compactRef = new static ( $ identifier , $ href ) ; $ compactRef -> setBranchRules ( $ assessmentItemRef -> getBranchRu... | Create a new ExtendedAssessmentItemRef object from an AssessmentItemRef object . |
3,325 | public function setParamVariable ( $ paramVariable ) { if ( is_bool ( $ paramVariable ) === true ) { $ this -> paramVariable = $ paramVariable ; } else { $ msg = "The 'paramVariable' argument must be a boolean value, '" . gettype ( $ paramVariable ) . "'." ; throw new InvalidArgumentException ( $ msg ) ; } } | Set whether or not the template s value should be substituted for object parameter values . |
3,326 | public function setMathVariable ( $ mathVariable ) { if ( is_bool ( $ mathVariable ) === true ) { $ this -> mathVariable = $ mathVariable ; } else { $ msg = "The 'mathVariable' argument must be a boolean value, '" . gettype ( $ mathVariable ) . "'." ; throw new InvalidArgumentException ( $ msg ) ; } } | Set whether or not the template variable s value should be substituted for identifiers that match its name in MathML expressions . |
3,327 | public static function createFromDataModel ( VariableDeclaration $ variableDeclaration ) { $ variable = parent :: createFromDataModel ( $ variableDeclaration ) ; if ( $ variableDeclaration instanceof TemplateDeclaration ) { $ variable -> setParamVariable ( $ variableDeclaration -> isParamVariable ( ) ) ; $ variable -> ... | Create a TemplateVariable object from its data model representation . |
3,328 | protected function unmarshall ( DOMElement $ element ) { $ expressionElt = self :: getFirstChildElement ( $ element ) ; try { return new TemplateConstraint ( $ this -> getMarshallerFactory ( ) -> createMarshaller ( $ expressionElt ) -> unmarshall ( $ expressionElt ) ) ; } catch ( InvalidArgumentException $ e ) { $ msg ... | Unmarshall a DOMElement object corresponding to a QTI templateConstraint element . |
3,329 | public static function stringToCoords ( $ string , $ shape ) { if ( Format :: isCoords ( $ string ) ) { $ stringCoords = explode ( "," , $ string ) ; $ intCoords = array ( ) ; foreach ( $ stringCoords as $ sC ) { $ intCoords [ ] = intval ( $ sC ) ; } return new QtiCoords ( $ shape , $ intCoords ) ; } else { throw new U... | Transforms a string to a Coord object according to a given shape . |
3,330 | public function process ( ) { $ operands = $ this -> getOperands ( ) ; if ( ( $ c = count ( $ operands ) ) < 2 ) { $ msg = "The 'qtism.runtime.expressions.operators.custom.Implode' custom operator takes 2 sub-expressions as parameters, ${c} given." ; throw new OperatorProcessingException ( $ msg , $ this , OperatorProc... | Process the expression by implementing PHP core s implode function . |
3,331 | public function process ( ) { $ operands = $ this -> getOperands ( ) ; $ min = $ this -> getExpression ( ) -> getMin ( ) ; $ max = $ this -> getExpression ( ) -> getMax ( ) ; if ( is_string ( $ min ) === true ) { $ state = $ this -> getState ( ) ; $ varName = Utils :: sanitizeVariableRef ( $ min ) ; $ varValue = $ stat... | Process the AnyN processor . |
3,332 | protected function marshall ( QtiComponent $ component ) { $ element = static :: getDOMCradle ( ) -> createElement ( $ component -> getQtiClassName ( ) ) ; $ this -> setDOMElementAttribute ( $ element , 'shape' , QtiShape :: getNameByConstant ( $ component -> getShape ( ) ) ) ; $ this -> setDOMElementAttribute ( $ elem... | Marshall an AreaMapEntry object into a DOMElement object . |
3,333 | protected function unmarshall ( DOMElement $ element ) { if ( ( $ shape = $ this -> getDOMElementAttributeAs ( $ element , 'shape' ) ) !== null ) { $ shapeVal = QtiShape :: getConstantByName ( $ shape ) ; if ( $ shapeVal !== false ) { if ( ( $ coords = $ this -> getDOMElementAttributeAs ( $ element , 'coords' ) ) !== n... | Unmarshall a DOMElement object corresponding to a QTI areaMapEntry element . |
3,334 | public function setHref ( $ href ) { if ( Format :: isUri ( $ href ) === true ) { $ this -> href = $ href ; } else { $ msg = "The 'href' argument must be a URI, '" . $ href . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } } | Set the href attribute . |
3,335 | protected function marshall ( QtiComponent $ component ) { $ version = $ this -> getVersion ( ) ; $ element = $ this -> createElement ( $ component ) ; $ this -> setDOMElementAttribute ( $ element , 'identifier' , $ component -> getIdentifier ( ) ) ; if ( $ component -> isFixed ( ) === true ) { $ this -> setDOMElementA... | Marshall a Gap object into a DOMElement object . |
3,336 | protected function unmarshall ( DOMElement $ element ) { $ version = $ this -> getVersion ( ) ; if ( ( $ identifier = $ this -> getDOMElementAttributeAs ( $ element , 'identifier' ) ) !== null ) { $ component = new Gap ( $ identifier ) ; if ( ( $ fixed = $ this -> getDOMElementAttributeAs ( $ element , 'fixed' , 'boole... | Unmarshall a DOMElement object corresponding to an XHTML gap element . |
3,337 | public function setRule ( Rule $ rule ) { $ expectedType = $ this -> getRuleType ( ) ; if ( Reflection :: isInstanceOf ( $ rule , $ expectedType ) === true ) { $ this -> rule = $ rule ; } else { $ procClass = get_class ( $ this ) ; $ givenType = get_class ( $ rule ) ; $ msg = "The ${procClass} Rule Processor only proce... | Set the QTI Data Model Rule object to be processed . |
3,338 | public function open ( ) { if ( $ this -> isOpen ( ) === true ) { $ msg = "The MemoryStream is already open." ; throw new MemoryStreamException ( $ msg , $ this , MemoryStreamException :: ALREADY_OPEN ) ; } $ this -> setOpen ( true ) ; } | Open the binary stream . |
3,339 | public function close ( ) { if ( $ this -> isOpen ( ) === false ) { $ msg = "Cannot call close() a closed stream." ; throw new MemoryStreamException ( $ msg , $ this , MemoryStreamException :: NOT_OPEN ) ; } $ this -> setOpen ( false ) ; } | Close the binary stream . |
3,340 | public function rewind ( ) { if ( $ this -> isOpen ( ) === false ) { $ msg = "Cannot call rewind() on a closed MemoryStream." ; throw new MemoryStreamException ( $ msg , $ this , MemoryStreamException :: NOT_OPEN ) ; } $ this -> setPosition ( 0 ) ; } | Rewind the stream to its initial position . |
3,341 | public function flush ( ) { if ( $ this -> isOpen ( ) === true ) { $ this -> setBinary ( '' ) ; $ this -> rewind ( ) ; } else { $ msg = "Cannot flush a closed MemoryStream." ; throw new MemoryStreamException ( $ msg , $ this , MemoryStreamException :: NOT_OPEN ) ; } } | Flush the whole stream . |
3,342 | public function process ( ) { $ operands = $ this -> getOperands ( ) ; if ( $ operands -> containsNull ( ) ) { return null ; } if ( $ operands -> exclusivelySingle ( ) === false ) { $ msg = "The EqualRounded operator only accepts operands with a single cardinality." ; throw new OperatorProcessingException ( $ msg , $ t... | Process the EqualRounded operator . |
3,343 | public function createMarshaller ( $ object , array $ args = array ( ) ) { if ( $ object instanceof QtiComponent ) { $ qtiClassName = $ object -> getQtiClassName ( ) ; if ( $ this -> isWebComponentFriendly ( ) === true && in_array ( $ qtiClassName , Marshaller :: $ webComponentFriendlyClasses ) ) { $ qtiClassName = Xml... | Create a marshaller for a given QtiComponent or DOMElement object depending on the current mapping of the MarshallerFactory . If no mapping entry can be found the factory will perform a ultimate trial in the qtism \\ data \\ storage \\ xml \\ marshalling namespace to find the relevant Marshaller object . |
3,344 | public function setMinChoices ( $ minChoices ) { if ( is_int ( $ minChoices ) && $ minChoices > 0 ) { if ( $ minChoices > $ this -> getMaxChoices ( ) && $ this -> getMaxChoices ( ) > 0 ) { $ msg = "The 'minChoices' argument must respect the limits imposed by 'maxChoices'." ; throw new InvalidArgumentException ( $ msg )... | Set the minimum number of choices that the candidate is required to select to form a valid response . |
3,345 | public function setContent ( BlockStaticCollection $ content ) { if ( count ( $ content ) > 0 ) { $ this -> content = $ content ; } else { $ msg = "A HottextInteraction object must be composed of at least one BlockStatic object, none given." ; throw new InvalidArgumentException ( $ msg ) ; } } | Set the content of the interaction containing the hottext areas . |
3,346 | public function setResponseIdentifier ( $ responseIdentifier ) { if ( Format :: isIdentifier ( $ responseIdentifier , false ) === true ) { $ this -> responseIdentifier = $ responseIdentifier ; } else { $ msg = "The 'responseIdentifier' argument must be a valid QTI identifier." ; throw new InvalidArgumentException ( $ m... | Set the response variable associated with the interaction . |
3,347 | static public function getSchemaLocation ( $ version = '2.1' ) { $ version = Version :: appendPatchVersion ( $ version ) ; if ( $ version === '2.1.0' ) { $ filename = dirname ( __FILE__ ) . '/schemes/qtiv2p1/imsqti_v2p1.xsd' ; } elseif ( $ version === '2.1.1' ) { $ filename = dirname ( __FILE__ ) . '/schemes/qtiv2p1p1/... | Get the XML schema to use for a given QTI version . |
3,348 | static public function getXsdLocation ( DOMDocument $ document , $ namespaceUri ) { $ root = $ document -> documentElement ; $ location = false ; if ( empty ( $ root ) === false ) { $ schemaLocation = $ root -> getAttributeNS ( 'http://www.w3.org/2001/XMLSchema-instance' , 'schemaLocation' ) ; if ( empty ( $ schemaLoca... | Get the location of an XML Schema Definition file from a given namespace . |
3,349 | static public function anonimizeElement ( DOMElement $ element ) { $ stack = new SplStack ( ) ; $ traversed = array ( ) ; $ children = array ( ) ; $ stack -> push ( $ element ) ; while ( $ stack -> count ( ) > 0 ) { $ node = $ stack -> pop ( ) ; if ( $ node -> nodeType === XML_ELEMENT_NODE && $ node -> childNodes -> le... | Anonimize a given DOMElement . By anonimize we mean remove all namespace membership of an element and its child nodes . |
3,350 | static public function escapeXmlSpecialChars ( $ string , $ isAttribute = false ) { if ( $ isAttribute === false ) { $ fullSearch = array ( '"' , "'" , '<' , '>' ) ; $ fullReplace = array ( '"' , ''' , '<' , '>' ) ; $ string = str_replace ( '&' , '&' , $ string ) ; $ string = str_replace ( $ fullSea... | Escape XML Special characters from a given string . |
3,351 | static public function qtiFriendlyName ( $ wcName ) { $ qtiName = strtolower ( $ wcName ) ; $ qtiName = preg_replace ( '/^qti-/' , '' , $ qtiName ) ; return lcfirst ( str_replace ( '-' , '' , ucwords ( $ qtiName , '-' ) ) ) ; } | QTI friendly name of a Web Component friendly name . |
3,352 | public static function getChildElements ( $ element , $ withText = false ) { $ children = $ element -> childNodes ; $ returnValue = array ( ) ; for ( $ i = 0 ; $ i < $ children -> length ; $ i ++ ) { if ( $ children -> item ( $ i ) -> nodeType === XML_ELEMENT_NODE || ( $ withText === true && ( $ children -> item ( $ i ... | Get the children DOM Nodes with nodeType attribute equals to XML_ELEMENT_NODE . |
3,353 | public function setContent ( TrCollection $ content ) { if ( count ( $ content ) > 0 ) { $ this -> content = $ content ; } else { $ msg = "A Tbody object must be composed of at least 1 Tr object, none given." ; throw new InvalidArgumentException ( $ msg ) ; } } | Set the collection of Tr objects composing the Tbody . |
3,354 | public function marshall ( ) { $ ctx = $ this -> getContext ( ) ; $ streamAccess = $ ctx -> getStreamAccess ( ) ; try { $ scalar = $ this -> getToMarshall ( ) ; $ varName = $ this -> getContext ( ) -> generateVariableName ( $ scalar ) ; $ streamAccess -> writeVariable ( $ varName ) ; $ streamAccess -> writeEquals ( $ c... | Marshall the PHP scalar value to be marshalled into PHP source code . |
3,355 | protected function trace ( $ message ) { $ item = new StackTraceItem ( $ this -> getComponent ( ) , $ message ) ; $ this -> stackTrace -> push ( $ item ) ; } | Add an entry in the stack trace about the QtiComponent being processed . |
3,356 | public function setCorrectResponse ( QtiDatatype $ correctResponse = null ) { if ( $ correctResponse === null ) { $ this -> correctResponse = null ; } elseif ( Utils :: isBaseTypeCompliant ( $ this -> getBaseType ( ) , $ correctResponse ) === true && Utils :: isCardinalityCompliant ( $ this -> getCardinality ( ) , $ co... | Set the correct response . |
3,357 | public function isCorrect ( ) { if ( $ this -> hasCorrectResponse ( ) === true ) { $ correctResponse = $ this -> getCorrectResponse ( ) ; if ( $ correctResponse instanceof Comparable ) { return $ correctResponse -> equals ( $ this -> getValue ( ) ) ; } else { return $ correctResponse === $ this -> getValue ( ) ; } } re... | Whether the value of the ResponseVariable matches its correct response . |
3,358 | public static function createFromDataModel ( VariableDeclaration $ variableDeclaration ) { $ variable = parent :: createFromDataModel ( $ variableDeclaration ) ; if ( $ variableDeclaration instanceof ResponseDeclaration ) { $ variable -> setMapping ( $ variableDeclaration -> getMapping ( ) ) ; $ variable -> setAreaMapp... | Create a ResponseVariable object from its data model representation . |
3,359 | public function process ( ) { $ operands = $ this -> getOperands ( ) ; if ( $ operands -> containsNull ( ) === true ) { return null ; } if ( $ operands -> exclusivelySingle ( ) === false ) { $ msg = "The MathOperator operator only accepts operands with a single cardinality." ; throw new OperatorProcessingException ( $ ... | Process the MathOperator operator . |
3,360 | protected function marshall ( QtiComponent $ component ) { $ element = static :: getDOMCradle ( ) -> createElement ( $ component -> getQtiClassName ( ) ) ; $ this -> setDOMElementAttribute ( $ element , 'name' , MathEnumeration :: getNameByConstant ( $ component -> getName ( ) ) ) ; return $ element ; } | Marshall a MathConstant object into a DOMElement object . |
3,361 | protected function unmarshall ( DOMElement $ element ) { if ( ( $ name = $ this -> getDOMElementAttributeAs ( $ element , 'name' ) ) !== null ) { if ( ( $ cst = MathEnumeration :: getConstantByName ( $ name ) ) !== false ) { $ object = new MathConstant ( $ cst ) ; return $ object ; } else { $ msg = "'${name}' is not a ... | Unmarshall a DOMElement object corresponding to a QTI mathConstant element . |
3,362 | protected function unmarshall ( DOMElement $ element ) { if ( ( $ identifier = $ this -> getDOMElementAttributeAs ( $ element , 'identifier' , 'string' ) ) !== null ) { if ( ( $ value = $ this -> getDOMElementAttributeAs ( $ element , 'value' , 'string' ) ) !== null ) { if ( Format :: isFloat ( $ value ) ) { try { $ ob... | Unmarshall a DOMElement object corresponding to a QTI weight element . |
3,363 | protected function marshall ( QtiComponent $ component ) { $ element = static :: getDOMCradle ( ) -> createElement ( $ component -> getQtiClassName ( ) ) ; if ( $ component -> hasMinTime ( ) === true ) { $ this -> setDOMElementAttribute ( $ element , 'minTime' , $ component -> getMinTime ( ) -> getSeconds ( true ) ) ; ... | Marshall a TimeLimits object into a DOMElement object . |
3,364 | protected function unmarshall ( DOMElement $ element ) { $ object = new TimeLimits ( ) ; if ( ( $ value = $ this -> getDOMElementAttributeAs ( $ element , 'minTime' , 'string' ) ) !== null ) { $ object -> setMinTime ( StorageUtils :: stringToDatatype ( "PT${value}S" , BaseType :: DURATION ) ) ; } if ( ( $ value = $ thi... | Unmarshall a DOMElement object corresponding to a QTI timeLimits element . |
3,365 | public function containsNull ( ) { foreach ( array_keys ( $ this -> getDataPlaceHolder ( ) ) as $ key ) { $ v = $ this [ $ key ] ; if ( $ v instanceof Container && $ v -> isNull ( ) ) { return true ; } elseif ( ( $ v instanceof QtiString && $ v -> getValue ( ) === '' ) || is_null ( $ v ) ) { return true ; } } return fa... | Wether the collection contains a QTI Runtime compliant value which is considered to be NULL . |
3,366 | public function exclusivelyBoolean ( ) { if ( count ( $ this ) === 0 ) { return false ; } foreach ( array_keys ( $ this -> getDataPlaceHolder ( ) ) as $ key ) { $ v = $ this [ $ key ] ; if ( ( $ v instanceof MultipleContainer || $ v instanceof OrderedContainer ) && ( $ v -> isNull ( ) || $ v -> getBaseType ( ) !== Base... | Wether the collection contains exclusively boolean values or containers . |
3,367 | public function exclusivelySingle ( ) { if ( count ( $ this ) === 0 ) { return false ; } foreach ( array_keys ( $ this -> getDataPlaceHolder ( ) ) as $ key ) { $ v = $ this [ $ key ] ; if ( is_null ( $ v ) || $ v instanceof Container ) { return false ; } } return true ; } | Wether the collection contains exclusively single cardinality values . If the container is empty or contains a null value false is returned . |
3,368 | public function exclusivelyMultipleOrOrdered ( ) { if ( count ( $ this ) === 0 ) { return false ; } foreach ( array_keys ( $ this -> getDataPlaceHolder ( ) ) as $ key ) { $ v = $ this [ $ key ] ; if ( ! $ v instanceof MultipleContainer && ! $ v instanceof OrderedContainer ) { return false ; } } return true ; } | Whether the collection contains only MultipleContainer OR OrderedContainer . |
3,369 | public function exclusivelySingleOrMultiple ( ) { if ( count ( $ this ) === 0 ) { return false ; } foreach ( array_keys ( $ this -> getDataPlaceHolder ( ) ) as $ key ) { $ v = $ this [ $ key ] ; if ( $ v instanceof RecordContainer || $ v instanceof OrderedContainer ) { return false ; } } return true ; } | Wether the collection contains only Single primitive values or MultipleContainer objects . |
3,370 | public function exclusivelySingleOrOrdered ( ) { if ( count ( $ this ) === 0 ) { return false ; } foreach ( array_keys ( $ this -> getDataPlaceHolder ( ) ) as $ key ) { $ v = $ this [ $ key ] ; if ( $ v instanceof RecordContainer || ( $ v instanceof MultipleContainer && $ v -> getCardinality ( ) === Cardinality :: MULT... | Wether the collection contains only Single primitive values or OrderedContainer objects . |
3,371 | public function exclusivelyRecord ( ) { if ( count ( $ this ) === 0 ) { return false ; } foreach ( array_keys ( $ this -> getDataPlaceHolder ( ) ) as $ key ) { $ v = $ this [ $ key ] ; if ( ! $ v instanceof RecordContainer ) { return false ; } } return true ; } | Whether the collection contains exclusively RecordContainer objects . |
3,372 | public function exclusivelyOrdered ( ) { if ( count ( $ this ) === 0 ) { return false ; } foreach ( array_keys ( $ this -> getDataPlaceHolder ( ) ) as $ key ) { $ v = $ this [ $ key ] ; if ( ! $ v instanceof OrderedContainer ) { return false ; } } return true ; } | Wether the collection contains exclusively OrderedContainer objects . |
3,373 | public function anythingButRecord ( ) { foreach ( array_keys ( $ this -> getDataPlaceHolder ( ) ) as $ key ) { $ v = $ this [ $ key ] ; if ( $ v instanceof RecordContainer ) { return false ; } } return true ; } | Whether the collection contains anything but a RecordContainer object . |
3,374 | public function sameBaseType ( ) { $ operandsCount = count ( $ this ) ; if ( $ operandsCount > 0 && ! $ this -> containsNull ( ) ) { $ refValue = $ this [ 0 ] ; $ refType = RuntimeUtils :: inferBaseType ( $ refValue ) ; for ( $ i = 1 ; $ i < $ operandsCount ; $ i ++ ) { $ value = $ this [ $ i ] ; $ testType = RuntimeUt... | Whether the collection is composed of values with the same baseType . |
3,375 | public function exclusivelyPoint ( ) { if ( count ( $ this ) === 0 ) { return false ; } foreach ( array_keys ( $ this -> getDataPlaceHolder ( ) ) as $ key ) { $ v = $ this [ $ key ] ; if ( ( $ v instanceof MultipleContainer || $ v instanceof OrderedContainer ) && ( $ v -> isNull ( ) || $ v -> getBaseType ( ) !== BaseTy... | Wheter the collection of operands is composed exclusively of Point objects or Container objects with a point baseType . |
3,376 | public function exclusivelyDuration ( ) { if ( count ( $ this ) === 0 ) { return false ; } foreach ( array_keys ( $ this -> getDataPlaceHolder ( ) ) as $ key ) { $ v = $ this [ $ key ] ; if ( ( $ v instanceof MultipleContainer || $ v instanceof OrderedContainer ) && ( $ v -> isNull ( ) || $ v -> getBaseType ( ) !== Bas... | Wheter the collection of operands is composed exclusively of Duration objects or Container objects with a duration baseType . |
3,377 | public function process ( ) { $ operands = $ this -> getOperands ( ) ; if ( $ operands -> exclusivelyRecord ( ) === false ) { $ msg = "The FieldValue operator only accepts operands with a cardinality of record." ; throw new OperatorProcessingException ( $ msg , $ this , OperatorProcessingException :: WRONG_CARDINALITY ... | Process the FieldValue object . |
3,378 | public function process ( ) { $ testSession = $ this -> getState ( ) ; $ itemSubset = $ this -> getItemSubset ( ) ; $ numberSelected = 0 ; foreach ( $ itemSubset as $ item ) { $ itemSessions = $ testSession -> getAssessmentItemSessions ( $ item -> getIdentifier ( ) ) ; if ( $ itemSessions !== false ) { foreach ( $ item... | Process the related NumberSelected expression . |
3,379 | public function setSectionIdentifier ( $ sectionIdentifier ) { if ( Format :: isIdentifier ( $ sectionIdentifier ) || empty ( $ sectionIdentifier ) ) { $ this -> sectionIdentifier = $ sectionIdentifier ; } else { $ msg = "'${sectionIndentifier}' is not a valid QTI Identifier." ; throw new InvalidArgumentException ( $ m... | Set the assessment section identifier to match . |
3,380 | public function setScope ( $ scope ) { if ( in_array ( $ scope , TableCellScope :: asArray ( ) , true ) === true || $ scope === - 1 ) { $ this -> scope = $ scope ; } else { $ msg = "The 'scope' argument must be a value from the TableCellScope enumeration, '" . $ scope . "' given." ; throw new InvalidArgumentException (... | Set the scope attribute . |
3,381 | public function setAbbr ( $ abbr ) { if ( is_string ( $ abbr ) === true ) { $ this -> abbr = $ abbr ; } else { $ msg = "The 'abbr' attribute must be a string, '" . gettype ( $ abbr ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } } | Set the value of the abbr attribute . |
3,382 | public function setAxis ( $ axis ) { if ( is_string ( $ axis ) === true ) { $ this -> axis = $ axis ; } else { $ msg = "The 'axis' argument must be a string, '" . gettype ( $ axis ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } } | Set the value of the axis attribute . |
3,383 | public function setRowspan ( $ rowspan ) { if ( is_int ( $ rowspan ) === true ) { $ this -> rowspan = $ rowspan ; } else { $ msg = "The 'rowspan' argument must be an integer, '" . gettype ( $ rowspan ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } } | Set the value of the rowspan attribute . Give a negative value if no rowspan attribute is set . |
3,384 | public function setColspan ( $ colspan ) { if ( is_int ( $ colspan ) === true ) { $ this -> colspan = $ colspan ; } else { $ msg = "The 'colspan' argument must be an integer, '" . gettype ( $ colspan ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } } | Set the colspan attribute . Give a negative integer to indicate that no colspan is set . |
3,385 | protected function unmarshall ( DOMElement $ element ) { $ baseComponent = parent :: unmarshall ( $ element ) ; $ object = new NumberPresented ( ) ; $ object -> setSectionIdentifier ( $ baseComponent -> getSectionIdentifier ( ) ) ; $ object -> setIncludeCategories ( $ baseComponent -> getIncludeCategories ( ) ) ; $ obj... | Marshall an numberPresented QTI element in its NumberPresented object equivalent . |
3,386 | protected function marshall ( QtiComponent $ component ) { $ element = $ this -> createElement ( $ component ) ; $ object = $ component -> getObject ( ) ; $ element -> appendChild ( $ this -> getMarshallerFactory ( ) -> createMarshaller ( $ object ) -> marshall ( $ object ) ) ; foreach ( $ component -> getPositionObjec... | Marshall an PositionObjectStage object into a DOMElement object . |
3,387 | protected function unmarshall ( DOMElement $ element ) { $ objectElts = $ this -> getChildElementsByTagName ( $ element , 'object' ) ; if ( count ( $ objectElts ) > 0 ) { $ object = $ this -> getMarshallerFactory ( ) -> createMarshaller ( $ objectElts [ 0 ] ) -> unmarshall ( $ objectElts [ 0 ] ) ; $ positionObjectInter... | Unmarshall a DOMElement object corresponding to an positionObjectStage element . |
3,388 | protected function emptyFinal ( $ count ) { $ returnValue = array ( ) ; while ( $ count > 0 ) { $ returnValue [ ] = array_pop ( $ this -> final ) ; $ count -- ; } return array_reverse ( $ returnValue ) ; } | Empty the final stack to get the objects inside . |
3,389 | protected function marshall ( QtiComponent $ component ) { $ this -> resetTrail ( ) ; $ this -> resetFinal ( ) ; $ this -> resetMark ( ) ; $ this -> resetProcessed ( ) ; $ this -> pushTrail ( $ component ) ; while ( $ this -> countTrail ( ) > 0 ) { $ node = $ this -> popTrail ( ) ; if ( ! $ node instanceof DOMElement &... | Marshall a QtiComponent that might contain instances of the same class as itself . |
3,390 | protected function unmarshall ( DOMElement $ element , QtiComponent $ rootComponent = null ) { $ this -> resetTrail ( ) ; $ this -> resetFinal ( ) ; $ this -> resetMark ( ) ; $ this -> resetProcessed ( ) ; $ this -> pushTrail ( $ element ) ; while ( $ this -> countTrail ( ) > 0 ) { $ node = $ this -> popTrail ( ) ; if ... | Unmarshall a DOMElement that might contain elements of the same QTI class as itself . |
3,391 | public function setComponent ( QtiComponent $ rule ) { if ( $ rule instanceof Rule ) { parent :: setComponent ( $ rule ) ; } else { $ msg = "The RuleEngine class only accepts to execute Rule objects." ; throw new InvalidArgumentException ( $ msg ) ; } } | Set the Rule object to be executed by the engine . |
3,392 | public function process ( ) { $ rule = $ this -> getComponent ( ) ; $ context = $ this -> getContext ( ) ; $ processor = $ this -> getRuleProcessorFactory ( ) -> createProcessor ( $ rule ) ; $ processor -> setState ( $ context ) ; $ processor -> process ( ) ; $ this -> trace ( $ rule -> getQtiClassName ( ) ) ; } | Execute the current Rule object . |
3,393 | public function setId ( $ id = '' ) { if ( is_string ( $ id ) && ( empty ( $ id ) === true || Format :: isIdentifier ( $ id , false ) === true ) ) { $ this -> id = $ id ; } else { $ msg = "The 'id' argument of a body element must be a valid identifier or an empty string" ; throw new InvalidArgumentException ( $ msg ) ;... | Set the unique identifier of the body element . |
3,394 | public function setClass ( $ class = '' ) { if ( is_string ( $ class ) && ( empty ( $ class ) === true || Format :: isClass ( $ class ) === true ) ) { $ class = trim ( $ class ) ; $ this -> class = $ class ; } else { $ msg = "The 'class' argument must be a valid class name, '" . $ class . "' given" ; throw new InvalidA... | Set the classes assigned to the body element . |
3,395 | public function setDir ( $ dir ) { if ( in_array ( $ dir , Direction :: asArray ( ) , true ) === true ) { $ this -> dir = $ dir ; } else { $ msg = "The 'dir' argument must be a value from the Direction enumeration." ; throw new InvalidArgumentException ( $ msg ) ; } } | Set the direction in which body elements must be displayed . |
3,396 | protected function unmarshall ( DOMElement $ element ) { $ baseComponent = parent :: unmarshall ( $ element ) ; if ( ( $ outcomeIdentifier = $ this -> getDOMElementAttributeAs ( $ element , 'outcomeIdentifier' ) ) !== null ) { $ object = new OutcomeMinimum ( $ outcomeIdentifier ) ; $ object -> setSectionIdentifier ( $ ... | Marshall a outcomeMinimum QTI element in its OutcomeMinimum object equivalent . |
3,397 | public function setLowerBound ( $ lowerBound ) { if ( is_float ( $ lowerBound ) || is_double ( $ lowerBound ) || ( is_bool ( $ lowerBound ) && $ lowerBound === false ) ) { $ this -> lowerBound = $ lowerBound ; } else { $ msg = "The 'lowerBound' attribute must be a float or false, '" . gettype ( $ lowerBound ) . "' give... | Set the lower bound . |
3,398 | public function setDefaultValue ( $ defaultValue ) { if ( is_numeric ( $ defaultValue ) ) { $ this -> defaultValue = $ defaultValue ; } else { $ msg = "The 'defaultValue' argument must be a numeric value, '" . gettype ( $ defaultValue ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } } | Set the default value of the Mapping . |
3,399 | public function setMapEntries ( MapEntryCollection $ mapEntries ) { if ( count ( $ mapEntries ) > 0 ) { $ this -> mapEntries = $ mapEntries ; } else { $ msg = "A Mapping object must contain at least one MapEntry object, none given." ; throw new InvalidArgumentException ( $ msg ) ; } } | Set the collection of MapEntry objects which compose the Mapping . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.