repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
oat-sa/qti-sdk
src/qtism/data/content/interactions/GraphicGapMatchInteraction.php
GraphicGapMatchInteraction.setAssociableHotspots
public function setAssociableHotspots(AssociableHotspotCollection $associableHotspots) { if (count($associableHotspots) > 0) { $this->associableHotspots = $associableHotspots; } else { $msg = "A GraphicGapMatch interaction must be composed of at least 1 AssociableHotspot obje...
php
public function setAssociableHotspots(AssociableHotspotCollection $associableHotspots) { if (count($associableHotspots) > 0) { $this->associableHotspots = $associableHotspots; } else { $msg = "A GraphicGapMatch interaction must be composed of at least 1 AssociableHotspot obje...
[ "public", "function", "setAssociableHotspots", "(", "AssociableHotspotCollection", "$", "associableHotspots", ")", "{", "if", "(", "count", "(", "$", "associableHotspots", ")", ">", "0", ")", "{", "$", "this", "->", "associableHotspots", "=", "$", "associableHotsp...
Set the hotspots that define the gaps that are to be filled by the candidate. @param \qtism\data\content\interactions\AssociableHotspotCollection $associableHotspots A collection of AssociableHotspot objects. @throws \InvalidArgumentException If $associableHotspots is empty.
[ "Set", "the", "hotspots", "that", "define", "the", "gaps", "that", "are", "to", "be", "filled", "by", "the", "candidate", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/interactions/GraphicGapMatchInteraction.php#L131-L139
oat-sa/qti-sdk
src/qtism/data/content/interactions/PositionObjectStage.php
PositionObjectStage.setPositionObjectInteractions
public function setPositionObjectInteractions(PositionObjectInteractionCollection $positionObjectInteractions) { if (count($positionObjectInteractions) > 0) { $this->positionObjectInteractions = $positionObjectInteractions; } else { $msg = "A PositionObjectStage object must b...
php
public function setPositionObjectInteractions(PositionObjectInteractionCollection $positionObjectInteractions) { if (count($positionObjectInteractions) > 0) { $this->positionObjectInteractions = $positionObjectInteractions; } else { $msg = "A PositionObjectStage object must b...
[ "public", "function", "setPositionObjectInteractions", "(", "PositionObjectInteractionCollection", "$", "positionObjectInteractions", ")", "{", "if", "(", "count", "(", "$", "positionObjectInteractions", ")", ">", "0", ")", "{", "$", "this", "->", "positionObjectInterac...
Set the positionObjectInteractions composing the positionObjectStage. @param \qtism\data\content\interactions\PositionObjectInteractionCollection $positionObjectInteractions A collection of PositionObjectInteraction objects. @throws \InvalidArgumentException If $positionObjectInteractions is empty.
[ "Set", "the", "positionObjectInteractions", "composing", "the", "positionObjectStage", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/interactions/PositionObjectStage.php#L98-L106
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/SliderInteractionMarshaller.php
SliderInteractionMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = $this->createElement($component); $this->fillElement($element, $component); $this->setDOMElementAttribute($element, 'responseIdentifier', $component->getResponseIdentifier()); $this->setDOMElementAttribute($element, 'l...
php
protected function marshall(QtiComponent $component) { $element = $this->createElement($component); $this->fillElement($element, $component); $this->setDOMElementAttribute($element, 'responseIdentifier', $component->getResponseIdentifier()); $this->setDOMElementAttribute($element, 'l...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "$", "this", "->", "createElement", "(", "$", "component", ")", ";", "$", "this", "->", "fillElement", "(", "$", "element", ",", "$", "component", ...
Marshall a SliderInteraction object into a DOMElement object. @param \qtism\data\QtiComponent $component A SliderInteraction object. @return \DOMElement The according DOMElement object. @throws \qtism\data\storage\xml\marshalling\MarshallingException
[ "Marshall", "a", "SliderInteraction", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/SliderInteractionMarshaller.php#L46-L79
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/SliderInteractionMarshaller.php
SliderInteractionMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { if (($responseIdentifier = $this->getDOMElementAttributeAs($element, 'responseIdentifier')) !== null) { if (($lowerBound = $this->getDOMElementAttributeAs($element, 'lowerBound', 'float')) !== null) { if (($upperBound = $this...
php
protected function unmarshall(DOMElement $element) { if (($responseIdentifier = $this->getDOMElementAttributeAs($element, 'responseIdentifier')) !== null) { if (($lowerBound = $this->getDOMElementAttributeAs($element, 'lowerBound', 'float')) !== null) { if (($upperBound = $this...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "if", "(", "(", "$", "responseIdentifier", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'responseIdentifier'", ")", ")", "!==", "null", ")", ...
Unmarshall a DOMElement object corresponding to a SliderInteraction element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A SliderInteraction object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "SliderInteraction", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/SliderInteractionMarshaller.php#L88-L145
oat-sa/qti-sdk
src/qtism/data/QtiComponentIterator.php
QtiComponentIterator.pushOnTrail
protected function pushOnTrail(QtiComponent $source, QtiComponentCollection $components) { foreach (array_reverse($components->getArrayCopy()) as $c) { array_push($this->trail, array($source, $c)); $this->trailCount++; } }
php
protected function pushOnTrail(QtiComponent $source, QtiComponentCollection $components) { foreach (array_reverse($components->getArrayCopy()) as $c) { array_push($this->trail, array($source, $c)); $this->trailCount++; } }
[ "protected", "function", "pushOnTrail", "(", "QtiComponent", "$", "source", ",", "QtiComponentCollection", "$", "components", ")", "{", "foreach", "(", "array_reverse", "(", "$", "components", "->", "getArrayCopy", "(", ")", ")", "as", "$", "c", ")", "{", "a...
Push a trail entry on the trail. @param \qtism\data\QTIComponent $source From where we are coming from. @param \qtism\data\QTIComponentCollection $components The next components to explore.
[ "Push", "a", "trail", "entry", "on", "the", "trail", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/QtiComponentIterator.php#L188-L194
oat-sa/qti-sdk
src/qtism/data/QtiComponentIterator.php
QtiComponentIterator.rewind
public function rewind() { $trail = array(); $this->setTrail($trail); $classes = &$this->getClasses(); $traversed = array(); $this->setTraversed($traversed); $root = $this->getRootComponent(); $this->pushOnTrail($root, $root->getComponents()); $hasT...
php
public function rewind() { $trail = array(); $this->setTrail($trail); $classes = &$this->getClasses(); $traversed = array(); $this->setTraversed($traversed); $root = $this->getRootComponent(); $this->pushOnTrail($root, $root->getComponents()); $hasT...
[ "public", "function", "rewind", "(", ")", "{", "$", "trail", "=", "array", "(", ")", ";", "$", "this", "->", "setTrail", "(", "$", "trail", ")", ";", "$", "classes", "=", "&", "$", "this", "->", "getClasses", "(", ")", ";", "$", "traversed", "=",...
Rewind the iterator.
[ "Rewind", "the", "iterator", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/QtiComponentIterator.php#L273-L308
oat-sa/qti-sdk
src/qtism/data/QtiComponentIterator.php
QtiComponentIterator.next
public function next() { if ($this->trailCount > 0) { while ($this->trailCount > 0) { $trailEntry = $this->popFromTrail(); $component = $trailEntry[1]; $source = $trailEntry[0]; if ($this->isTraversed($component) === false) { ...
php
public function next() { if ($this->trailCount > 0) { while ($this->trailCount > 0) { $trailEntry = $this->popFromTrail(); $component = $trailEntry[1]; $source = $trailEntry[0]; if ($this->isTraversed($component) === false) { ...
[ "public", "function", "next", "(", ")", "{", "if", "(", "$", "this", "->", "trailCount", ">", "0", ")", "{", "while", "(", "$", "this", "->", "trailCount", ">", "0", ")", "{", "$", "trailEntry", "=", "$", "this", "->", "popFromTrail", "(", ")", "...
Moves the current position to the next QtiComponent object to be traversed.
[ "Moves", "the", "current", "position", "to", "the", "next", "QtiComponent", "object", "to", "be", "traversed", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/QtiComponentIterator.php#L353-L382
oat-sa/qti-sdk
src/qtism/data/storage/xml/XmlCompactDocument.php
XmlCompactDocument.resolveAssessmentItemRef
protected static function resolveAssessmentItemRef(ExtendedAssessmentItemRef $compactAssessmentItemRef, FileResolver $resolver) { try { $href = $resolver->resolve($compactAssessmentItemRef->getHref()); $doc = new XmlDocument(); $doc->load($href); ...
php
protected static function resolveAssessmentItemRef(ExtendedAssessmentItemRef $compactAssessmentItemRef, FileResolver $resolver) { try { $href = $resolver->resolve($compactAssessmentItemRef->getHref()); $doc = new XmlDocument(); $doc->load($href); ...
[ "protected", "static", "function", "resolveAssessmentItemRef", "(", "ExtendedAssessmentItemRef", "$", "compactAssessmentItemRef", ",", "FileResolver", "$", "resolver", ")", "{", "try", "{", "$", "href", "=", "$", "resolver", "->", "resolve", "(", "$", "compactAssess...
Dereference the file referenced by an assessmentItemRef and add outcome/responseDeclarations to the compact one. @param \qtism\data\ExtendedAssessmentItemRef $compactAssessmentItemRef A previously instantiated ExtendedAssessmentItemRef object. @param \qtism\data\storage\FileResolver $resolver The Resolver to be used t...
[ "Dereference", "the", "file", "referenced", "by", "an", "assessmentItemRef", "and", "add", "outcome", "/", "responseDeclarations", "to", "the", "compact", "one", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/XmlCompactDocument.php#L281-L328
oat-sa/qti-sdk
src/qtism/data/storage/xml/XmlCompactDocument.php
XmlCompactDocument.resolveAssessmentSectionRef
protected static function resolveAssessmentSectionRef(AssessmentSectionRef $assessmentSectionRef, FileResolver $resolver) { try { $href = $resolver->resolve($assessmentSectionRef->getHref()); $doc = new XmlDocument(); $doc->load($href); $doc->xInclude(); ...
php
protected static function resolveAssessmentSectionRef(AssessmentSectionRef $assessmentSectionRef, FileResolver $resolver) { try { $href = $resolver->resolve($assessmentSectionRef->getHref()); $doc = new XmlDocument(); $doc->load($href); $doc->xInclude(); ...
[ "protected", "static", "function", "resolveAssessmentSectionRef", "(", "AssessmentSectionRef", "$", "assessmentSectionRef", ",", "FileResolver", "$", "resolver", ")", "{", "try", "{", "$", "href", "=", "$", "resolver", "->", "resolve", "(", "$", "assessmentSectionRe...
Dereference the file referenced by an assessmentSectionRef. The xinclude elements in the target assessmentSection file will be resolved at the same time. @param \qtism\data\AssessmentSectionRef $assessmentSectionRef An AssessmentSectionRef object to dereference. @param \qtism\data\storage\FileResolver $resolver The R...
[ "Dereference", "the", "file", "referenced", "by", "an", "assessmentSectionRef", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/XmlCompactDocument.php#L340-L354
oat-sa/qti-sdk
src/qtism/data/storage/xml/XmlCompactDocument.php
XmlCompactDocument.schemaValidate
public function schemaValidate($filename = '') { if (empty($filename)) { $dS = DIRECTORY_SEPARATOR; // default xsd for AssessmentTest. $filename = dirname(__FILE__) . $dS . 'schemes' . $dS . 'qticompact_v1p0.xsd'; } parent::schemaValidate($filename); ...
php
public function schemaValidate($filename = '') { if (empty($filename)) { $dS = DIRECTORY_SEPARATOR; // default xsd for AssessmentTest. $filename = dirname(__FILE__) . $dS . 'schemes' . $dS . 'qticompact_v1p0.xsd'; } parent::schemaValidate($filename); ...
[ "public", "function", "schemaValidate", "(", "$", "filename", "=", "''", ")", "{", "if", "(", "empty", "(", "$", "filename", ")", ")", "{", "$", "dS", "=", "DIRECTORY_SEPARATOR", ";", "// default xsd for AssessmentTest.", "$", "filename", "=", "dirname", "("...
Validate the compact AssessmentTest XML document according to the relevant XSD schema. If $filename is provided, the file pointed by $filename will be used instead of the default schema. @param string $filename An optional filename to force the validation against a particular schema. @return boolean
[ "Validate", "the", "compact", "AssessmentTest", "XML", "document", "according", "to", "the", "relevant", "XSD", "schema", ".", "If", "$filename", "is", "provided", "the", "file", "pointed", "by", "$filename", "will", "be", "used", "instead", "of", "the", "defa...
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/XmlCompactDocument.php#L364-L373
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/OperatorProcessor.php
OperatorProcessor.setOperands
public function setOperands(OperandsCollection $operands) { // Check minimal operand count. $min = $this->getExpression()->getMinOperands(); $given = count($operands); if ($given < $min) { $msg = "The Operator to be processed '" . get_class($this) . "' requires at least ...
php
public function setOperands(OperandsCollection $operands) { // Check minimal operand count. $min = $this->getExpression()->getMinOperands(); $given = count($operands); if ($given < $min) { $msg = "The Operator to be processed '" . get_class($this) . "' requires at least ...
[ "public", "function", "setOperands", "(", "OperandsCollection", "$", "operands", ")", "{", "// Check minimal operand count.", "$", "min", "=", "$", "this", "->", "getExpression", "(", ")", "->", "getMinOperands", "(", ")", ";", "$", "given", "=", "count", "(",...
Set the collection of QTI Runtime compliant values to be used as the operands of the Operator to be processed. @param \qtism\runtime\expressions\operators\OperandsCollection $operands A collection of QTI Runtime compliant values. @throws \qtism\runtime\expressions\operators\OperatorProcessingException If The operands ...
[ "Set", "the", "collection", "of", "QTI", "Runtime", "compliant", "values", "to", "be", "used", "as", "the", "operands", "of", "the", "Operator", "to", "be", "processed", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/OperatorProcessor.php#L59-L82
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/ParamMarshaller.php
ParamMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = self::getDOMCradle()->createElement('param'); $this->setDOMElementAttribute($element, 'name', $component->getName()); $this->setDOMElementAttribute($element, 'value', $component->getValue()); $this->setDOMElementAttrib...
php
protected function marshall(QtiComponent $component) { $element = self::getDOMCradle()->createElement('param'); $this->setDOMElementAttribute($element, 'name', $component->getName()); $this->setDOMElementAttribute($element, 'value', $component->getValue()); $this->setDOMElementAttrib...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "self", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "'param'", ")", ";", "$", "this", "->", "setDOMElementAttribute", "(", "$", "elemen...
Marshall a Param object into a DOMElement object. @param \qtism\data\QtiComponent $component A Param object. @return \DOMElement The according DOMElement object. @throws \qtism\data\storage\xml\marshalling\MarshallingException
[ "Marshall", "a", "Param", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/ParamMarshaller.php#L45-L57
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/ParamMarshaller.php
ParamMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { if (($name = $this->getDOMElementAttributeAs($element, 'name')) === null) { // XSD use="required" but can be empty. $name = ''; } if (($value = $this->getDOMElementAttributeAs($element, 'value')) === null) { ...
php
protected function unmarshall(DOMElement $element) { if (($name = $this->getDOMElementAttributeAs($element, 'name')) === null) { // XSD use="required" but can be empty. $name = ''; } if (($value = $this->getDOMElementAttributeAs($element, 'value')) === null) { ...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "if", "(", "(", "$", "name", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'name'", ")", ")", "===", "null", ")", "{", "// XSD use=\"requir...
Unmarshall a DOMElement object corresponding to an XHTML param element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A Param object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "an", "XHTML", "param", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/ParamMarshaller.php#L66-L91
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/IntegerToFloatProcessor.php
IntegerToFloatProcessor.process
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->exclusivelySingle() === false) { $msg = "The IntegerToFloat operator only accepts operands with a single cardinality."; ...
php
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->exclusivelySingle() === false) { $msg = "The IntegerToFloat operator only accepts operands with a single cardinality."; ...
[ "public", "function", "process", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "if", "(", "$", "operands", "->", "containsNull", "(", ")", "===", "true", ")", "{", "return", "null", ";", "}", "if", "(", "$", ...
Process the IntegerToFloat operator. @return float|null A float value with the same numeric value as the sub-expression or NULL if the sub-expression is considered to be NULL. @throws \qtism\runtime\expressions\operators\OperatorProcessingException
[ "Process", "the", "IntegerToFloat", "operator", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/IntegerToFloatProcessor.php#L51-L72
oat-sa/qti-sdk
src/qtism/runtime/rules/LookupOutcomeValueProcessor.php
LookupOutcomeValueProcessor.process
public function process() { $state = $this->getState(); $rule = $this->getRule(); $identifier = $rule->getIdentifier(); $var = $state->getVariable($identifier); if (is_null($var) === true) { $msg = "The variable to set '${identifier}' does not exist in the curren...
php
public function process() { $state = $this->getState(); $rule = $this->getRule(); $identifier = $rule->getIdentifier(); $var = $state->getVariable($identifier); if (is_null($var) === true) { $msg = "The variable to set '${identifier}' does not exist in the curren...
[ "public", "function", "process", "(", ")", "{", "$", "state", "=", "$", "this", "->", "getState", "(", ")", ";", "$", "rule", "=", "$", "this", "->", "getRule", "(", ")", ";", "$", "identifier", "=", "$", "rule", "->", "getIdentifier", "(", ")", ...
Process the LookupOutcomeValue rule. A RuleProcessingException will be thrown if: * The outcome variable to set does not exist. * The variable to set is not an OutcomeVariable * The outcome variable's baseType does not match the baseType of the affected value (the result of the bound expression). * The outcome variab...
[ "Process", "the", "LookupOutcomeValue", "rule", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rules/LookupOutcomeValueProcessor.php#L65-L148
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/TruncateProcessor.php
TruncateProcessor.process
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->exclusivelySingle() === false) { $msg = "The Truncate operator only accepts operands with a single cardinality."; ...
php
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->exclusivelySingle() === false) { $msg = "The Truncate operator only accepts operands with a single cardinality."; ...
[ "public", "function", "process", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "if", "(", "$", "operands", "->", "containsNull", "(", ")", "===", "true", ")", "{", "return", "null", ";", "}", "if", "(", "$", ...
Process the Truncate operator. @return integer|null The truncated value or NULL if the sub-expression is NaN or if the sub-expression is NULL. @throws \qtism\runtime\expressions\operators\OperatorProcessingException
[ "Process", "the", "Truncate", "operator", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/TruncateProcessor.php#L56-L83
oat-sa/qti-sdk
src/qtism/runtime/expressions/ExpressionProcessor.php
ExpressionProcessor.setExpression
public function setExpression(Expression $expression) { $expectedType = $this->getExpressionType(); if (ReflectionUtils::isInstanceOf($expression, $expectedType) === true) { $this->expression = $expression; } else { $procClass = get_class($this); ...
php
public function setExpression(Expression $expression) { $expectedType = $this->getExpressionType(); if (ReflectionUtils::isInstanceOf($expression, $expectedType) === true) { $this->expression = $expression; } else { $procClass = get_class($this); ...
[ "public", "function", "setExpression", "(", "Expression", "$", "expression", ")", "{", "$", "expectedType", "=", "$", "this", "->", "getExpressionType", "(", ")", ";", "if", "(", "ReflectionUtils", "::", "isInstanceOf", "(", "$", "expression", ",", "$", "exp...
Set the QTI Data Model Expression to be processed. @param \qtism\data\expressions\Expression $expression A QTI Data Model Expression object. @throws \InvalidArgumentException If $expression is not a subclass nor implements the Expression type returned by the getExpressionType method.
[ "Set", "the", "QTI", "Data", "Model", "Expression", "to", "be", "processed", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/ExpressionProcessor.php#L72-L86
oat-sa/qti-sdk
src/qtism/data/state/VariableDeclaration.php
VariableDeclaration.setCardinality
public function setCardinality($cardinality) { if (in_array($cardinality, Cardinality::asArray())) { $this->cardinality = $cardinality; } else { $msg = "The cardinality must be a value from the Cardinality enumeration."; throw new InvalidArgumentException($msg); ...
php
public function setCardinality($cardinality) { if (in_array($cardinality, Cardinality::asArray())) { $this->cardinality = $cardinality; } else { $msg = "The cardinality must be a value from the Cardinality enumeration."; throw new InvalidArgumentException($msg); ...
[ "public", "function", "setCardinality", "(", "$", "cardinality", ")", "{", "if", "(", "in_array", "(", "$", "cardinality", ",", "Cardinality", "::", "asArray", "(", ")", ")", ")", "{", "$", "this", "->", "cardinality", "=", "$", "cardinality", ";", "}", ...
Set the cardinality of the variable. @param int $cardinality A value from the Cardinality enumeration. @throws \InvalidArgumentException If $cardinality is not a value from the Cardinality enumeration.
[ "Set", "the", "cardinality", "of", "the", "variable", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/VariableDeclaration.php#L235-L243
oat-sa/qti-sdk
src/qtism/runtime/rendering/markup/xhtml/AbstractXhtmlRenderer.php
AbstractXhtmlRenderer.render
public function render($component, $base = '') { $renderingEngine = $this->getRenderingEngine(); $doc = $renderingEngine->getDocument(); $fragment = $doc->createDocumentFragment(); // Apply rendering... $this->renderingImplementation($fragment, $component, $base); /...
php
public function render($component, $base = '') { $renderingEngine = $this->getRenderingEngine(); $doc = $renderingEngine->getDocument(); $fragment = $doc->createDocumentFragment(); // Apply rendering... $this->renderingImplementation($fragment, $component, $base); /...
[ "public", "function", "render", "(", "$", "component", ",", "$", "base", "=", "''", ")", "{", "$", "renderingEngine", "=", "$", "this", "->", "getRenderingEngine", "(", ")", ";", "$", "doc", "=", "$", "renderingEngine", "->", "getDocument", "(", ")", "...
Render a QtiComponent into a DOMDocumentFragment that will be registered in the current rendering context. @return \DOMDocumentFragment A DOMDocumentFragment object containing the rendered $component into another constitution with its children rendering appended. @throws \qtism\runtime\rendering\RenderingException If ...
[ "Render", "a", "QtiComponent", "into", "a", "DOMDocumentFragment", "that", "will", "be", "registered", "in", "the", "current", "rendering", "context", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/markup/xhtml/AbstractXhtmlRenderer.php#L82-L102
oat-sa/qti-sdk
src/qtism/runtime/rendering/markup/xhtml/AbstractXhtmlRenderer.php
AbstractXhtmlRenderer.renderingImplementation
protected function renderingImplementation(DOMDocumentFragment $fragment, QtiComponent $component, $base = '') { $this->appendElement($fragment, $component, $base); $this->appendChildren($fragment, $component, $base); $this->appendAttributes($fragment, $component, $base); if ($this-...
php
protected function renderingImplementation(DOMDocumentFragment $fragment, QtiComponent $component, $base = '') { $this->appendElement($fragment, $component, $base); $this->appendChildren($fragment, $component, $base); $this->appendAttributes($fragment, $component, $base); if ($this-...
[ "protected", "function", "renderingImplementation", "(", "DOMDocumentFragment", "$", "fragment", ",", "QtiComponent", "$", "component", ",", "$", "base", "=", "''", ")", "{", "$", "this", "->", "appendElement", "(", "$", "fragment", ",", "$", "component", ",",...
A default rendering implementation focusing on a given $fragment and $component. @param \DOMDocumentFragment $fragment @param \qtism\data\QtiComponent $component @param string $base An optional base path to be used for rendering.
[ "A", "default", "rendering", "implementation", "focusing", "on", "a", "given", "$fragment", "and", "$component", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/markup/xhtml/AbstractXhtmlRenderer.php#L111-L144
oat-sa/qti-sdk
src/qtism/runtime/rendering/markup/xhtml/AbstractXhtmlRenderer.php
AbstractXhtmlRenderer.appendElement
protected function appendElement(DOMDocumentFragment $fragment, QtiComponent $component, $base = '') { $tagName = ($this->hasReplacementTagName() === true) ? $this->getReplacementTagName() : $component->getQtiClassName(); $fragment->appendChild($this->getRenderingEngine()->getDocument()->createEleme...
php
protected function appendElement(DOMDocumentFragment $fragment, QtiComponent $component, $base = '') { $tagName = ($this->hasReplacementTagName() === true) ? $this->getReplacementTagName() : $component->getQtiClassName(); $fragment->appendChild($this->getRenderingEngine()->getDocument()->createEleme...
[ "protected", "function", "appendElement", "(", "DOMDocumentFragment", "$", "fragment", ",", "QtiComponent", "$", "component", ",", "$", "base", "=", "''", ")", "{", "$", "tagName", "=", "(", "$", "this", "->", "hasReplacementTagName", "(", ")", "===", "true"...
Append a new DOMElement to the currently rendered $fragment which is suitable to $component. @param \DOMDocumentFragment $fragment @param \qtism\data\QtiComponent $component
[ "Append", "a", "new", "DOMElement", "to", "the", "currently", "rendered", "$fragment", "which", "is", "suitable", "to", "$component", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/markup/xhtml/AbstractXhtmlRenderer.php#L153-L157
oat-sa/qti-sdk
src/qtism/runtime/rendering/markup/xhtml/AbstractXhtmlRenderer.php
AbstractXhtmlRenderer.appendChildren
protected function appendChildren(DOMDocumentFragment $fragment, QtiComponent $component, $base = '') { foreach ($this->getRenderingEngine()->getChildrenRenderings($component) as $childrenRendering) { $fragment->firstChild->appendChild($childrenRendering); } }
php
protected function appendChildren(DOMDocumentFragment $fragment, QtiComponent $component, $base = '') { foreach ($this->getRenderingEngine()->getChildrenRenderings($component) as $childrenRendering) { $fragment->firstChild->appendChild($childrenRendering); } }
[ "protected", "function", "appendChildren", "(", "DOMDocumentFragment", "$", "fragment", ",", "QtiComponent", "$", "component", ",", "$", "base", "=", "''", ")", "{", "foreach", "(", "$", "this", "->", "getRenderingEngine", "(", ")", "->", "getChildrenRenderings"...
Append the children renderings of $components to the currently rendered $fragment. @param \DOMDocumentFragment $fragment @param \qtism\data\QtiComponent $component
[ "Append", "the", "children", "renderings", "of", "$components", "to", "the", "currently", "rendered", "$fragment", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/markup/xhtml/AbstractXhtmlRenderer.php#L165-L170
oat-sa/qti-sdk
src/qtism/runtime/rendering/markup/xhtml/AbstractXhtmlRenderer.php
AbstractXhtmlRenderer.appendAttributes
protected function appendAttributes(DOMDocumentFragment $fragment, QtiComponent $component, $base = '') { $this->handleXmlBase($component, $fragment->firstChild); }
php
protected function appendAttributes(DOMDocumentFragment $fragment, QtiComponent $component, $base = '') { $this->handleXmlBase($component, $fragment->firstChild); }
[ "protected", "function", "appendAttributes", "(", "DOMDocumentFragment", "$", "fragment", ",", "QtiComponent", "$", "component", ",", "$", "base", "=", "''", ")", "{", "$", "this", "->", "handleXmlBase", "(", "$", "component", ",", "$", "fragment", "->", "fi...
Append the necessary attributes of $component to the currently rendered $fragment. @param \DOMDocumentFragment $fragment @param \qtism\data\QtiComponent $component
[ "Append", "the", "necessary", "attributes", "of", "$component", "to", "the", "currently", "rendered", "$fragment", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/markup/xhtml/AbstractXhtmlRenderer.php#L178-L181
oat-sa/qti-sdk
src/qtism/runtime/rendering/markup/xhtml/AbstractXhtmlRenderer.php
AbstractXhtmlRenderer.additionalClass
public function additionalClass($additionalClass) { $additionalClasses = $this->getAdditionalClasses(); if (($key = array_search($additionalClass, $additionalClasses)) !== false) { unset($additionalClasses[$key]); } $additionalClasses[] = $additionalClas...
php
public function additionalClass($additionalClass) { $additionalClasses = $this->getAdditionalClasses(); if (($key = array_search($additionalClass, $additionalClasses)) !== false) { unset($additionalClasses[$key]); } $additionalClasses[] = $additionalClas...
[ "public", "function", "additionalClass", "(", "$", "additionalClass", ")", "{", "$", "additionalClasses", "=", "$", "this", "->", "getAdditionalClasses", "(", ")", ";", "if", "(", "(", "$", "key", "=", "array_search", "(", "$", "additionalClass", ",", "$", ...
Add an additional CSS class to be rendered. @param string $additionalClass A CSS class.
[ "Add", "an", "additional", "CSS", "class", "to", "be", "rendered", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/markup/xhtml/AbstractXhtmlRenderer.php#L262-L272
oat-sa/qti-sdk
src/qtism/runtime/rendering/markup/xhtml/AbstractXhtmlRenderer.php
AbstractXhtmlRenderer.additionalUserClass
public function additionalUserClass($additionalUserClass) { $additionalClasses = $this->getAdditionalUserClasses(); if (($key = array_search($additionalUserClass, $additionalClasses)) !== false) { unset($additionalClasses[$key]); } $additionalClasses[] =...
php
public function additionalUserClass($additionalUserClass) { $additionalClasses = $this->getAdditionalUserClasses(); if (($key = array_search($additionalUserClass, $additionalClasses)) !== false) { unset($additionalClasses[$key]); } $additionalClasses[] =...
[ "public", "function", "additionalUserClass", "(", "$", "additionalUserClass", ")", "{", "$", "additionalClasses", "=", "$", "this", "->", "getAdditionalUserClasses", "(", ")", ";", "if", "(", "(", "$", "key", "=", "array_search", "(", "$", "additionalUserClass",...
Add an additional user CSS class to be rendered. @param string $additionalUserClass
[ "Add", "an", "additional", "user", "CSS", "class", "to", "be", "rendered", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/markup/xhtml/AbstractXhtmlRenderer.php#L309-L319
oat-sa/qti-sdk
src/qtism/runtime/rendering/qtipl/rules/OutcomeConditionQtiPLRenderer.php
OutcomeConditionQtiPLRenderer.render
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); $qtipl = $renderer->render($something->getOutcomeIf()); foreach ($something->getOutcomeElseIfs() as $elseif) { $qtipl .= " " . $renderer->render($elseif); } $qtipl .= ($somethin...
php
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); $qtipl = $renderer->render($something->getOutcomeIf()); foreach ($something->getOutcomeElseIfs() as $elseif) { $qtipl .= " " . $renderer->render($elseif); } $qtipl .= ($somethin...
[ "public", "function", "render", "(", "$", "something", ")", "{", "$", "renderer", "=", "new", "QtiPLRenderer", "(", "$", "this", "->", "getCRO", "(", ")", ")", ";", "$", "qtipl", "=", "$", "renderer", "->", "render", "(", "$", "something", "->", "get...
Render a QtiComponent object into another constitution. @param mixed $something Something to render into another consitution. @return mixed The rendered component into another constitution. @throws \qtism\runtime\rendering\RenderingException If something goes wrong while rendering the component.
[ "Render", "a", "QtiComponent", "object", "into", "another", "constitution", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/qtipl/rules/OutcomeConditionQtiPLRenderer.php#L45-L56
oat-sa/qti-sdk
src/qtism/data/expressions/operators/Equal.php
Equal.setToleranceMode
public function setToleranceMode($toleranceMode) { if (in_array($toleranceMode, ToleranceMode::asArray(), true)) { $this->toleranceMode = $toleranceMode; } else { $msg = "The toleranceMode argument must be a value from the ToleranceMode enumeration, '" . $toleranceMode . "' g...
php
public function setToleranceMode($toleranceMode) { if (in_array($toleranceMode, ToleranceMode::asArray(), true)) { $this->toleranceMode = $toleranceMode; } else { $msg = "The toleranceMode argument must be a value from the ToleranceMode enumeration, '" . $toleranceMode . "' g...
[ "public", "function", "setToleranceMode", "(", "$", "toleranceMode", ")", "{", "if", "(", "in_array", "(", "$", "toleranceMode", ",", "ToleranceMode", "::", "asArray", "(", ")", ",", "true", ")", ")", "{", "$", "this", "->", "toleranceMode", "=", "$", "t...
Set the tolerance mode. @param integer $toleranceMode A value from the ToleranceMode enumeration. @throws \InvalidArgumentException If $toleranceMode is not a value from the ToleranceMode enumeration.
[ "Set", "the", "tolerance", "mode", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/expressions/operators/Equal.php#L129-L137
oat-sa/qti-sdk
src/qtism/data/expressions/operators/Equal.php
Equal.setTolerance
public function setTolerance(array $tolerance) { if (($this->getToleranceMode() == ToleranceMode::ABSOLUTE || $this->getToleranceMode() == ToleranceMode::RELATIVE) && count($tolerance) < 1) { $msg = "The tolerance array must contain at least t0."; throw new InvalidArgumentException($...
php
public function setTolerance(array $tolerance) { if (($this->getToleranceMode() == ToleranceMode::ABSOLUTE || $this->getToleranceMode() == ToleranceMode::RELATIVE) && count($tolerance) < 1) { $msg = "The tolerance array must contain at least t0."; throw new InvalidArgumentException($...
[ "public", "function", "setTolerance", "(", "array", "$", "tolerance", ")", "{", "if", "(", "(", "$", "this", "->", "getToleranceMode", "(", ")", "==", "ToleranceMode", "::", "ABSOLUTE", "||", "$", "this", "->", "getToleranceMode", "(", ")", "==", "Toleranc...
Set the tolerance array where index[0] is t0 and index[1] is t1. Please note that if there is no t1, t0 is used as t0 AND t1. @param array $tolerance An array of float|variableRef. @throws \InvalidArgumentException If the $tolerance count is less than 1 or greather than 2.
[ "Set", "the", "tolerance", "array", "where", "index", "[", "0", "]", "is", "t0", "and", "index", "[", "1", "]", "is", "t1", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/expressions/operators/Equal.php#L157-L168
oat-sa/qti-sdk
src/qtism/data/expressions/operators/Equal.php
Equal.setIncludeLowerBound
public function setIncludeLowerBound($includeLowerBound) { if (is_bool($includeLowerBound)) { $this->includeLowerBound = $includeLowerBound; } else { $msg = "The includeLowerBound argument must be a boolean, '" . gettype($includeLowerBound) . "' given."; throw new...
php
public function setIncludeLowerBound($includeLowerBound) { if (is_bool($includeLowerBound)) { $this->includeLowerBound = $includeLowerBound; } else { $msg = "The includeLowerBound argument must be a boolean, '" . gettype($includeLowerBound) . "' given."; throw new...
[ "public", "function", "setIncludeLowerBound", "(", "$", "includeLowerBound", ")", "{", "if", "(", "is_bool", "(", "$", "includeLowerBound", ")", ")", "{", "$", "this", "->", "includeLowerBound", "=", "$", "includeLowerBound", ";", "}", "else", "{", "$", "msg...
Set whether or not the lower bound must be included in the comparison. @param boolean $includeLowerBound @throws \InvalidArgumentException If $includedLowerBound is not a boolean value.
[ "Set", "whether", "or", "not", "the", "lower", "bound", "must", "be", "included", "in", "the", "comparison", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/expressions/operators/Equal.php#L188-L196
oat-sa/qti-sdk
src/qtism/data/expressions/operators/Equal.php
Equal.setIncludeUpperBound
public function setIncludeUpperBound($includeUpperBound) { if (is_bool($includeUpperBound)) { $this->includeUpperBound = $includeUpperBound; } else { $msg = "The includeUpperBound argument must be a boolean, '" . gettype($includeUpperBound) . "' given."; throw new...
php
public function setIncludeUpperBound($includeUpperBound) { if (is_bool($includeUpperBound)) { $this->includeUpperBound = $includeUpperBound; } else { $msg = "The includeUpperBound argument must be a boolean, '" . gettype($includeUpperBound) . "' given."; throw new...
[ "public", "function", "setIncludeUpperBound", "(", "$", "includeUpperBound", ")", "{", "if", "(", "is_bool", "(", "$", "includeUpperBound", ")", ")", "{", "$", "this", "->", "includeUpperBound", "=", "$", "includeUpperBound", ";", "}", "else", "{", "$", "msg...
Set whether or not the upper bound must be included in the comparison. @param boolean $includeUpperBound @throws \InvalidArgumentException If $includeUpperBound is not a boolean.
[ "Set", "whether", "or", "not", "the", "upper", "bound", "must", "be", "included", "in", "the", "comparison", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/expressions/operators/Equal.php#L214-L222
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/MultipleProcessor.php
MultipleProcessor.process
public function process() { $operands = $this->getOperands(); if (count($operands) === 0) { return null; } if ($operands->exclusivelySingleOrMultiple() === false) { $msg = "The Multiple operator only accepts operands with single or omultiple cardinality."; ...
php
public function process() { $operands = $this->getOperands(); if (count($operands) === 0) { return null; } if ($operands->exclusivelySingleOrMultiple() === false) { $msg = "The Multiple operator only accepts operands with single or omultiple cardinality."; ...
[ "public", "function", "process", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "if", "(", "count", "(", "$", "operands", ")", "===", "0", ")", "{", "return", "null", ";", "}", "if", "(", "$", "operands", "-...
Process the current expression. @return \qtism\runtime\common\MultipleContainer|null A MultipleContainer object or NULL. @throws \qtism\runtime\expressions\operators\OperatorProcessingException
[ "Process", "the", "current", "expression", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/MultipleProcessor.php#L54-L96
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/MultipleProcessor.php
MultipleProcessor.appendValue
protected static function appendValue(MultipleContainer $container, $value) { if ($value instanceof MultipleContainer) { foreach ($value as $v) { $container[] = $v; } } else { // primitive type. $container[] = $value; } }
php
protected static function appendValue(MultipleContainer $container, $value) { if ($value instanceof MultipleContainer) { foreach ($value as $v) { $container[] = $v; } } else { // primitive type. $container[] = $value; } }
[ "protected", "static", "function", "appendValue", "(", "MultipleContainer", "$", "container", ",", "$", "value", ")", "{", "if", "(", "$", "value", "instanceof", "MultipleContainer", ")", "{", "foreach", "(", "$", "value", "as", "$", "v", ")", "{", "$", ...
Append a value (A MultipleContainer or a primitive datatype) to a given $container. @param \qtism\runtime\common\MultipleContainer $container A MultipleContainer object you want to append something to. @param scalar|\qtism\runtime\common\MultipleContainer $value A value to append to the $container.
[ "Append", "a", "value", "(", "A", "MultipleContainer", "or", "a", "primitive", "datatype", ")", "to", "a", "given", "$container", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/MultipleProcessor.php#L104-L114
oat-sa/qti-sdk
src/qtism/data/content/PrintedVariable.php
PrintedVariable.setFormat
public function setFormat($format) { if (Format::isString256($format) === true) { $this->format = $format; } else { $msg = "The 'format' argument must be a string with at most 256 characters, '" . $format . "' given."; throw new InvalidArgumentException($msg); ...
php
public function setFormat($format) { if (Format::isString256($format) === true) { $this->format = $format; } else { $msg = "The 'format' argument must be a string with at most 256 characters, '" . $format . "' given."; throw new InvalidArgumentException($msg); ...
[ "public", "function", "setFormat", "(", "$", "format", ")", "{", "if", "(", "Format", "::", "isString256", "(", "$", "format", ")", "===", "true", ")", "{", "$", "this", "->", "format", "=", "$", "format", ";", "}", "else", "{", "$", "msg", "=", ...
Set the format conversion to use when converting numerical values to strings. @param string $format See Number Formatting Rules for details. @throws \InvalidArgumentException If $format is not a string with at most 256 characters. @see http://www.imsglobal.org/question/qtiv2p1/imsqti_infov2p1.html#section10074
[ "Set", "the", "format", "conversion", "to", "use", "when", "converting", "numerical", "values", "to", "strings", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/PrintedVariable.php#L223-L231
oat-sa/qti-sdk
src/qtism/data/content/PrintedVariable.php
PrintedVariable.setPowerForm
public function setPowerForm($powerForm) { if (is_bool($powerForm) === true) { $this->powerForm = $powerForm; } else { $msg = "The 'powerForm' argument must be a boolean value, '" . gettype($powerForm) . "' given."; throw new InvalidArgumentException($msg); ...
php
public function setPowerForm($powerForm) { if (is_bool($powerForm) === true) { $this->powerForm = $powerForm; } else { $msg = "The 'powerForm' argument must be a boolean value, '" . gettype($powerForm) . "' given."; throw new InvalidArgumentException($msg); ...
[ "public", "function", "setPowerForm", "(", "$", "powerForm", ")", "{", "if", "(", "is_bool", "(", "$", "powerForm", ")", "===", "true", ")", "{", "$", "this", "->", "powerForm", "=", "$", "powerForm", ";", "}", "else", "{", "$", "msg", "=", "\"The 'p...
Set whether the variable value (when it's a float) must use the 'e' format for display. @param boolean $powerForm @throws \InvalidArgumentException If $powerForm is not a boolean value.
[ "Set", "whether", "the", "variable", "value", "(", "when", "it", "s", "a", "float", ")", "must", "use", "the", "e", "format", "for", "display", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/PrintedVariable.php#L262-L270
oat-sa/qti-sdk
src/qtism/data/content/PrintedVariable.php
PrintedVariable.setBase
public function setBase($base) { if (is_int($base) === true || Format::isVariableRef($base) === true) { $this->base = $base; } else { $msg = "The 'base' argument must be an integer or a variable reference, '" . $base . "' given."; throw new InvalidArgumentExceptio...
php
public function setBase($base) { if (is_int($base) === true || Format::isVariableRef($base) === true) { $this->base = $base; } else { $msg = "The 'base' argument must be an integer or a variable reference, '" . $base . "' given."; throw new InvalidArgumentExceptio...
[ "public", "function", "setBase", "(", "$", "base", ")", "{", "if", "(", "is_int", "(", "$", "base", ")", "===", "true", "||", "Format", "::", "isVariableRef", "(", "$", "base", ")", "===", "true", ")", "{", "$", "this", "->", "base", "=", "$", "b...
Set the number base to use when converting integer variables to strings. @param integer|string $base A base to use for conversion as an integer or a variable reference. @throws \InvalidArgumentException If $base is not an integer nor a variable reference.
[ "Set", "the", "number", "base", "to", "use", "when", "converting", "integer", "variables", "to", "strings", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/PrintedVariable.php#L289-L297
oat-sa/qti-sdk
src/qtism/data/content/PrintedVariable.php
PrintedVariable.setIndex
public function setIndex($index) { if (is_int($index) === true || Format::isVariableRef($index) === true) { $this->index = $index; } else { $msg = "The 'index' argument must be an integer or a variable reference, '" . $index . "' given."; throw new InvalidArgument...
php
public function setIndex($index) { if (is_int($index) === true || Format::isVariableRef($index) === true) { $this->index = $index; } else { $msg = "The 'index' argument must be an integer or a variable reference, '" . $index . "' given."; throw new InvalidArgument...
[ "public", "function", "setIndex", "(", "$", "index", ")", "{", "if", "(", "is_int", "(", "$", "index", ")", "===", "true", "||", "Format", "::", "isVariableRef", "(", "$", "index", ")", "===", "true", ")", "{", "$", "this", "->", "index", "=", "$",...
Set the index to use when displaying a variable of ordered cardinality. Give a negative integer if there is no index indicated. @param integer|string $index An integer or variable reference. @throws \InvalidArgumentException If $index is not an integer nor a variable reference.
[ "Set", "the", "index", "to", "use", "when", "displaying", "a", "variable", "of", "ordered", "cardinality", ".", "Give", "a", "negative", "integer", "if", "there", "is", "no", "index", "indicated", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/PrintedVariable.php#L316-L324
oat-sa/qti-sdk
src/qtism/data/content/PrintedVariable.php
PrintedVariable.setDelimiter
public function setDelimiter($delimiter) { if (empty($delimiter) === false && Format::isString256($delimiter) === true) { $this->delimiter = $delimiter; } else { $msg = "The 'delimiter' argument must be a non-empty string, '" . gettype($delimiter) . "' given."; th...
php
public function setDelimiter($delimiter) { if (empty($delimiter) === false && Format::isString256($delimiter) === true) { $this->delimiter = $delimiter; } else { $msg = "The 'delimiter' argument must be a non-empty string, '" . gettype($delimiter) . "' given."; th...
[ "public", "function", "setDelimiter", "(", "$", "delimiter", ")", "{", "if", "(", "empty", "(", "$", "delimiter", ")", "===", "false", "&&", "Format", "::", "isString256", "(", "$", "delimiter", ")", "===", "true", ")", "{", "$", "this", "->", "delimit...
Set the delimiter to use between values when displaying variables of ordered, multiple or record cardinality. @param string $delimiter A non-empty string with at most 256 characters. @throws \InvalidArgumentException If $delimiter is not a non-empty string with at most 256 characters.
[ "Set", "the", "delimiter", "to", "use", "between", "values", "when", "displaying", "variables", "of", "ordered", "multiple", "or", "record", "cardinality", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/PrintedVariable.php#L354-L362
oat-sa/qti-sdk
src/qtism/data/content/PrintedVariable.php
PrintedVariable.setField
public function setField($field) { if (Format::isString256($field) === true) { $this->field = $field; } else { $msg = "The 'field' argument must be a non-empty string, '" . gettype($field) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setField($field) { if (Format::isString256($field) === true) { $this->field = $field; } else { $msg = "The 'field' argument must be a non-empty string, '" . gettype($field) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setField", "(", "$", "field", ")", "{", "if", "(", "Format", "::", "isString256", "(", "$", "field", ")", "===", "true", ")", "{", "$", "this", "->", "field", "=", "$", "field", ";", "}", "else", "{", "$", "msg", "=", "\"Th...
Set the field specifier to use when displaying variables of record cardinality. Give an empty string if no field is indicated. @param string $field A string with at most 256 characters. @throws \InvalidArgumentException If $field is not a string with at most 256 characters.
[ "Set", "the", "field", "specifier", "to", "use", "when", "displaying", "variables", "of", "record", "cardinality", ".", "Give", "an", "empty", "string", "if", "no", "field", "is", "indicated", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/PrintedVariable.php#L382-L390
oat-sa/qti-sdk
src/qtism/data/content/PrintedVariable.php
PrintedVariable.setMappingIndicator
public function setMappingIndicator($mappingIndicator) { if (empty($mappingIndicator) === false && Format::isString256($mappingIndicator) === true) { $this->mappingIndicator = $mappingIndicator; } else { $msg = "The 'mappingIndicator' argument must be a non-empty string with ...
php
public function setMappingIndicator($mappingIndicator) { if (empty($mappingIndicator) === false && Format::isString256($mappingIndicator) === true) { $this->mappingIndicator = $mappingIndicator; } else { $msg = "The 'mappingIndicator' argument must be a non-empty string with ...
[ "public", "function", "setMappingIndicator", "(", "$", "mappingIndicator", ")", "{", "if", "(", "empty", "(", "$", "mappingIndicator", ")", "===", "false", "&&", "Format", "::", "isString256", "(", "$", "mappingIndicator", ")", "===", "true", ")", "{", "$", ...
Set the mapping indicator to use between field name and field value when displaying variables of record cardinality. @param string $mappingIndicator A non-empty string with at most 256 characters. @throws \InvalidArgumentException If $mappingIndicator is not a non-empty string with at most 256 characters.
[ "Set", "the", "mapping", "indicator", "to", "use", "between", "field", "name", "and", "field", "value", "when", "displaying", "variables", "of", "record", "cardinality", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/PrintedVariable.php#L422-L430
oat-sa/qti-sdk
src/qtism/data/state/MatchTable.php
MatchTable.setMatchTableEntries
public function setMatchTableEntries(MatchTableEntryCollection $matchTableEntries) { if (count($matchTableEntries) > 0) { $this->matchTableEntries = $matchTableEntries; } else { $msg = "A MatchTable object must contain at least one MatchTableEntry object."; throw ...
php
public function setMatchTableEntries(MatchTableEntryCollection $matchTableEntries) { if (count($matchTableEntries) > 0) { $this->matchTableEntries = $matchTableEntries; } else { $msg = "A MatchTable object must contain at least one MatchTableEntry object."; throw ...
[ "public", "function", "setMatchTableEntries", "(", "MatchTableEntryCollection", "$", "matchTableEntries", ")", "{", "if", "(", "count", "(", "$", "matchTableEntries", ")", ">", "0", ")", "{", "$", "this", "->", "matchTableEntries", "=", "$", "matchTableEntries", ...
Set the collection of MatchTableEntry objects. @param \qtism\data\state\MatchTableEntryCollection $matchTableEntries A collection of MatchTableEntry objects. @throws \InvalidArgumentException If $matchTableEntries is an empty collection.
[ "Set", "the", "collection", "of", "MatchTableEntry", "objects", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/MatchTable.php#L76-L84
oat-sa/qti-sdk
src/qtism/common/utils/Format.php
Format.isIdentifier
public static function isIdentifier($string, $strict = true) { if ($strict === true) { $letter = self::getPerlXmlLetter(); $digit = self::getPerlXmlDigit(); $combiningChar = self::getPerlXmlCombiningChar(); $extender = self::getPerlXmlExtender(); ...
php
public static function isIdentifier($string, $strict = true) { if ($strict === true) { $letter = self::getPerlXmlLetter(); $digit = self::getPerlXmlDigit(); $combiningChar = self::getPerlXmlCombiningChar(); $extender = self::getPerlXmlExtender(); ...
[ "public", "static", "function", "isIdentifier", "(", "$", "string", ",", "$", "strict", "=", "true", ")", "{", "if", "(", "$", "strict", "===", "true", ")", "{", "$", "letter", "=", "self", "::", "getPerlXmlLetter", "(", ")", ";", "$", "digit", "=", ...
Check if string is compliant with the identifier datatype of IMS QTI. IMS Global says : Identifiers can contain the character classes Letter, Digit, Combining which are described in the Extensible Markup Language (XML) 1.0 (Second Edition). Identifiers should have no more than 32 characters for compatibility with vers...
[ "Check", "if", "string", "is", "compliant", "with", "the", "identifier", "datatype", "of", "IMS", "QTI", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/utils/Format.php#L58-L83
oat-sa/qti-sdk
src/qtism/common/utils/Format.php
Format.sanitizeIdentifier
public static function sanitizeIdentifier($dirtyIdentifier) { if (is_array($dirtyIdentifier) || is_object($dirtyIdentifier)) { return Format::generateIdentifier(); } if (preg_match("/^[a-zA-Z_][a-zA-Z0-9_\.-]*$/u", $dirtyIdentifier)) { return $dirtyIdentifier; ...
php
public static function sanitizeIdentifier($dirtyIdentifier) { if (is_array($dirtyIdentifier) || is_object($dirtyIdentifier)) { return Format::generateIdentifier(); } if (preg_match("/^[a-zA-Z_][a-zA-Z0-9_\.-]*$/u", $dirtyIdentifier)) { return $dirtyIdentifier; ...
[ "public", "static", "function", "sanitizeIdentifier", "(", "$", "dirtyIdentifier", ")", "{", "if", "(", "is_array", "(", "$", "dirtyIdentifier", ")", "||", "is_object", "(", "$", "dirtyIdentifier", ")", ")", "{", "return", "Format", "::", "generateIdentifier", ...
"Sanitizes" an identifier : removes any non-valid character that does not correspond to the criteria written below, and returns a valid qti identifier. If after sanitizing, the identifier is stil not valid, a random identifier is generated. IMS Global says : Identifiers can contain the character classes Letter, Digit,...
[ "Sanitizes", "an", "identifier", ":", "removes", "any", "non", "-", "valid", "character", "that", "does", "not", "correspond", "to", "the", "criteria", "written", "below", "and", "returns", "a", "valid", "qti", "identifier", ".", "If", "after", "sanitizing", ...
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/utils/Format.php#L100-L118
oat-sa/qti-sdk
src/qtism/common/utils/Format.php
Format.isPair
public static function isPair($string) { $pair = explode("\x20", $string); if (count($pair) == 2) { if (self::isIdentifier(self::toLowerTrim($pair[0])) && self::isIdentifier(self::toLowerTrim($pair[1]))) { return true; } } return false; }
php
public static function isPair($string) { $pair = explode("\x20", $string); if (count($pair) == 2) { if (self::isIdentifier(self::toLowerTrim($pair[0])) && self::isIdentifier(self::toLowerTrim($pair[1]))) { return true; } } return false; }
[ "public", "static", "function", "isPair", "(", "$", "string", ")", "{", "$", "pair", "=", "explode", "(", "\"\\x20\"", ",", "$", "string", ")", ";", "if", "(", "count", "(", "$", "pair", ")", "==", "2", ")", "{", "if", "(", "self", "::", "isIdent...
Wether a given $string can be cast into a pair. @param string $string A string value. @return boolean Wether $string can be converted to a pair.
[ "Wether", "a", "given", "$string", "can", "be", "cast", "into", "a", "pair", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/utils/Format.php#L274-L285
oat-sa/qti-sdk
src/qtism/common/utils/Format.php
Format.isBoolean
public static function isBoolean($string) { if (gettype($string) === 'string') { $string = self::toLowerTrim($string); if ($string == 'true') { return true; } elseif ($string == 'false') { return true; } else { r...
php
public static function isBoolean($string) { if (gettype($string) === 'string') { $string = self::toLowerTrim($string); if ($string == 'true') { return true; } elseif ($string == 'false') { return true; } else { r...
[ "public", "static", "function", "isBoolean", "(", "$", "string", ")", "{", "if", "(", "gettype", "(", "$", "string", ")", "===", "'string'", ")", "{", "$", "string", "=", "self", "::", "toLowerTrim", "(", "$", "string", ")", ";", "if", "(", "$", "s...
Whether a given $string can be transformed into a boolean. @param string $string A string value. @return boolean Whether $string can be converted to a boolean.
[ "Whether", "a", "given", "$string", "can", "be", "transformed", "into", "a", "boolean", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/utils/Format.php#L321-L335
oat-sa/qti-sdk
src/qtism/common/utils/Format.php
Format.isPoint
public static function isPoint($string) { if (gettype($string) === 'string') { $parts = explode("\x20", $string); if (count($parts) == 2) { if (self::isInteger($parts[0]) && self::isInteger($parts[1])) { return true; } }...
php
public static function isPoint($string) { if (gettype($string) === 'string') { $parts = explode("\x20", $string); if (count($parts) == 2) { if (self::isInteger($parts[0]) && self::isInteger($parts[1])) { return true; } }...
[ "public", "static", "function", "isPoint", "(", "$", "string", ")", "{", "if", "(", "gettype", "(", "$", "string", ")", "===", "'string'", ")", "{", "$", "parts", "=", "explode", "(", "\"\\x20\"", ",", "$", "string", ")", ";", "if", "(", "count", "...
Whether a given $string can be cast into a Point datatype. @param string $string A string value. @return boolean Wheter $string can be transformed to a Point datatype.
[ "Whether", "a", "given", "$string", "can", "be", "cast", "into", "a", "Point", "datatype", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/utils/Format.php#L343-L355
oat-sa/qti-sdk
src/qtism/common/utils/Format.php
Format.isVariableRef
public static function isVariableRef($string) { $firstBrace = substr($string, 0, 1); $secondBrace = substr($string, -1); if ($firstBrace == '{' && $secondBrace == '}') { return self::isIdentifier(substr($string, 1, -1)); } else { return self::isIdentifier($st...
php
public static function isVariableRef($string) { $firstBrace = substr($string, 0, 1); $secondBrace = substr($string, -1); if ($firstBrace == '{' && $secondBrace == '}') { return self::isIdentifier(substr($string, 1, -1)); } else { return self::isIdentifier($st...
[ "public", "static", "function", "isVariableRef", "(", "$", "string", ")", "{", "$", "firstBrace", "=", "substr", "(", "$", "string", ",", "0", ",", "1", ")", ";", "$", "secondBrace", "=", "substr", "(", "$", "string", ",", "-", "1", ")", ";", "if",...
Whether or not a given string is a variable ref. @param string $string A given string. @return boolean Wheter $string is a valid variable ref. @example '{myIdentifier1}' is a valid variable ref but 'myIdentifier1' is not.
[ "Whether", "or", "not", "a", "given", "string", "is", "a", "variable", "ref", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/utils/Format.php#L376-L386
oat-sa/qti-sdk
src/qtism/common/utils/Format.php
Format.isClass
public static function isClass($string) { if (is_string($string) === true) { $pattern = "/^(?:[^\s]+?(?:\x20){0,})+$/"; return preg_match($pattern, $string) === 1; } else { return false; } }
php
public static function isClass($string) { if (is_string($string) === true) { $pattern = "/^(?:[^\s]+?(?:\x20){0,})+$/"; return preg_match($pattern, $string) === 1; } else { return false; } }
[ "public", "static", "function", "isClass", "(", "$", "string", ")", "{", "if", "(", "is_string", "(", "$", "string", ")", "===", "true", ")", "{", "$", "pattern", "=", "\"/^(?:[^\\s]+?(?:\\x20){0,})+$/\"", ";", "return", "preg_match", "(", "$", "pattern", ...
Whether a given $string is a valid value for a body element's class attribute e.g. 'qti-label' or 'qti-label qti-component'. @param string $string A string value. @return boolean
[ "Whether", "a", "given", "$string", "is", "a", "valid", "value", "for", "a", "body", "element", "s", "class", "attribute", "e", ".", "g", ".", "qti", "-", "label", "or", "qti", "-", "label", "qti", "-", "component", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/utils/Format.php#L424-L434
oat-sa/qti-sdk
src/qtism/common/utils/Format.php
Format.scale10
public static function scale10($float, $x = 'x', $precision = false) { // 1. Transform in 'E' notation. $mask = ($precision === false) ? '%e' : "%.${precision}e"; $strFloat = sprintf($mask, $float); // 2. Transform the 'E' notation into 'x 10^n' notation. $parts = explode('e...
php
public static function scale10($float, $x = 'x', $precision = false) { // 1. Transform in 'E' notation. $mask = ($precision === false) ? '%e' : "%.${precision}e"; $strFloat = sprintf($mask, $float); // 2. Transform the 'E' notation into 'x 10^n' notation. $parts = explode('e...
[ "public", "static", "function", "scale10", "(", "$", "float", ",", "$", "x", "=", "'x'", ",", "$", "precision", "=", "false", ")", "{", "// 1. Transform in 'E' notation.", "$", "mask", "=", "(", "$", "precision", "===", "false", ")", "?", "'%e'", ":", ...
Get a float variable into a Standard Form / Scientific notation e.g. 6.72 x 10⁴. * If no $precision is given, 6 significant numbers will be displayed after the decimal separator. * If no $x is given, the 'x' character will be used as the 'times' operator. @param float $float @param string $x The character to be used ...
[ "Get", "a", "float", "variable", "into", "a", "Standard", "Form", "/", "Scientific", "notation", "e", ".", "g", ".", "6", ".", "72", "x", "10⁴", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/utils/Format.php#L447-L507
oat-sa/qti-sdk
src/qtism/common/utils/Format.php
Format.isPrintfIsoFormat
public static function isPrintfIsoFormat($isoFormat) { $subPattern = self::getPrintfFormatSpecifier(); $pattern = '/(?:(?:[^%]|^)(?:%%)+(' . $subPattern . '))|(?:(?:[^%])(' . $subPattern . '))|(?:^(' . $subPattern . '))/u'; $matches = array(); preg_match_all($pattern, $isoFormat, $m...
php
public static function isPrintfIsoFormat($isoFormat) { $subPattern = self::getPrintfFormatSpecifier(); $pattern = '/(?:(?:[^%]|^)(?:%%)+(' . $subPattern . '))|(?:(?:[^%])(' . $subPattern . '))|(?:^(' . $subPattern . '))/u'; $matches = array(); preg_match_all($pattern, $isoFormat, $m...
[ "public", "static", "function", "isPrintfIsoFormat", "(", "$", "isoFormat", ")", "{", "$", "subPattern", "=", "self", "::", "getPrintfFormatSpecifier", "(", ")", ";", "$", "pattern", "=", "'/(?:(?:[^%]|^)(?:%%)+('", ".", "$", "subPattern", ".", "'))|(?:(?:[^%])('"...
This method is not absolutely safe because of the 'volatile' nature of the printf format. However, it can validate a lot of strings as a first barrier for further code to be implemented. Examples: Format::isPrintfIsoFormat('%#x') => true Format::isPrintfIsoFormat('%#llx') => true Format::isPrintfIsoFormat('Octal %#x ...
[ "This", "method", "is", "not", "absolutely", "safe", "because", "of", "the", "volatile", "nature", "of", "the", "printf", "format", ".", "However", "it", "can", "validate", "a", "lot", "of", "strings", "as", "a", "first", "barrier", "for", "further", "code...
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/utils/Format.php#L566-L580
oat-sa/qti-sdk
src/qtism/common/utils/Format.php
Format.printfFormatIsoToPhp
public static function printfFormatIsoToPhp($isoFormat) { // Valid format, do the modifications to be compliant with // PHP's printf. $pattern = '/' . self::getPrintfFormatSpecifier() . '/u'; $matches = array(); preg_match_all($pattern, $isoFormat, $matches); foreach...
php
public static function printfFormatIsoToPhp($isoFormat) { // Valid format, do the modifications to be compliant with // PHP's printf. $pattern = '/' . self::getPrintfFormatSpecifier() . '/u'; $matches = array(); preg_match_all($pattern, $isoFormat, $matches); foreach...
[ "public", "static", "function", "printfFormatIsoToPhp", "(", "$", "isoFormat", ")", "{", "// Valid format, do the modifications to be compliant with", "// PHP's printf.", "$", "pattern", "=", "'/'", ".", "self", "::", "getPrintfFormatSpecifier", "(", ")", ".", "'/u'", "...
Transform an ISO number formatting into a format that can be handled by PHP's printf/sprintf implementation. Please note that this method is not totally safe because of the "funky" nature of ISO number formats especially when used with C++. However, this method can be a good first attempt of transformation for further...
[ "Transform", "an", "ISO", "number", "formatting", "into", "a", "format", "that", "can", "be", "handled", "by", "PHP", "s", "printf", "/", "sprintf", "implementation", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/utils/Format.php#L594-L611
oat-sa/qti-sdk
src/qtism/common/utils/Format.php
Format.isXhtmlLength
public static function isXhtmlLength($length) { if (is_int($length) === true) { return $length >= 0; } elseif (is_string($length) === true) { return preg_match("/[0-9]+%/", $length) === 1; } else { return false; } }
php
public static function isXhtmlLength($length) { if (is_int($length) === true) { return $length >= 0; } elseif (is_string($length) === true) { return preg_match("/[0-9]+%/", $length) === 1; } else { return false; } }
[ "public", "static", "function", "isXhtmlLength", "(", "$", "length", ")", "{", "if", "(", "is_int", "(", "$", "length", ")", "===", "true", ")", "{", "return", "$", "length", ">=", "0", ";", "}", "elseif", "(", "is_string", "(", "$", "length", ")", ...
Whether or not a given $length is a compliant XHTML length (e.g. "10%", 10, ...). @param mixed $length A length as a string or integer. @return boolean
[ "Whether", "or", "not", "a", "given", "$length", "is", "a", "compliant", "XHTML", "length", "(", "e", ".", "g", ".", "10%", "10", "...", ")", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/utils/Format.php#L620-L629
oat-sa/qti-sdk
src/qtism/data/SectionPart.php
SectionPart.setFixed
public function setFixed($fixed) { if (is_bool($fixed)) { $this->fixed = $fixed; } else { $msg = "Fixed must be a boolean, '" . gettype($fixed) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setFixed($fixed) { if (is_bool($fixed)) { $this->fixed = $fixed; } else { $msg = "Fixed must be a boolean, '" . gettype($fixed) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setFixed", "(", "$", "fixed", ")", "{", "if", "(", "is_bool", "(", "$", "fixed", ")", ")", "{", "$", "this", "->", "fixed", "=", "$", "fixed", ";", "}", "else", "{", "$", "msg", "=", "\"Fixed must be a boolean, '\"", ".", "gett...
Set if the section part is subject to shuffling. @param boolean $fixed true if subject to shuffling, false if not. @throws \InvalidArgumentException If $fixed is not a boolean.
[ "Set", "if", "the", "section", "part", "is", "subject", "to", "shuffling", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/SectionPart.php#L211-L219
oat-sa/qti-sdk
src/qtism/runtime/processing/ResponseProcessingException.php
ResponseProcessingException.setSource
public function setSource(Processable $source) { if ($source instanceof ResponseProcessingEngine) { parent::setSource($source); } else { $msg = "ResponseProcessingException::setSource only accepts ResponseProcessingEngine objects."; throw new InvalidArgumentExcept...
php
public function setSource(Processable $source) { if ($source instanceof ResponseProcessingEngine) { parent::setSource($source); } else { $msg = "ResponseProcessingException::setSource only accepts ResponseProcessingEngine objects."; throw new InvalidArgumentExcept...
[ "public", "function", "setSource", "(", "Processable", "$", "source", ")", "{", "if", "(", "$", "source", "instanceof", "ResponseProcessingEngine", ")", "{", "parent", "::", "setSource", "(", "$", "source", ")", ";", "}", "else", "{", "$", "msg", "=", "\...
Set the source of the error. @param \qtism\runtime\common\Processable $source The source of the error. @throws \InvalidArgumentException If $source is not a ResponseProcessingEngine object.
[ "Set", "the", "source", "of", "the", "error", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/processing/ResponseProcessingException.php#L60-L68
oat-sa/qti-sdk
src/qtism/data/AssessmentItem.php
AssessmentItem.setLang
public function setLang($lang = '') { if (gettype($lang) === 'string') { $this->lang = $lang; } else { $msg = "The lang argument must be a string, '" . gettype($lang) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setLang($lang = '') { if (gettype($lang) === 'string') { $this->lang = $lang; } else { $msg = "The lang argument must be a string, '" . gettype($lang) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setLang", "(", "$", "lang", "=", "''", ")", "{", "if", "(", "gettype", "(", "$", "lang", ")", "===", "'string'", ")", "{", "$", "this", "->", "lang", "=", "$", "lang", ";", "}", "else", "{", "$", "msg", "=", "\"The lang arg...
Set the language code. @param string $lang A language code. @throws \InvalidArgumentException If $lang is not a string.
[ "Set", "the", "language", "code", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/AssessmentItem.php#L285-L293
oat-sa/qti-sdk
src/qtism/data/AssessmentItem.php
AssessmentItem.setLabel
public function setLabel($label) { if (Format::isString256($label) === true) { $this->label = $label; } else { $msg = "The label argument must be a string with at most 256 characters."; throw new InvalidArgumentException($msg); } }
php
public function setLabel($label) { if (Format::isString256($label) === true) { $this->label = $label; } else { $msg = "The label argument must be a string with at most 256 characters."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setLabel", "(", "$", "label", ")", "{", "if", "(", "Format", "::", "isString256", "(", "$", "label", ")", "===", "true", ")", "{", "$", "this", "->", "label", "=", "$", "label", ";", "}", "else", "{", "$", "msg", "=", "\"Th...
Set the label of the item. @param string $label A string with at most 256 characters. @throws \InvalidArgumentException If $label is not a string with at most 256 characters.
[ "Set", "the", "label", "of", "the", "item", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/AssessmentItem.php#L301-L309
oat-sa/qti-sdk
src/qtism/data/AssessmentItem.php
AssessmentItem.setAdaptive
public function setAdaptive($adaptive) { if (is_bool($adaptive)) { $this->adaptive = $adaptive; } else { $msg = "The adaptive argument must be a boolean, '" . gettype($adaptive) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setAdaptive($adaptive) { if (is_bool($adaptive)) { $this->adaptive = $adaptive; } else { $msg = "The adaptive argument must be a boolean, '" . gettype($adaptive) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setAdaptive", "(", "$", "adaptive", ")", "{", "if", "(", "is_bool", "(", "$", "adaptive", ")", ")", "{", "$", "this", "->", "adaptive", "=", "$", "adaptive", ";", "}", "else", "{", "$", "msg", "=", "\"The adaptive argument must be ...
Set whether the item is adaptive. @param boolean $adaptive Adaptive or not. @throws \InvalidArgumentException If $adaptive is not a boolean value.
[ "Set", "whether", "the", "item", "is", "adaptive", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/AssessmentItem.php#L359-L367
oat-sa/qti-sdk
src/qtism/data/AssessmentItem.php
AssessmentItem.setToolName
public function setToolName($toolName) { if (Format::isString256($toolName) === true) { $this->toolName = $toolName; } else { $msg = "The toolName argument must be a string with at most 256 characters."; throw new InvalidArgumentException($msg); } }
php
public function setToolName($toolName) { if (Format::isString256($toolName) === true) { $this->toolName = $toolName; } else { $msg = "The toolName argument must be a string with at most 256 characters."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setToolName", "(", "$", "toolName", ")", "{", "if", "(", "Format", "::", "isString256", "(", "$", "toolName", ")", "===", "true", ")", "{", "$", "this", "->", "toolName", "=", "$", "toolName", ";", "}", "else", "{", "$", "msg",...
Set the name of the tool with which the item was created. @param string $toolName A tool name with at most 256 characters. @throws \InvalidArgumentException If $toolName is not a string value with at most 256 characters.
[ "Set", "the", "name", "of", "the", "tool", "with", "which", "the", "item", "was", "created", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/AssessmentItem.php#L411-L419
oat-sa/qti-sdk
src/qtism/data/AssessmentItem.php
AssessmentItem.setToolVersion
public function setToolVersion($toolVersion) { if (Format::isString256($toolVersion) === true) { $this->toolVersion = $toolVersion; } else { $msg = "The toolVersion argument must be a string with at most 256 characters."; throw new InvalidArgumentException($msg); ...
php
public function setToolVersion($toolVersion) { if (Format::isString256($toolVersion) === true) { $this->toolVersion = $toolVersion; } else { $msg = "The toolVersion argument must be a string with at most 256 characters."; throw new InvalidArgumentException($msg); ...
[ "public", "function", "setToolVersion", "(", "$", "toolVersion", ")", "{", "if", "(", "Format", "::", "isString256", "(", "$", "toolVersion", ")", "===", "true", ")", "{", "$", "this", "->", "toolVersion", "=", "$", "toolVersion", ";", "}", "else", "{", ...
Set the version of the tool with which the item was created. @param string $toolVersion A tool version with at most 256 characters. @throws \InvalidArgumentException If $toolVersion is not a string value with at most 256 characters.
[ "Set", "the", "version", "of", "the", "tool", "with", "which", "the", "item", "was", "created", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/AssessmentItem.php#L447-L455
oat-sa/qti-sdk
src/qtism/data/AssessmentItem.php
AssessmentItem.getEndAttemptIdentifiers
public function getEndAttemptIdentifiers() { $endAttemptIdentifiers = new IdentifierCollection(); foreach ($this->getComponentsByClassName('endAttemptInteraction') as $endAttemptInteraction) { $endAttemptIdentifiers[] = $endAttemptInteraction->getResponseIdentifier(); } ...
php
public function getEndAttemptIdentifiers() { $endAttemptIdentifiers = new IdentifierCollection(); foreach ($this->getComponentsByClassName('endAttemptInteraction') as $endAttemptInteraction) { $endAttemptIdentifiers[] = $endAttemptInteraction->getResponseIdentifier(); } ...
[ "public", "function", "getEndAttemptIdentifiers", "(", ")", "{", "$", "endAttemptIdentifiers", "=", "new", "IdentifierCollection", "(", ")", ";", "foreach", "(", "$", "this", "->", "getComponentsByClassName", "(", "'endAttemptInteraction'", ")", "as", "$", "endAttem...
Get the response variable identifiers related to the endAttemptInteraction in the item content. @return \qtism\common\collections\IdentifierCollection @see \qtism\data\IAssessmentItem::getEndAttemptIdentifiers()
[ "Get", "the", "response", "variable", "identifiers", "related", "to", "the", "endAttemptInteraction", "in", "the", "item", "content", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/AssessmentItem.php#L695-L703
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/SubstringMarshaller.php
SubstringMarshaller.unmarshallChildrenKnown
protected function unmarshallChildrenKnown(DOMElement $element, QtiComponentCollection $children) { $object = new Substring($children); if (($caseSensitive = $this->getDOMElementAttributeAs($element, 'caseSensitive', 'boolean')) !== null) { $object->setCaseSensitive($caseSensitive); ...
php
protected function unmarshallChildrenKnown(DOMElement $element, QtiComponentCollection $children) { $object = new Substring($children); if (($caseSensitive = $this->getDOMElementAttributeAs($element, 'caseSensitive', 'boolean')) !== null) { $object->setCaseSensitive($caseSensitive); ...
[ "protected", "function", "unmarshallChildrenKnown", "(", "DOMElement", "$", "element", ",", "QtiComponentCollection", "$", "children", ")", "{", "$", "object", "=", "new", "Substring", "(", "$", "children", ")", ";", "if", "(", "(", "$", "caseSensitive", "=", ...
Unmarshall a QTI substring operator element into a Substring object. @param \DOMElement The substring element to unmarshall. @param \qtism\data\QtiComponentCollection A collection containing the child Expression objects composing the Operator. @return \qtism\data\QtiComponent A Substring object. @throws \qtism\data\st...
[ "Unmarshall", "a", "QTI", "substring", "operator", "element", "into", "a", "Substring", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/SubstringMarshaller.php#L66-L75
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/SelectPointInteractionMarshaller.php
SelectPointInteractionMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { $version = $this->getVersion(); if (($responseIdentifier = $this->getDOMElementAttributeAs($element, 'responseIdentifier')) !== null) { $objectElts = $this->getChildElementsByTagName($element, 'object'); if (count($objectE...
php
protected function unmarshall(DOMElement $element) { $version = $this->getVersion(); if (($responseIdentifier = $this->getDOMElementAttributeAs($element, 'responseIdentifier')) !== null) { $objectElts = $this->getChildElementsByTagName($element, 'object'); if (count($objectE...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "$", "version", "=", "$", "this", "->", "getVersion", "(", ")", ";", "if", "(", "(", "$", "responseIdentifier", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$"...
Unmarshall a DOMElement object corresponding to a selectPointInteraction element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A SelectPointInteraction object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "selectPointInteraction", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/SelectPointInteractionMarshaller.php#L80-L125
oat-sa/qti-sdk
src/qtism/data/AssessmentItemRef.php
AssessmentItemRef.setHref
public function setHref($href) { if (gettype($href) === 'string') { $this->href = $href; } else { $msg = "href must be a string, '" . gettype($href) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setHref($href) { if (gettype($href) === 'string') { $this->href = $href; } else { $msg = "href must be a string, '" . gettype($href) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setHref", "(", "$", "href", ")", "{", "if", "(", "gettype", "(", "$", "href", ")", "===", "'string'", ")", "{", "$", "this", "->", "href", "=", "$", "href", ";", "}", "else", "{", "$", "msg", "=", "\"href must be a string, '\""...
Set the URI that references the item's file. @param string $href A URI. @throws \InvalidArgumentException If $href is not a string.
[ "Set", "the", "URI", "that", "references", "the", "item", "s", "file", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/AssessmentItemRef.php#L126-L134
oat-sa/qti-sdk
src/qtism/common/datatypes/QtiString.php
QtiString.equals
public function equals($obj) { if ($obj instanceof QtiScalar) { return $obj->getValue() === $this->getValue(); } elseif ($this->getValue() === '' && $obj === null) { return true; } else { return $this->getValue() === $obj; } }
php
public function equals($obj) { if ($obj instanceof QtiScalar) { return $obj->getValue() === $this->getValue(); } elseif ($this->getValue() === '' && $obj === null) { return true; } else { return $this->getValue() === $obj; } }
[ "public", "function", "equals", "(", "$", "obj", ")", "{", "if", "(", "$", "obj", "instanceof", "QtiScalar", ")", "{", "return", "$", "obj", "->", "getValue", "(", ")", "===", "$", "this", "->", "getValue", "(", ")", ";", "}", "elseif", "(", "$", ...
Wheter or not the current QtiString object is equal to $obj. Two QtiString objects are considered to be identical if their intrinsic values are equals. If the current QtiString is an empty string, and $obj is NULL, the values are considered equal. @return boolean
[ "Wheter", "or", "not", "the", "current", "QtiString", "object", "is", "equal", "to", "$obj", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/datatypes/QtiString.php#L81-L90
oat-sa/qti-sdk
src/qtism/runtime/rendering/qtipl/expressions/operators/EqualQtiPLRenderer.php
EqualQtiPLRenderer.render
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); $attributes = []; if ($something->getToleranceMode() != ToleranceMode::EXACT) { $attributes['toleranceMode'] = "\"" . ToleranceMode::getNameByConstant($something->getToleranceMode()) . "\""; ...
php
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); $attributes = []; if ($something->getToleranceMode() != ToleranceMode::EXACT) { $attributes['toleranceMode'] = "\"" . ToleranceMode::getNameByConstant($something->getToleranceMode()) . "\""; ...
[ "public", "function", "render", "(", "$", "something", ")", "{", "$", "renderer", "=", "new", "QtiPLRenderer", "(", "$", "this", "->", "getCRO", "(", ")", ")", ";", "$", "attributes", "=", "[", "]", ";", "if", "(", "$", "something", "->", "getToleran...
Render a QtiComponent object into another constitution. @param mixed $something Something to render into another consitution. @return mixed The rendered component into another constitution. @throws \qtism\runtime\rendering\RenderingException If something goes wrong while rendering the component.
[ "Render", "a", "QtiComponent", "object", "into", "another", "constitution", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/qtipl/expressions/operators/EqualQtiPLRenderer.php#L46-L72
oat-sa/qti-sdk
src/qtism/common/datatypes/QtiCoords.php
QtiCoords.inside
public function inside(QtiPoint $point) { if ($this->getShape() === QtiShape::DEF) { return true; } elseif ($this->getShape() === QtiShape::RECT) { return $point->getX() >= $this[0] && $point->getX() <= $this[2] && $point->getY() >= $this[1] && $point->getY() <= $this[3]; ...
php
public function inside(QtiPoint $point) { if ($this->getShape() === QtiShape::DEF) { return true; } elseif ($this->getShape() === QtiShape::RECT) { return $point->getX() >= $this[0] && $point->getX() <= $this[2] && $point->getY() >= $this[1] && $point->getY() <= $this[3]; ...
[ "public", "function", "inside", "(", "QtiPoint", "$", "point", ")", "{", "if", "(", "$", "this", "->", "getShape", "(", ")", "===", "QtiShape", "::", "DEF", ")", "{", "return", "true", ";", "}", "elseif", "(", "$", "this", "->", "getShape", "(", ")...
Whether the given $point is inside the coordinates. @param Point $point A Point object. @return boolean
[ "Whether", "the", "given", "$point", "is", "inside", "the", "coordinates", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/datatypes/QtiCoords.php#L120-L170
oat-sa/qti-sdk
src/qtism/common/datatypes/QtiCoords.php
QtiCoords.equals
public function equals($obj) { return $obj instanceof QtiCoords && $this->getShape() === $obj->getShape() && $this->getArrayCopy() == $obj->getArrayCopy(); }
php
public function equals($obj) { return $obj instanceof QtiCoords && $this->getShape() === $obj->getShape() && $this->getArrayCopy() == $obj->getArrayCopy(); }
[ "public", "function", "equals", "(", "$", "obj", ")", "{", "return", "$", "obj", "instanceof", "QtiCoords", "&&", "$", "this", "->", "getShape", "(", ")", "===", "$", "obj", "->", "getShape", "(", ")", "&&", "$", "this", "->", "getArrayCopy", "(", ")...
Whether or not $obj is equals to $this. Two Coords objects are considered to be equal if they have the same coordinates and shape. return boolean
[ "Whether", "or", "not", "$obj", "is", "equals", "to", "$this", ".", "Two", "Coords", "objects", "are", "considered", "to", "be", "equal", "if", "they", "have", "the", "same", "coordinates", "and", "shape", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/datatypes/QtiCoords.php#L188-L191
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/ColgroupMarshaller.php
ColgroupMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = self::getDOMCradle()->createElement('colgroup'); $this->setDOMElementAttribute($element, 'span', $component->getSpan()); foreach ($component->getContent() as $col) { $marshaller = $this->getMarshallerFactory()->cr...
php
protected function marshall(QtiComponent $component) { $element = self::getDOMCradle()->createElement('colgroup'); $this->setDOMElementAttribute($element, 'span', $component->getSpan()); foreach ($component->getContent() as $col) { $marshaller = $this->getMarshallerFactory()->cr...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "self", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "'colgroup'", ")", ";", "$", "this", "->", "setDOMElementAttribute", "(", "$", "ele...
Marshall a Colgroup object into a DOMElement object. @param \qtism\data\QtiComponent $component A Colgroup object. @return \DOMElement The according DOMElement object. @throws \qtism\data\storage\xml\marshalling\MarshallingException
[ "Marshall", "a", "Colgroup", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/ColgroupMarshaller.php#L45-L58
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/ColgroupMarshaller.php
ColgroupMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { $component = new Colgroup(); if (($span = $this->getDOMElementAttributeAs($element, 'span', 'integer')) !== null) { $component->setSpan($span); } $cols = new ColCollection(); foreach ($this->getChildElementsBy...
php
protected function unmarshall(DOMElement $element) { $component = new Colgroup(); if (($span = $this->getDOMElementAttributeAs($element, 'span', 'integer')) !== null) { $component->setSpan($span); } $cols = new ColCollection(); foreach ($this->getChildElementsBy...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "$", "component", "=", "new", "Colgroup", "(", ")", ";", "if", "(", "(", "$", "span", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'span...
Unmarshall a DOMElement object corresponding to an XHTML colgroup table element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A Colgroup object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "an", "XHTML", "colgroup", "table", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/ColgroupMarshaller.php#L67-L85
oat-sa/qti-sdk
src/qtism/runtime/rendering/qtipl/rules/ResponseConditionQtiPLRenderer.php
ResponseConditionQtiPLRenderer.render
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); $qtipl = $renderer->render($something->getResponseIf()); foreach ($something->getResponseElseIfs() as $elseif) { $qtipl .= " " . $renderer->render($elseif); } $qtipl .= ($someth...
php
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); $qtipl = $renderer->render($something->getResponseIf()); foreach ($something->getResponseElseIfs() as $elseif) { $qtipl .= " " . $renderer->render($elseif); } $qtipl .= ($someth...
[ "public", "function", "render", "(", "$", "something", ")", "{", "$", "renderer", "=", "new", "QtiPLRenderer", "(", "$", "this", "->", "getCRO", "(", ")", ")", ";", "$", "qtipl", "=", "$", "renderer", "->", "render", "(", "$", "something", "->", "get...
Render a QtiComponent object into another constitution. @param mixed $something Something to render into another consitution. @return mixed The rendered component into another constitution. @throws \qtism\runtime\rendering\RenderingException If something goes wrong while rendering the component.
[ "Render", "a", "QtiComponent", "object", "into", "another", "constitution", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/qtipl/rules/ResponseConditionQtiPLRenderer.php#L45-L56
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/ShufflingMarshaller.php
ShufflingMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'responseIdentifier', $component->getResponseIdentifier()); foreach ($component->getShufflingGroups() as $s...
php
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'responseIdentifier', $component->getResponseIdentifier()); foreach ($component->getShufflingGroups() as $s...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "static", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "$", "component", "->", "getQtiClassName", "(", ")", ")", ";", "$", "this", "->...
Marshall a Shuffling object into a DOMElement object. @param \qtism\data\QtiComponent $component A Shuffling object. @return \DOMElement The according DOMElement object.
[ "Marshall", "a", "Shuffling", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/ShufflingMarshaller.php#L45-L56
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/ShufflingMarshaller.php
ShufflingMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { if (($responseIdentifier = $this->getDOMElementAttributeAs($element, 'responseIdentifier')) !== null) { $shufflingGroupElts = self::getChildElements($element, 'shufflingGroup'); if (($c = count($shufflingG...
php
protected function unmarshall(DOMElement $element) { if (($responseIdentifier = $this->getDOMElementAttributeAs($element, 'responseIdentifier')) !== null) { $shufflingGroupElts = self::getChildElements($element, 'shufflingGroup'); if (($c = count($shufflingG...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "if", "(", "(", "$", "responseIdentifier", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'responseIdentifier'", ")", ")", "!==", "null", ")", ...
Unmarshall a DOMElement object corresponding to a QTI ShufflingGroup element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A ShufflingGroup object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "ShufflingGroup", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/ShufflingMarshaller.php#L65-L91
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/GcdProcessor.php
GcdProcessor.process
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->anythingButRecord() === false) { $msg = "The Gcd operator only accepts operands with a cardinality of single, multiple or or...
php
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->anythingButRecord() === false) { $msg = "The Gcd operator only accepts operands with a cardinality of single, multiple or or...
[ "public", "function", "process", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "if", "(", "$", "operands", "->", "containsNull", "(", ")", "===", "true", ")", "{", "return", "null", ";", "}", "if", "(", "$", ...
Process the Gcd operator. @return integer The integer value equal in value to the greatest common divisor of the sub-expressions. If any of the sub-expressions is NULL, the result is NULL. @throws \qtism\runtime\expressions\operators\OperatorProcessingException
[ "Process", "the", "Gcd", "operator", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/GcdProcessor.php#L59-L124
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/InterpolationTableMarshaller.php
InterpolationTableMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); foreach ($component->getInterpolationTableEntries() as $interpolationTableEntry) { $marshaller = $this->getMarshallerFactory()->createMarshaller($interp...
php
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); foreach ($component->getInterpolationTableEntries() as $interpolationTableEntry) { $marshaller = $this->getMarshallerFactory()->createMarshaller($interp...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "static", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "$", "component", "->", "getQtiClassName", "(", ")", ")", ";", "foreach", "(", ...
Marshall an InterpolationTable object into a DOMElement object. @param \qtism\data\QtiComponent $component An InterpolationTable object. @return \DOMElement The according DOMElement object.
[ "Marshall", "an", "InterpolationTable", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/InterpolationTableMarshaller.php#L98-L111
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/InterpolationTableMarshaller.php
InterpolationTableMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { $interpolationTableEntryElements = $element->getElementsByTagName('interpolationTableEntry'); if ($interpolationTableEntryElements->length > 0) { $interpolationTableEntryCollection = new InterpolationTableEntryCollection(); ...
php
protected function unmarshall(DOMElement $element) { $interpolationTableEntryElements = $element->getElementsByTagName('interpolationTableEntry'); if ($interpolationTableEntryElements->length > 0) { $interpolationTableEntryCollection = new InterpolationTableEntryCollection(); ...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "$", "interpolationTableEntryElements", "=", "$", "element", "->", "getElementsByTagName", "(", "'interpolationTableEntry'", ")", ";", "if", "(", "$", "interpolationTableEntryElements", ...
Unmarshall a DOMElement object corresponding to a QTI InterpolationTable element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent An InterpolationTable object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException If $element does not contain any interpolationTableEntry Q...
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "InterpolationTable", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/InterpolationTableMarshaller.php#L120-L147
oat-sa/qti-sdk
src/qtism/runtime/pci/json/Marshaller.php
Marshaller.marshall
public function marshall($data, $output = Marshaller::MARSHALL_JSON) { if (is_null($data) === true) { $json = array('base' => $data); } elseif ($data instanceof State) { $json = array(); foreach ($data as $variable) { $json[$variable->getIdentifi...
php
public function marshall($data, $output = Marshaller::MARSHALL_JSON) { if (is_null($data) === true) { $json = array('base' => $data); } elseif ($data instanceof State) { $json = array(); foreach ($data as $variable) { $json[$variable->getIdentifi...
[ "public", "function", "marshall", "(", "$", "data", ",", "$", "output", "=", "Marshaller", "::", "MARSHALL_JSON", ")", "{", "if", "(", "is_null", "(", "$", "data", ")", "===", "true", ")", "{", "$", "json", "=", "array", "(", "'base'", "=>", "$", "...
Marshall some QTI data into JSON. @param \qtism\runtime\common\State|\qtism\common\datatypes\QtiDatatype|null $data The data to be marshalled into JSON. @param integer How the output will be returned (see class constants). Default is plain JSON string. @return string|array The JSONified data. @throws \InvalidArgumentE...
[ "Marshall", "some", "QTI", "data", "into", "JSON", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/pci/json/Marshaller.php#L89-L118
oat-sa/qti-sdk
src/qtism/runtime/pci/json/Marshaller.php
Marshaller.marshallUnit
protected function marshallUnit($unit) { if (is_null($unit) === true) { $json = array('base' => null); } elseif ($unit instanceof QtiScalar) { $json = $this->marshallScalar($unit); } elseif ($unit instanceof MultipleContainer) { $json = array(); ...
php
protected function marshallUnit($unit) { if (is_null($unit) === true) { $json = array('base' => null); } elseif ($unit instanceof QtiScalar) { $json = $this->marshallScalar($unit); } elseif ($unit instanceof MultipleContainer) { $json = array(); ...
[ "protected", "function", "marshallUnit", "(", "$", "unit", ")", "{", "if", "(", "is_null", "(", "$", "unit", ")", "===", "true", ")", "{", "$", "json", "=", "array", "(", "'base'", "=>", "null", ")", ";", "}", "elseif", "(", "$", "unit", "instanceo...
Marshall a single unit of QTI data. @param \qtism\runtime\common\State|\qtism\common\datatypes\QtiDatatype|null $unit @return array An array representing the JSON data to be encoded later on.
[ "Marshall", "a", "single", "unit", "of", "QTI", "data", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/pci/json/Marshaller.php#L126-L165
oat-sa/qti-sdk
src/qtism/runtime/pci/json/Marshaller.php
Marshaller.marshallScalar
protected function marshallScalar($scalar) { if ($scalar instanceof QtiBoolean) { return $this->marshallBoolean($scalar); } elseif ($scalar instanceof QtiInteger) { return $this->marshallInteger($scalar); } elseif ($scalar instanceof QtiFloat) { return $th...
php
protected function marshallScalar($scalar) { if ($scalar instanceof QtiBoolean) { return $this->marshallBoolean($scalar); } elseif ($scalar instanceof QtiInteger) { return $this->marshallInteger($scalar); } elseif ($scalar instanceof QtiFloat) { return $th...
[ "protected", "function", "marshallScalar", "(", "$", "scalar", ")", "{", "if", "(", "$", "scalar", "instanceof", "QtiBoolean", ")", "{", "return", "$", "this", "->", "marshallBoolean", "(", "$", "scalar", ")", ";", "}", "elseif", "(", "$", "scalar", "ins...
Marshall a single scalar data into a PHP datatype (that can be transformed easilly in JSON later on). @param null|\qtism\common\datatypes\QtiDatatype $scalar A scalar to be transformed into a PHP datatype for later JSON encoding. @return array An array representing the JSON data to be encoded later on. @throws \qtism\...
[ "Marshall", "a", "single", "scalar", "data", "into", "a", "PHP", "datatype", "(", "that", "can", "be", "transformed", "easilly", "in", "JSON", "later", "on", ")", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/pci/json/Marshaller.php#L175-L192
oat-sa/qti-sdk
src/qtism/runtime/pci/json/Marshaller.php
Marshaller.marshallComplex
protected function marshallComplex(QtiDatatype $complex) { if ($complex instanceof QtiPoint) { return $this->marshallPoint($complex); } elseif ($complex instanceof QtiDirectedPair) { return $this->marshallDirectedPair($complex); } elseif ($complex instanceof QtiPair) ...
php
protected function marshallComplex(QtiDatatype $complex) { if ($complex instanceof QtiPoint) { return $this->marshallPoint($complex); } elseif ($complex instanceof QtiDirectedPair) { return $this->marshallDirectedPair($complex); } elseif ($complex instanceof QtiPair) ...
[ "protected", "function", "marshallComplex", "(", "QtiDatatype", "$", "complex", ")", "{", "if", "(", "$", "complex", "instanceof", "QtiPoint", ")", "{", "return", "$", "this", "->", "marshallPoint", "(", "$", "complex", ")", ";", "}", "elseif", "(", "$", ...
Marshall a single complex QtiDataType object. @param \qtism\common\datatypes\QtiDatatype $complex @throws \qtism\runtime\pci\json\MarshallingException @return array An array representing the JSON data to be encoded later on.
[ "Marshall", "a", "single", "complex", "QtiDataType", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/pci/json/Marshaller.php#L201-L214
oat-sa/qti-sdk
src/qtism/runtime/pci/json/Marshaller.php
Marshaller.marshallFile
protected function marshallFile(QtiFile $file) { $data = array('base' => array('file' => array('mime' => $file->getMimeType(), 'data' => base64_encode($file->getData())))); if ($file->hasFilename() === true) { $data['base']['file']['name'] = $file->getFilename(); } retu...
php
protected function marshallFile(QtiFile $file) { $data = array('base' => array('file' => array('mime' => $file->getMimeType(), 'data' => base64_encode($file->getData())))); if ($file->hasFilename() === true) { $data['base']['file']['name'] = $file->getFilename(); } retu...
[ "protected", "function", "marshallFile", "(", "QtiFile", "$", "file", ")", "{", "$", "data", "=", "array", "(", "'base'", "=>", "array", "(", "'file'", "=>", "array", "(", "'mime'", "=>", "$", "file", "->", "getMimeType", "(", ")", ",", "'data'", "=>",...
Marshall a QTI file datatype into its PCI JSON Representation. @param \qtism\common\datatypes\File $file @return array
[ "Marshall", "a", "QTI", "file", "datatype", "into", "its", "PCI", "JSON", "Representation", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/pci/json/Marshaller.php#L343-L352
oat-sa/qti-sdk
src/qtism/runtime/expressions/MapResponsePointProcessor.php
MapResponsePointProcessor.process
public function process() { $expr = $this->getExpression(); $identifier = $expr->getIdentifier(); $state = $this->getState(); $var = $state->getVariable($identifier); if (!is_null($var)) { if ($var instanceof ResponseVariable) { $areaMapping = $va...
php
public function process() { $expr = $this->getExpression(); $identifier = $expr->getIdentifier(); $state = $this->getState(); $var = $state->getVariable($identifier); if (!is_null($var)) { if ($var instanceof ResponseVariable) { $areaMapping = $va...
[ "public", "function", "process", "(", ")", "{", "$", "expr", "=", "$", "this", "->", "getExpression", "(", ")", ";", "$", "identifier", "=", "$", "expr", "->", "getIdentifier", "(", ")", ";", "$", "state", "=", "$", "this", "->", "getState", "(", "...
Process the MapResponsePoint Expression. An ExpressionProcessingException is throw if: * The expression's identifier attribute does not point a variable in the current State object. * The targeted variable is not a ResponseVariable object. * The targeted variable has no areaMapping. * The target variable has the RECO...
[ "Process", "the", "MapResponsePoint", "Expression", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/MapResponsePointProcessor.php#L65-L142
oat-sa/qti-sdk
src/qtism/runtime/rendering/qtipl/expressions/operators/IndexQtiPLRenderer.php
IndexQtiPLRenderer.render
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); $attributes = []; $attributes['n'] = $something->getN(); return $something->getQtiClassName() . $renderer->writeAttributes($attributes) . $renderer->writeChildElements($something->getExp...
php
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); $attributes = []; $attributes['n'] = $something->getN(); return $something->getQtiClassName() . $renderer->writeAttributes($attributes) . $renderer->writeChildElements($something->getExp...
[ "public", "function", "render", "(", "$", "something", ")", "{", "$", "renderer", "=", "new", "QtiPLRenderer", "(", "$", "this", "->", "getCRO", "(", ")", ")", ";", "$", "attributes", "=", "[", "]", ";", "$", "attributes", "[", "'n'", "]", "=", "$"...
Render a QtiComponent object into another constitution. @param mixed $something Something to render into another consitution. @return mixed The rendered component into another constitution. @throws \qtism\runtime\rendering\RenderingException If something goes wrong while rendering the component.
[ "Render", "a", "QtiComponent", "object", "into", "another", "constitution", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/qtipl/expressions/operators/IndexQtiPLRenderer.php#L46-L54
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/SubtractProcessor.php
SubtractProcessor.process
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->exclusivelySingle() === false) { $msg = "The Subtract operator only accepts operands with a single cardinality"; ...
php
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->exclusivelySingle() === false) { $msg = "The Subtract operator only accepts operands with a single cardinality"; ...
[ "public", "function", "process", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "if", "(", "$", "operands", "->", "containsNull", "(", ")", "===", "true", ")", "{", "return", "null", ";", "}", "if", "(", "$", ...
Process the Subtract operator. @return float|integer|null A single float or if both sub-expressions are integers, a single integer or NULL if either of the sub-expressions is NULL. @throws \qtism\runtime\expressions\operators\OperatorProcessingException
[ "Process", "the", "Subtract", "operator", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/SubtractProcessor.php#L53-L77
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/OrderingMarshaller.php
OrderingMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { $object = new Ordering(); if (($value = $this->getDOMElementAttributeAs($element, 'shuffle', 'boolean')) !== null) { $object->setShuffle($value); } return $object; }
php
protected function unmarshall(DOMElement $element) { $object = new Ordering(); if (($value = $this->getDOMElementAttributeAs($element, 'shuffle', 'boolean')) !== null) { $object->setShuffle($value); } return $object; }
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "$", "object", "=", "new", "Ordering", "(", ")", ";", "if", "(", "(", "$", "value", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'shuffl...
Unmarshall a DOMElement object corresponding to a QTI Ordering element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent An Ordering object.
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "Ordering", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/OrderingMarshaller.php#L58-L67
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/InsideProcessor.php
InsideProcessor.process
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->exclusivelySingle() === false) { $msg = "The Inside operator only accepts operands with a single cardinality."; ...
php
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->exclusivelySingle() === false) { $msg = "The Inside operator only accepts operands with a single cardinality."; ...
[ "public", "function", "process", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "if", "(", "$", "operands", "->", "containsNull", "(", ")", "===", "true", ")", "{", "return", "null", ";", "}", "if", "(", "$", ...
Process the Inside operator. @return boolean|null Whether the given point is inside the area defined by shape and coords or NULL if the sub-expression is NULL. @throws \qtism\runtime\expressions\operators\OperatorProcessingException
[ "Process", "the", "Inside", "operator", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/InsideProcessor.php#L52-L74
oat-sa/qti-sdk
src/qtism/data/state/TemplateDefault.php
TemplateDefault.setTemplateIdentifier
public function setTemplateIdentifier($templateIdentifier) { if (Format::isIdentifier($templateIdentifier)) { $this->templateIdentifier = $templateIdentifier; } else { $msg = "'${templateIdentifier}' is not a valid QTI Identifier."; throw new InvalidArgumentExcept...
php
public function setTemplateIdentifier($templateIdentifier) { if (Format::isIdentifier($templateIdentifier)) { $this->templateIdentifier = $templateIdentifier; } else { $msg = "'${templateIdentifier}' is not a valid QTI Identifier."; throw new InvalidArgumentExcept...
[ "public", "function", "setTemplateIdentifier", "(", "$", "templateIdentifier", ")", "{", "if", "(", "Format", "::", "isIdentifier", "(", "$", "templateIdentifier", ")", ")", "{", "$", "this", "->", "templateIdentifier", "=", "$", "templateIdentifier", ";", "}", ...
Set the identifier of the template variable affected. @param string $templateIdentifier A QTI identifier. @throws \InvalidArgumentException If $templateIdentifier is not a valid QTI Identifier.
[ "Set", "the", "identifier", "of", "the", "template", "variable", "affected", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/TemplateDefault.php#L91-L99
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/AssessmentItemMarshaller.php
AssessmentItemMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'identifier', $component->getIdentifier()); $this->setDOMElementAttribute($element, 'title', $component->getTitle()...
php
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'identifier', $component->getIdentifier()); $this->setDOMElementAttribute($element, 'title', $component->getTitle()...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "static", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "$", "component", "->", "getQtiClassName", "(", ")", ")", ";", "$", "this", "->...
Marshall an AssessmentItem object into a DOMElement object. @param \qtism\data\QtiComponent $component An AssessmentItem object. @return \DOMElement The according DOMElement object.
[ "Marshall", "an", "AssessmentItem", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/AssessmentItemMarshaller.php#L48-L115
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/AssessmentItemMarshaller.php
AssessmentItemMarshaller.unmarshall
protected function unmarshall(DOMElement $element, AssessmentItem $assessmentItem = null) { if (($identifier = $this->getDOMElementAttributeAs($element, 'identifier')) !== null) { if (($timeDependent = $this->getDOMElementAttributeAs($element, 'timeDependent', 'boolean')) !== null) { ...
php
protected function unmarshall(DOMElement $element, AssessmentItem $assessmentItem = null) { if (($identifier = $this->getDOMElementAttributeAs($element, 'identifier')) !== null) { if (($timeDependent = $this->getDOMElementAttributeAs($element, 'timeDependent', 'boolean')) !== null) { ...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ",", "AssessmentItem", "$", "assessmentItem", "=", "null", ")", "{", "if", "(", "(", "$", "identifier", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'...
Unmarshall a DOMElement object corresponding to a QTI assessmentItem element. If $assessmentItem is provided, it will be used as the unmarshalled component instead of creating a new one. @param \DOMElement $element A DOMElement object. @param \qtism\data\AssessmentItem $assessmentItem An optional AssessmentItem objec...
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "assessmentItem", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/AssessmentItemMarshaller.php#L128-L258
oat-sa/qti-sdk
src/qtism/data/content/interactions/MediaInteraction.php
MediaInteraction.setAutostart
public function setAutostart($autostart) { if (is_bool($autostart) === true) { $this->autostart = $autostart; } else { $msg = "The 'autostart' argument must be a boolean value, '" . gettype($autostart) . "' given."; throw new InvalidArgumentException($msg); ...
php
public function setAutostart($autostart) { if (is_bool($autostart) === true) { $this->autostart = $autostart; } else { $msg = "The 'autostart' argument must be a boolean value, '" . gettype($autostart) . "' given."; throw new InvalidArgumentException($msg); ...
[ "public", "function", "setAutostart", "(", "$", "autostart", ")", "{", "if", "(", "is_bool", "(", "$", "autostart", ")", "===", "true", ")", "{", "$", "this", "->", "autostart", "=", "$", "autostart", ";", "}", "else", "{", "$", "msg", "=", "\"The 'a...
Set whether or not the media must start as soon as the candidate starts the attempt. @param boolean $autostart @throws \InvalidArgumentException If $autostart is not a boolean value.
[ "Set", "whether", "or", "not", "the", "media", "must", "start", "as", "soon", "as", "the", "candidate", "starts", "the", "attempt", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/interactions/MediaInteraction.php#L126-L134
oat-sa/qti-sdk
src/qtism/data/content/interactions/MediaInteraction.php
MediaInteraction.setMinPlays
public function setMinPlays($minPlays) { if (is_int($minPlays) === true && $minPlays >= 0) { $this->minPlays = $minPlays; } else { $msg = "The 'minPlays' argument must be a positive (>= 0) integer, '" . gettype($minPlays) . "' given."; throw new InvalidArgumentExc...
php
public function setMinPlays($minPlays) { if (is_int($minPlays) === true && $minPlays >= 0) { $this->minPlays = $minPlays; } else { $msg = "The 'minPlays' argument must be a positive (>= 0) integer, '" . gettype($minPlays) . "' given."; throw new InvalidArgumentExc...
[ "public", "function", "setMinPlays", "(", "$", "minPlays", ")", "{", "if", "(", "is_int", "(", "$", "minPlays", ")", "===", "true", "&&", "$", "minPlays", ">=", "0", ")", "{", "$", "this", "->", "minPlays", "=", "$", "minPlays", ";", "}", "else", "...
Set the minimum number of times the media must be played. @param integer $minPlays A positive (>= 0) integer. @throws \InvalidArgumentException If $minPlays is not a positive integer.
[ "Set", "the", "minimum", "number", "of", "times", "the", "media", "must", "be", "played", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/interactions/MediaInteraction.php#L152-L160
oat-sa/qti-sdk
src/qtism/data/content/interactions/MediaInteraction.php
MediaInteraction.setMaxPlays
public function setMaxPlays($maxPlays) { if (is_int($maxPlays) && $maxPlays >= 0) { $this->maxPlays = $maxPlays; } else { $msg = "The 'maxPlays' argument must be a positive (>= 0) integer, '" . gettype($maxPlays) . "' given."; throw new InvalidArgumentException($m...
php
public function setMaxPlays($maxPlays) { if (is_int($maxPlays) && $maxPlays >= 0) { $this->maxPlays = $maxPlays; } else { $msg = "The 'maxPlays' argument must be a positive (>= 0) integer, '" . gettype($maxPlays) . "' given."; throw new InvalidArgumentException($m...
[ "public", "function", "setMaxPlays", "(", "$", "maxPlays", ")", "{", "if", "(", "is_int", "(", "$", "maxPlays", ")", "&&", "$", "maxPlays", ">=", "0", ")", "{", "$", "this", "->", "maxPlays", "=", "$", "maxPlays", ";", "}", "else", "{", "$", "msg",...
Set the maximum number of times the media can be played. @param integer $maxPlays A positive (>= 0) integer. @throws \InvalidArgumentException If $maxPlays is not a positive integer.
[ "Set", "the", "maximum", "number", "of", "times", "the", "media", "can", "be", "played", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/interactions/MediaInteraction.php#L188-L196
oat-sa/qti-sdk
src/qtism/data/content/interactions/MediaInteraction.php
MediaInteraction.setLoop
public function setLoop($loop) { if (is_bool($loop) === true) { $this->loop = $loop; } else { $msg = "The 'loop' argument must be a boolean value, '" . gettype($loop) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setLoop($loop) { if (is_bool($loop) === true) { $this->loop = $loop; } else { $msg = "The 'loop' argument must be a boolean value, '" . gettype($loop) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setLoop", "(", "$", "loop", ")", "{", "if", "(", "is_bool", "(", "$", "loop", ")", "===", "true", ")", "{", "$", "this", "->", "loop", "=", "$", "loop", ";", "}", "else", "{", "$", "msg", "=", "\"The 'loop' argument must be a b...
Set whether or not the continuous play (subject to maxPlays) of the media is in force. @param boolean $loop @throws \InvalidArgumentException If $loop is not a boolean value.
[ "Set", "whether", "or", "not", "the", "continuous", "play", "(", "subject", "to", "maxPlays", ")", "of", "the", "media", "is", "in", "force", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/interactions/MediaInteraction.php#L224-L232
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/PowerProcessor.php
PowerProcessor.process
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->exclusivelySingle() === false) { $msg = "The Power operator only accepts operands with a single cardinality."; t...
php
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->exclusivelySingle() === false) { $msg = "The Power operator only accepts operands with a single cardinality."; t...
[ "public", "function", "process", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "if", "(", "$", "operands", "->", "containsNull", "(", ")", "===", "true", ")", "{", "return", "null", ";", "}", "if", "(", "$", ...
Process the Power operator. @return float|null A float value that corresponds to the first expression raised to the power of the second or NULL if the either sub-expression is NULL. @throws \qtism\runtime\expressions\operators\OperatorProcessingException
[ "Process", "the", "Power", "operator", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/PowerProcessor.php#L53-L104
oat-sa/qti-sdk
src/qtism/data/expressions/operators/Repeat.php
Repeat.setNumberRepeats
public function setNumberRepeats($numberRepeats) { if (is_int($numberRepeats) || (gettype($numberRepeats) === 'string' && Format::isVariableRef($numberRepeats))) { $this->numberRepeats = $numberRepeats; } else { $msg = "The numberRepeats argument must be an integer or a varia...
php
public function setNumberRepeats($numberRepeats) { if (is_int($numberRepeats) || (gettype($numberRepeats) === 'string' && Format::isVariableRef($numberRepeats))) { $this->numberRepeats = $numberRepeats; } else { $msg = "The numberRepeats argument must be an integer or a varia...
[ "public", "function", "setNumberRepeats", "(", "$", "numberRepeats", ")", "{", "if", "(", "is_int", "(", "$", "numberRepeats", ")", "||", "(", "gettype", "(", "$", "numberRepeats", ")", "===", "'string'", "&&", "Format", "::", "isVariableRef", "(", "$", "n...
Set the numberRepeats attribute. @param integer|string $numberRepeats An integer or a QTI variable reference. @throws \InvalidArgumentException If $numberRepeats is not an integer nor a valid QTI variable reference.
[ "Set", "the", "numberRepeats", "attribute", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/expressions/operators/Repeat.php#L75-L83
oat-sa/qti-sdk
src/qtism/cli/Render.php
Render.run
protected function run() { $engine = $this->instantiateEngine(); $arguments = $this->getArguments(); // Load XML Document. $source = $arguments['source']; $doc = new XmlDocument(); $validate = !($arguments['novalidate'] === true); try { ...
php
protected function run() { $engine = $this->instantiateEngine(); $arguments = $this->getArguments(); // Load XML Document. $source = $arguments['source']; $doc = new XmlDocument(); $validate = !($arguments['novalidate'] === true); try { ...
[ "protected", "function", "run", "(", ")", "{", "$", "engine", "=", "$", "this", "->", "instantiateEngine", "(", ")", ";", "$", "arguments", "=", "$", "this", "->", "getArguments", "(", ")", ";", "// Load XML Document.", "$", "source", "=", "$", "argument...
Renders a QTI XML File into another flavour. This implementations considers that all necessary checks about arguments and their values were performed in \qtism\cli\Render::checkArguments(). @see \qtism\cli\Cli::run() @see \qtism\cli\Render::checkArguments()
[ "Renders", "a", "QTI", "XML", "File", "into", "another", "flavour", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/cli/Render.php#L170-L228
oat-sa/qti-sdk
src/qtism/cli/Render.php
Render.runGoldilocks
private function runGoldilocks(XmlDocument $doc, GoldilocksRenderingEngine $renderer) { $arguments = $this->getArguments(); $profile = $arguments['flavour']; $xml = $renderer->render($doc->getDocumentComponent()); $header = ''; $footer = ''; $indent = ''; ...
php
private function runGoldilocks(XmlDocument $doc, GoldilocksRenderingEngine $renderer) { $arguments = $this->getArguments(); $profile = $arguments['flavour']; $xml = $renderer->render($doc->getDocumentComponent()); $header = ''; $footer = ''; $indent = ''; ...
[ "private", "function", "runGoldilocks", "(", "XmlDocument", "$", "doc", ",", "GoldilocksRenderingEngine", "$", "renderer", ")", "{", "$", "arguments", "=", "$", "this", "->", "getArguments", "(", ")", ";", "$", "profile", "=", "$", "arguments", "[", "'flavou...
Run the rendering behaviour related to the "Goldilocks" flavour. @param \qtism\data\storage\xml\XmlDocument $doc the QTI XML document to be rendered. @param \qtism\runtime\rendering\markup\goldilocks\GoldilocksRenderingEngine $renderer
[ "Run", "the", "rendering", "behaviour", "related", "to", "the", "Goldilocks", "flavour", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/cli/Render.php#L236-L314
oat-sa/qti-sdk
src/qtism/cli/Render.php
Render.runXhtml
private function runXhtml(XmlDocument $doc, XhtmlRenderingEngine $renderer) { $arguments = $this->getArguments(); $profile = $arguments['flavour']; $xml = $renderer->render($doc->getDocumentComponent()); $header = ''; $footer = ''; $indent = ''; ...
php
private function runXhtml(XmlDocument $doc, XhtmlRenderingEngine $renderer) { $arguments = $this->getArguments(); $profile = $arguments['flavour']; $xml = $renderer->render($doc->getDocumentComponent()); $header = ''; $footer = ''; $indent = ''; ...
[ "private", "function", "runXhtml", "(", "XmlDocument", "$", "doc", ",", "XhtmlRenderingEngine", "$", "renderer", ")", "{", "$", "arguments", "=", "$", "this", "->", "getArguments", "(", ")", ";", "$", "profile", "=", "$", "arguments", "[", "'flavour'", "]"...
Run the rendering behaviour related to the "XHTML" flavour. @param \qtism\data\storage\xml\XmlDocument $doc The QTI XML document to be rendered. @param \qtism\runtime\rendering\markup\xhtml\XhtmlRenderingEngine $renderer @return string The raw rendering data.
[ "Run", "the", "rendering", "behaviour", "related", "to", "the", "XHTML", "flavour", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/cli/Render.php#L323-L383
oat-sa/qti-sdk
src/qtism/cli/Render.php
Render.instantiateEngine
private function instantiateEngine() { $arguments = $this->getArguments(); $engine = null; switch (strtolower($arguments['flavour'])) { case 'goldilocks': $engine = new GoldilocksRenderingEngine(); break; case 'xhtml': ...
php
private function instantiateEngine() { $arguments = $this->getArguments(); $engine = null; switch (strtolower($arguments['flavour'])) { case 'goldilocks': $engine = new GoldilocksRenderingEngine(); break; case 'xhtml': ...
[ "private", "function", "instantiateEngine", "(", ")", "{", "$", "arguments", "=", "$", "this", "->", "getArguments", "(", ")", ";", "$", "engine", "=", "null", ";", "switch", "(", "strtolower", "(", "$", "arguments", "[", "'flavour'", "]", ")", ")", "{...
Instantiate an appropriate Rendering Engine. The instantiated Rendering Engine implementation will depend on the "flavour" CLI argument. @return \qtism\runtime\rendering\markup\AbstractMarkupRenderingEngine
[ "Instantiate", "an", "appropriate", "Rendering", "Engine", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/cli/Render.php#L393-L424
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/UploadInteractionMarshaller.php
UploadInteractionMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { if (($responseIdentifier = $this->getDOMElementAttributeAs($element, 'responseIdentifier')) !== null) { $component = new UploadInteraction($responseIdentifier); $promptElts = $this->getChildElementsByTagName($element, 'prompt'); ...
php
protected function unmarshall(DOMElement $element) { if (($responseIdentifier = $this->getDOMElementAttributeAs($element, 'responseIdentifier')) !== null) { $component = new UploadInteraction($responseIdentifier); $promptElts = $this->getChildElementsByTagName($element, 'prompt'); ...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "if", "(", "(", "$", "responseIdentifier", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'responseIdentifier'", ")", ")", "!==", "null", ")", ...
Unmarshall a DOMElement object corresponding to an uploadInteraction element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent An UploadInteraction object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "an", "uploadInteraction", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/UploadInteractionMarshaller.php#L72-L101
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/DurationGTEProcessor.php
DurationGTEProcessor.process
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->exclusivelySingle() === false) { $msg = "The DurationGTE operator only accepts operands with a single cardinality."; ...
php
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->exclusivelySingle() === false) { $msg = "The DurationGTE operator only accepts operands with a single cardinality."; ...
[ "public", "function", "process", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "if", "(", "$", "operands", "->", "containsNull", "(", ")", "===", "true", ")", "{", "return", "null", ";", "}", "if", "(", "$", ...
Process the DurationGTE operator. @return boolean|null A boolean with a value of true if the first duration is longer or equal to the second, otherwise false. If either sub-expression is NULL, the result of the operator is NULL. @throws \qtism\runtime\expressions\operators\OperatorProcessingException
[ "Process", "the", "DurationGTE", "operator", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/DurationGTEProcessor.php#L54-L73
oat-sa/qti-sdk
src/qtism/data/expressions/operators/EqualRounded.php
EqualRounded.setRoundingMode
public function setRoundingMode($roundingMode) { if (in_array($roundingMode, RoundingMode::asArray())) { $this->roundingMode = $roundingMode; } else { $msg = "The roundingMode argument must be a value from the RoundingMode enumeration, '" . $roundingMode . "' given."; ...
php
public function setRoundingMode($roundingMode) { if (in_array($roundingMode, RoundingMode::asArray())) { $this->roundingMode = $roundingMode; } else { $msg = "The roundingMode argument must be a value from the RoundingMode enumeration, '" . $roundingMode . "' given."; ...
[ "public", "function", "setRoundingMode", "(", "$", "roundingMode", ")", "{", "if", "(", "in_array", "(", "$", "roundingMode", ",", "RoundingMode", "::", "asArray", "(", ")", ")", ")", "{", "$", "this", "->", "roundingMode", "=", "$", "roundingMode", ";", ...
Set the rounding mode. @param integer $roundingMode A value from the RoundingMode enumeration. @throws \InvalidArgumentException If $roundingMode is not a value from the RoundingMode enumeration.
[ "Set", "the", "rounding", "mode", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/expressions/operators/EqualRounded.php#L87-L95