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/runtime/common/OutcomeVariable.php
OutcomeVariable.setNormalMaximum
public function setNormalMaximum($normalMaximum) { if ((is_bool($normalMaximum) && $normalMaximum === false) || is_float($normalMaximum) || is_double($normalMaximum)) { $this->normalMaximum = $normalMaximum; } else { $msg = "The normalMaximum argument must be a floating point...
php
public function setNormalMaximum($normalMaximum) { if ((is_bool($normalMaximum) && $normalMaximum === false) || is_float($normalMaximum) || is_double($normalMaximum)) { $this->normalMaximum = $normalMaximum; } else { $msg = "The normalMaximum argument must be a floating point...
[ "public", "function", "setNormalMaximum", "(", "$", "normalMaximum", ")", "{", "if", "(", "(", "is_bool", "(", "$", "normalMaximum", ")", "&&", "$", "normalMaximum", "===", "false", ")", "||", "is_float", "(", "$", "normalMaximum", ")", "||", "is_double", ...
Set the normal maximum. @param floatboolean $normalMaximum The normal maximum or false if not defined. @throws \InvalidArgumentException If $normalMaximum is not false nor a floating point value.
[ "Set", "the", "normal", "maximum", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/common/OutcomeVariable.php#L121-L129
oat-sa/qti-sdk
src/qtism/runtime/common/OutcomeVariable.php
OutcomeVariable.setNormalMinimum
public function setNormalMinimum($normalMinimum) { if ((is_bool($normalMinimum) && $normalMinimum === false) || is_float($normalMinimum) || is_double($normalMinimum)) { $this->normalMinimum = $normalMinimum; } else { $msg = "The normalMinimum argument must be a floating point...
php
public function setNormalMinimum($normalMinimum) { if ((is_bool($normalMinimum) && $normalMinimum === false) || is_float($normalMinimum) || is_double($normalMinimum)) { $this->normalMinimum = $normalMinimum; } else { $msg = "The normalMinimum argument must be a floating point...
[ "public", "function", "setNormalMinimum", "(", "$", "normalMinimum", ")", "{", "if", "(", "(", "is_bool", "(", "$", "normalMinimum", ")", "&&", "$", "normalMinimum", "===", "false", ")", "||", "is_float", "(", "$", "normalMinimum", ")", "||", "is_double", ...
Set the normal minimum. @param float|boolean $normalMinimum The normal minimum or false if not defined. @throws \InvalidArgumentException If $normalMinimum is not false nor a floating point value.
[ "Set", "the", "normal", "minimum", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/common/OutcomeVariable.php#L147-L155
oat-sa/qti-sdk
src/qtism/runtime/common/OutcomeVariable.php
OutcomeVariable.setMasteryValue
public function setMasteryValue($masteryValue) { if ((is_bool($masteryValue) && $masteryValue === false) || is_float($masteryValue) || is_double($masteryValue)) { $this->masteryValue = $masteryValue; } else { $msg = "The masteryValue argument must be a floating point value or...
php
public function setMasteryValue($masteryValue) { if ((is_bool($masteryValue) && $masteryValue === false) || is_float($masteryValue) || is_double($masteryValue)) { $this->masteryValue = $masteryValue; } else { $msg = "The masteryValue argument must be a floating point value or...
[ "public", "function", "setMasteryValue", "(", "$", "masteryValue", ")", "{", "if", "(", "(", "is_bool", "(", "$", "masteryValue", ")", "&&", "$", "masteryValue", "===", "false", ")", "||", "is_float", "(", "$", "masteryValue", ")", "||", "is_double", "(", ...
Set the mastery value. @param float|double|boolean $masteryValue A floating point value or false if not defined. @throws \InvalidArgumentException If $masteryValue is not a floating point value nor false.
[ "Set", "the", "mastery", "value", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/common/OutcomeVariable.php#L173-L181
oat-sa/qti-sdk
src/qtism/runtime/common/OutcomeVariable.php
OutcomeVariable.createFromDataModel
public static function createFromDataModel(VariableDeclaration $variableDeclaration) { $variable = parent::createFromDataModel($variableDeclaration); if ($variableDeclaration instanceof OutcomeDeclaration) { $variable->setViews($variableDeclaration->getViews()); $variable->...
php
public static function createFromDataModel(VariableDeclaration $variableDeclaration) { $variable = parent::createFromDataModel($variableDeclaration); if ($variableDeclaration instanceof OutcomeDeclaration) { $variable->setViews($variableDeclaration->getViews()); $variable->...
[ "public", "static", "function", "createFromDataModel", "(", "VariableDeclaration", "$", "variableDeclaration", ")", "{", "$", "variable", "=", "parent", "::", "createFromDataModel", "(", "$", "variableDeclaration", ")", ";", "if", "(", "$", "variableDeclaration", "i...
Create an OutcomeVariable object from a data model VariableDeclaration object. @param \qtism\data\state\VariableDeclaration $variableDeclaration @throws \InvalidArgumentException @return \qtism\runtime\common\OutcomeVariable
[ "Create", "an", "OutcomeVariable", "object", "from", "a", "data", "model", "VariableDeclaration", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/common/OutcomeVariable.php#L220-L237
oat-sa/qti-sdk
src/qtism/runtime/common/OutcomeVariable.php
OutcomeVariable.applyDefaultValue
public function applyDefaultValue() { parent::applyDefaultValue(); if (is_null($this->getDefaultValue()) === true && $this->getCardinality() === Cardinality::SINGLE) { if ($this->getBaseType() === BaseType::INTEGER) { $this->setValue(new QtiInteger(0)); } els...
php
public function applyDefaultValue() { parent::applyDefaultValue(); if (is_null($this->getDefaultValue()) === true && $this->getCardinality() === Cardinality::SINGLE) { if ($this->getBaseType() === BaseType::INTEGER) { $this->setValue(new QtiInteger(0)); } els...
[ "public", "function", "applyDefaultValue", "(", ")", "{", "parent", "::", "applyDefaultValue", "(", ")", ";", "if", "(", "is_null", "(", "$", "this", "->", "getDefaultValue", "(", ")", ")", "===", "true", "&&", "$", "this", "->", "getCardinality", "(", "...
Apply the default value to the OutcomeVariable. If no default value is described, and the cardinality is single and the baseType is integer or float, the value of the variable becomes 0.
[ "Apply", "the", "default", "value", "to", "the", "OutcomeVariable", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/common/OutcomeVariable.php#L246-L257
oat-sa/qti-sdk
src/qtism/data/content/interactions/PositionObjectInteraction.php
PositionObjectInteraction.setMinChoices
public function setMinChoices($minChoices) { if (is_int($minChoices) && $minChoices >= 0) { if (($maxChoices = $this->getMaxChoices()) > 0 && $minChoices > $maxChoices) { $msg = "The 'minChoices' argument must be less than or equal to the limits imposed by 'maxChoices'."; ...
php
public function setMinChoices($minChoices) { if (is_int($minChoices) && $minChoices >= 0) { if (($maxChoices = $this->getMaxChoices()) > 0 && $minChoices > $maxChoices) { $msg = "The 'minChoices' argument must be less than or equal to the limits imposed by 'maxChoices'."; ...
[ "public", "function", "setMinChoices", "(", "$", "minChoices", ")", "{", "if", "(", "is_int", "(", "$", "minChoices", ")", "&&", "$", "minChoices", ">=", "0", ")", "{", "if", "(", "(", "$", "maxChoices", "=", "$", "this", "->", "getMaxChoices", "(", ...
Set the minimum number of positions that the image must be placed to form a valid response to the interaction. @param integer $minChoices A strictly positive (> 0) integer that respects the limits imposed by 'maxChoices' or a negative integer to specify there is no 'minChoices'. @throws \InvalidArgumentException If $m...
[ "Set", "the", "minimum", "number", "of", "positions", "that", "the", "image", "must", "be", "placed", "to", "form", "a", "valid", "response", "to", "the", "interaction", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/interactions/PositionObjectInteraction.php#L183-L197
oat-sa/qti-sdk
src/qtism/runtime/rendering/qtipl/expressions/BaseValueQtiPLRenderer.php
BaseValueQtiPLRenderer.render
public function render($something) { switch ($something->getBaseType()) { case 0: // IDENTIFIER return "'" . $something->getValue() . "'"; case 1: // BOOLEAN return strtolower(var_export($something->getValue(), true)); case 2: // INTEGER ...
php
public function render($something) { switch ($something->getBaseType()) { case 0: // IDENTIFIER return "'" . $something->getValue() . "'"; case 1: // BOOLEAN return strtolower(var_export($something->getValue(), true)); case 2: // INTEGER ...
[ "public", "function", "render", "(", "$", "something", ")", "{", "switch", "(", "$", "something", "->", "getBaseType", "(", ")", ")", "{", "case", "0", ":", "// IDENTIFIER", "return", "\"'\"", ".", "$", "something", "->", "getValue", "(", ")", ".", "\"...
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/BaseValueQtiPLRenderer.php#L45-L64
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/NotProcessor.php
NotProcessor.process
public function process() { $operands = $this->getOperands(); if ($operands->containsNull()) { return null; } if ($operands->exclusivelySingle() === false) { $msg = "The Not Expression only accept operands with single cardinality."; throw new Ope...
php
public function process() { $operands = $this->getOperands(); if ($operands->containsNull()) { return null; } if ($operands->exclusivelySingle() === false) { $msg = "The Not Expression only accept operands with single cardinality."; throw new Ope...
[ "public", "function", "process", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "if", "(", "$", "operands", "->", "containsNull", "(", ")", ")", "{", "return", "null", ";", "}", "if", "(", "$", "operands", "->...
Returns the logical negation of the sub-expressions. @return boolean @throws \qtism\runtime\expressions\operators\OperatorProcessingException
[ "Returns", "the", "logical", "negation", "of", "the", "sub", "-", "expressions", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/NotProcessor.php#L51-L72
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/SubstringProcessor.php
SubstringProcessor.process
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->exclusivelySingle() === false) { $msg = "The Substring 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 Substring operator only accepts operands with a single cardinality."; ...
[ "public", "function", "process", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "if", "(", "$", "operands", "->", "containsNull", "(", ")", "===", "true", ")", "{", "return", "null", ";", "}", "if", "(", "$", ...
Process the Substring operator. @return boolean|null Whether the first sub-expression is a substring of the second sub-expression or NULL if either sub-expression is NULL. @throws \qtism\runtime\expressions\operators\OperatorProcessingException
[ "Process", "the", "Substring", "operator", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/SubstringProcessor.php#L52-L76
oat-sa/qti-sdk
src/qtism/runtime/rules/RuleProcessorFactory.php
RuleProcessorFactory.createProcessor
public function createProcessor(QtiComponent $rule) { $qtiClassName = ucfirst($rule->getQtiClassName()); $nsPackage = 'qtism\\runtime\\rules\\'; $className = $nsPackage . $qtiClassName . 'Processor'; if (class_exists($className) === true) { return new $className($rule);...
php
public function createProcessor(QtiComponent $rule) { $qtiClassName = ucfirst($rule->getQtiClassName()); $nsPackage = 'qtism\\runtime\\rules\\'; $className = $nsPackage . $qtiClassName . 'Processor'; if (class_exists($className) === true) { return new $className($rule);...
[ "public", "function", "createProcessor", "(", "QtiComponent", "$", "rule", ")", "{", "$", "qtiClassName", "=", "ucfirst", "(", "$", "rule", "->", "getQtiClassName", "(", ")", ")", ";", "$", "nsPackage", "=", "'qtism\\\\runtime\\\\rules\\\\'", ";", "$", "classN...
Create the RuleProcessor object able to process the given $rule. @param \qtism\data\QtiComponent $rule A Rule object you want to get the related processor. @return \qtism\runtime\common\Processable The related RuleProcessor object. @throws \RuntimeException If no RuleProcessor can be found for the given $rule.
[ "Create", "the", "RuleProcessor", "object", "able", "to", "process", "the", "given", "$rule", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rules/RuleProcessorFactory.php#L57-L69
oat-sa/qti-sdk
src/qtism/runtime/rendering/qtipl/QtiPLRenderer.php
QtiPLRenderer.render
public function render($something) { if (array_key_exists($something->getQtiClassName(), $this->registry)) { return $this->registry[$something->getQtiClassName()]->render($something); } else if (in_array($something->getQtiClassName(), operators\OperatorQtiPLRenderer::getOperatorClassName...
php
public function render($something) { if (array_key_exists($something->getQtiClassName(), $this->registry)) { return $this->registry[$something->getQtiClassName()]->render($something); } else if (in_array($something->getQtiClassName(), operators\OperatorQtiPLRenderer::getOperatorClassName...
[ "public", "function", "render", "(", "$", "something", ")", "{", "if", "(", "array_key_exists", "(", "$", "something", "->", "getQtiClassName", "(", ")", ",", "$", "this", "->", "registry", ")", ")", "{", "return", "$", "this", "->", "registry", "[", "...
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/QtiPLRenderer.php#L141-L150
oat-sa/qti-sdk
src/qtism/common/datatypes/QtiScalar.php
QtiScalar.equals
public function equals($obj) { if ($obj instanceof QtiScalar) { return $obj->getValue() === $this->getValue(); } else { return $this->getValue() === $obj; } }
php
public function equals($obj) { if ($obj instanceof QtiScalar) { return $obj->getValue() === $this->getValue(); } else { return $this->getValue() === $obj; } }
[ "public", "function", "equals", "(", "$", "obj", ")", "{", "if", "(", "$", "obj", "instanceof", "QtiScalar", ")", "{", "return", "$", "obj", "->", "getValue", "(", ")", "===", "$", "this", "->", "getValue", "(", ")", ";", "}", "else", "{", "return"...
Wheter or not $this is equal to $obj. Two Scalar objects are considered to be identical if their intrinsic values are strictly (===) equal. @return boolean
[ "Wheter", "or", "not", "$this", "is", "equal", "to", "$obj", ".", "Two", "Scalar", "objects", "are", "considered", "to", "be", "identical", "if", "their", "intrinsic", "values", "are", "strictly", "(", "===", ")", "equal", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/datatypes/QtiScalar.php#L89-L96
oat-sa/qti-sdk
src/qtism/runtime/expressions/ItemSubsetProcessor.php
ItemSubsetProcessor.getMappedVariableIdentifier
protected static function getMappedVariableIdentifier(AssessmentItemRef $assessmentItemRef, $targetIdentifier) { // return false if no mapping found. $sourceIdentifier = $targetIdentifier; foreach ($assessmentItemRef->getVariableMappings() as $variableMapping) { if ($variableMap...
php
protected static function getMappedVariableIdentifier(AssessmentItemRef $assessmentItemRef, $targetIdentifier) { // return false if no mapping found. $sourceIdentifier = $targetIdentifier; foreach ($assessmentItemRef->getVariableMappings() as $variableMapping) { if ($variableMap...
[ "protected", "static", "function", "getMappedVariableIdentifier", "(", "AssessmentItemRef", "$", "assessmentItemRef", ",", "$", "targetIdentifier", ")", "{", "// return false if no mapping found.", "$", "sourceIdentifier", "=", "$", "targetIdentifier", ";", "foreach", "(", ...
Convenience method that returns the mapped variable identifier from $targetIdentifier. @param \qtism\data\AssessmentItemRef $assessmentItemRef An AssessmentItemRef object where variable mappings can be found. @param string $targetIdentifier A targetIdentifier to be replaced by a sourceIdentifier. @return string|false ...
[ "Convenience", "method", "that", "returns", "the", "mapped", "variable", "identifier", "from", "$targetIdentifier", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/ItemSubsetProcessor.php#L108-L124
oat-sa/qti-sdk
src/qtism/runtime/expressions/ItemSubsetProcessor.php
ItemSubsetProcessor.getItemSubset
protected function getItemSubset() { $sectionIdentifier = $this->getSectionIdentifier(); $includeCategories = $this->getIncludeCategories(); $excludeCategories = $this->getExcludeCategories(); return $this->getState()->getItemSubset($sectionIdentifier, $includeCategories, $excludeCa...
php
protected function getItemSubset() { $sectionIdentifier = $this->getSectionIdentifier(); $includeCategories = $this->getIncludeCategories(); $excludeCategories = $this->getExcludeCategories(); return $this->getState()->getItemSubset($sectionIdentifier, $includeCategories, $excludeCa...
[ "protected", "function", "getItemSubset", "(", ")", "{", "$", "sectionIdentifier", "=", "$", "this", "->", "getSectionIdentifier", "(", ")", ";", "$", "includeCategories", "=", "$", "this", "->", "getIncludeCategories", "(", ")", ";", "$", "excludeCategories", ...
A convenience method enabling you to get the item subset corresponding to the ItemSubset expression to be processed. @return \qtism\data\AssessmentItemRefCollection A collection of AssessmentItemRef object that match the criteria expressed by the ItemSubset expression to be processed.
[ "A", "convenience", "method", "enabling", "you", "to", "get", "the", "item", "subset", "corresponding", "to", "the", "ItemSubset", "expression", "to", "be", "processed", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/ItemSubsetProcessor.php#L131-L138
oat-sa/qti-sdk
src/qtism/data/expressions/RandomFloat.php
RandomFloat.setMin
public function setMin($min) { if (is_numeric($min) || Format::isVariableRef($min)) { $this->min = $min; } else { $msg = "'Min' must be a numeric value or a variableRef, '" . gettype($min) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setMin($min) { if (is_numeric($min) || Format::isVariableRef($min)) { $this->min = $min; } else { $msg = "'Min' must be a numeric value or a variableRef, '" . gettype($min) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setMin", "(", "$", "min", ")", "{", "if", "(", "is_numeric", "(", "$", "min", ")", "||", "Format", "::", "isVariableRef", "(", "$", "min", ")", ")", "{", "$", "this", "->", "min", "=", "$", "min", ";", "}", "else", "{", "...
Set the min attribute value. @param number|string $min A float value, int value or a variableRef. @throws \InvalidArgumentException If $min is not a numeric value nor a variableRef.
[ "Set", "the", "min", "attribute", "value", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/expressions/RandomFloat.php#L82-L90
oat-sa/qti-sdk
src/qtism/data/expressions/RandomFloat.php
RandomFloat.setMax
public function setMax($max) { if (is_numeric($max) || Format::isVariableRef($max)) { $this->max = $max; } else { $msg = "'Max must be a numeric value or a variableRef, '" . gettype($max) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setMax($max) { if (is_numeric($max) || Format::isVariableRef($max)) { $this->max = $max; } else { $msg = "'Max must be a numeric value or a variableRef, '" . gettype($max) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setMax", "(", "$", "max", ")", "{", "if", "(", "is_numeric", "(", "$", "max", ")", "||", "Format", "::", "isVariableRef", "(", "$", "max", ")", ")", "{", "$", "this", "->", "max", "=", "$", "max", ";", "}", "else", "{", "...
Set the max attribute. @param number|string $max A numeric value or a variableRef. @throws \InvalidArgumentException If $max is not a numeric value nor a variableRef.
[ "Set", "the", "max", "attribute", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/expressions/RandomFloat.php#L108-L116
oat-sa/qti-sdk
src/qtism/data/expressions/operators/CustomOperator.php
CustomOperator.setDefinition
public function setDefinition($definition) { if (is_string($definition) === true) { $this->definition = $definition; } else { $msg = "The 'definition' argument must be a string, '" . gettype($class) . "' given."; throw new InvalidArgumentException($msg); }...
php
public function setDefinition($definition) { if (is_string($definition) === true) { $this->definition = $definition; } else { $msg = "The 'definition' argument must be a string, '" . gettype($class) . "' given."; throw new InvalidArgumentException($msg); }...
[ "public", "function", "setDefinition", "(", "$", "definition", ")", "{", "if", "(", "is_string", "(", "$", "definition", ")", "===", "true", ")", "{", "$", "this", "->", "definition", "=", "$", "definition", ";", "}", "else", "{", "$", "msg", "=", "\...
Set the URI that identifies the definition of the custom operator in the global namespace. An empty value means there is no value set for the definition attribute. @param string $definition A URI or an empty string. @throws \InvalidArgumentException If $definition is not a string.
[ "Set", "the", "URI", "that", "identifies", "the", "definition", "of", "the", "custom", "operator", "in", "the", "global", "namespace", ".", "An", "empty", "value", "means", "there", "is", "no", "value", "set", "for", "the", "definition", "attribute", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/expressions/operators/CustomOperator.php#L140-L148
oat-sa/qti-sdk
src/qtism/data/state/AssociationValidityConstraint.php
AssociationValidityConstraint.setIdentifier
public function setIdentifier($identifier) { if (is_string($identifier) === false || empty($identifier) === true) { throw new InvalidArgumentException( "The 'identifier' argument must be a non-empty string." ); } $this->identifier = $identifie...
php
public function setIdentifier($identifier) { if (is_string($identifier) === false || empty($identifier) === true) { throw new InvalidArgumentException( "The 'identifier' argument must be a non-empty string." ); } $this->identifier = $identifie...
[ "public", "function", "setIdentifier", "(", "$", "identifier", ")", "{", "if", "(", "is_string", "(", "$", "identifier", ")", "===", "false", "||", "empty", "(", "$", "identifier", ")", "===", "true", ")", "{", "throw", "new", "InvalidArgumentException", "...
Set the identifier on which the validity constraint applies to. @param integer $identifier @throws \InvalidArgumentException If $identifier is an empty string.
[ "Set", "the", "identifier", "on", "which", "the", "validity", "constraint", "applies", "to", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/AssociationValidityConstraint.php#L87-L96
oat-sa/qti-sdk
src/qtism/data/state/AssociationValidityConstraint.php
AssociationValidityConstraint.setMinConstraint
public function setMinConstraint($minConstraint) { if (is_int($minConstraint) === false || $minConstraint < 0) { throw new InvalidArgumentException( "The 'minConstraint' argument must be a non negative (>= 0) integer." ); } $this->minConstrain...
php
public function setMinConstraint($minConstraint) { if (is_int($minConstraint) === false || $minConstraint < 0) { throw new InvalidArgumentException( "The 'minConstraint' argument must be a non negative (>= 0) integer." ); } $this->minConstrain...
[ "public", "function", "setMinConstraint", "(", "$", "minConstraint", ")", "{", "if", "(", "is_int", "(", "$", "minConstraint", ")", "===", "false", "||", "$", "minConstraint", "<", "0", ")", "{", "throw", "new", "InvalidArgumentException", "(", "\"The 'minCons...
Set the minimum number of times $identifier may be found in a Response Variable. @param integer $minConstraint A non negative integer (>= 0) integer value. @throws \InvalidArgumentException If $minConstraint is not a non negative (>= 0) integer value.
[ "Set", "the", "minimum", "number", "of", "times", "$identifier", "may", "be", "found", "in", "a", "Response", "Variable", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/AssociationValidityConstraint.php#L114-L123
oat-sa/qti-sdk
src/qtism/data/state/AssociationValidityConstraint.php
AssociationValidityConstraint.setMaxConstraint
public function setMaxConstraint($maxConstraint) { if (is_int($maxConstraint) === false) { throw new InvalidArgumentException( "The 'maxConstraint' argument must be an integer." ); } else if ($maxConstraint < 0) { throw new InvalidArgumentExceptio...
php
public function setMaxConstraint($maxConstraint) { if (is_int($maxConstraint) === false) { throw new InvalidArgumentException( "The 'maxConstraint' argument must be an integer." ); } else if ($maxConstraint < 0) { throw new InvalidArgumentExceptio...
[ "public", "function", "setMaxConstraint", "(", "$", "maxConstraint", ")", "{", "if", "(", "is_int", "(", "$", "maxConstraint", ")", "===", "false", ")", "{", "throw", "new", "InvalidArgumentException", "(", "\"The 'maxConstraint' argument must be an integer.\"", ")", ...
Set the maximum number of times $identifier may be found in a Response Variable. Please note that 0 indicates no constraint. @param integer $maxConstraint An integer value which is greater than the 'minConstraint' in place. @throws \InvalidArgumentException If $maxConstraint is not an integer greater or equal to the ...
[ "Set", "the", "maximum", "number", "of", "times", "$identifier", "may", "be", "found", "in", "a", "Response", "Variable", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/AssociationValidityConstraint.php#L143-L160
oat-sa/qti-sdk
src/qtism/runtime/rendering/markup/xhtml/Utils.php
Utils.shuffle
static public function shuffle(DOMNode $node, ShufflableCollection $shufflables) { $shufflableIndexes = array(); $elements = array(); // 1. Detect what are the components that must // be shuffles within the fragment ($shufflableIndexes). // // 2. Store the related DO...
php
static public function shuffle(DOMNode $node, ShufflableCollection $shufflables) { $shufflableIndexes = array(); $elements = array(); // 1. Detect what are the components that must // be shuffles within the fragment ($shufflableIndexes). // // 2. Store the related DO...
[ "static", "public", "function", "shuffle", "(", "DOMNode", "$", "node", ",", "ShufflableCollection", "$", "shufflables", ")", "{", "$", "shufflableIndexes", "=", "array", "(", ")", ";", "$", "elements", "=", "array", "(", ")", ";", "// 1. Detect what are the c...
Shuffle the elements related to $shufflables components within a given $node. @param \DOMNode $node The DOM Node where corresponding $shufflables must be shuffled. @param \qtism\data\ShufflableCollection $shufflables A collection of Shufflable objects.
[ "Shuffle", "the", "elements", "related", "to", "$shufflables", "components", "within", "a", "given", "$node", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/markup/xhtml/Utils.php#L48-L124
oat-sa/qti-sdk
src/qtism/runtime/rendering/markup/xhtml/Utils.php
Utils.hasClass
static public function hasClass(DOMElement $node, $class) { if (is_array($class) === false) { $class = array($class); } $attr = explode("\x20", $node->getAttribute('class')); foreach ($class as $c) { if (in_array($c, $attr) === false) { retur...
php
static public function hasClass(DOMElement $node, $class) { if (is_array($class) === false) { $class = array($class); } $attr = explode("\x20", $node->getAttribute('class')); foreach ($class as $c) { if (in_array($c, $attr) === false) { retur...
[ "static", "public", "function", "hasClass", "(", "DOMElement", "$", "node", ",", "$", "class", ")", "{", "if", "(", "is_array", "(", "$", "class", ")", "===", "false", ")", "{", "$", "class", "=", "array", "(", "$", "class", ")", ";", "}", "$", "...
Whether or not a given $node element has the given CSS $class(es). @param \DOMElement $node @param string|array $class A class or an array of CSS classes. @return boolean
[ "Whether", "or", "not", "a", "given", "$node", "element", "has", "the", "given", "CSS", "$class", "(", "es", ")", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/markup/xhtml/Utils.php#L133-L148
oat-sa/qti-sdk
src/qtism/runtime/rendering/markup/xhtml/Utils.php
Utils.extractStatements
static public function extractStatements(DOMElement $node, $type = self::EXTRACT_IF) { $statements = array(); $extract = array( 'qtism-if', 'qtism-endif' ); if ($type === self::EXTRACT_INCLUDE) { $extract = array( ...
php
static public function extractStatements(DOMElement $node, $type = self::EXTRACT_IF) { $statements = array(); $extract = array( 'qtism-if', 'qtism-endif' ); if ($type === self::EXTRACT_INCLUDE) { $extract = array( ...
[ "static", "public", "function", "extractStatements", "(", "DOMElement", "$", "node", ",", "$", "type", "=", "self", "::", "EXTRACT_IF", ")", "{", "$", "statements", "=", "array", "(", ")", ";", "$", "extract", "=", "array", "(", "'qtism-if'", ",", "'qtis...
Extract qtism-if/qtism-endif statements around a given $node. @param DOMElement $node @return array An array of DOMComment objects.
[ "Extract", "qtism", "-", "if", "/", "qtism", "-", "endif", "statements", "around", "a", "given", "$node", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/markup/xhtml/Utils.php#L156-L193
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/MatchTableEntryMarshaller.php
MatchTableEntryMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'sourceValue', $component->getSourceValue()); $this->setDOMElementAttribute($element, 'targetValue', $component->ge...
php
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'sourceValue', $component->getSourceValue()); $this->setDOMElementAttribute($element, 'targetValue', $component->ge...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "static", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "$", "component", "->", "getQtiClassName", "(", ")", ")", ";", "$", "this", "->...
Marshall a MatchTableEntry object into a DOMElement object. @param \qtism\data\QtiComponent $component A MatchTableEntry object. @return \DOMElement The according DOMElement object.
[ "Marshall", "a", "MatchTableEntry", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/MatchTableEntryMarshaller.php#L98-L106
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/MatchTableEntryMarshaller.php
MatchTableEntryMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { if (($sourceValue = $this->getDOMElementAttributeAs($element, 'sourceValue', 'integer')) !== null) { if (($targetValue = $this->getDOMElementAttributeAs($element, 'targetValue', 'string')) !== null) { $object = new MatchTableEn...
php
protected function unmarshall(DOMElement $element) { if (($sourceValue = $this->getDOMElementAttributeAs($element, 'sourceValue', 'integer')) !== null) { if (($targetValue = $this->getDOMElementAttributeAs($element, 'targetValue', 'string')) !== null) { $object = new MatchTableEn...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "if", "(", "(", "$", "sourceValue", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'sourceValue'", ",", "'integer'", ")", ")", "!==", "null", ...
Unmarshall a DOMElement object corresponding to a QTI MatchTableEntry element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A MatchTableEntry object. @throws \UnmarshallingException If the mandatory attributes 'sourceValue' or 'targetValue' are missing from $element.
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "MatchTableEntry", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/MatchTableEntryMarshaller.php#L115-L131
oat-sa/qti-sdk
src/qtism/runtime/rules/RuleProcessingException.php
RuleProcessingException.setSource
public function setSource(Processable $source) { if ($source instanceof RuleProcessor) { parent::setSource($source); } else { $msg = "RuleProcessingException::setSource only accept RuleProcessor objects."; throw new InvalidArgumentException($msg); } }
php
public function setSource(Processable $source) { if ($source instanceof RuleProcessor) { parent::setSource($source); } else { $msg = "RuleProcessingException::setSource only accept RuleProcessor objects."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setSource", "(", "Processable", "$", "source", ")", "{", "if", "(", "$", "source", "instanceof", "RuleProcessor", ")", "{", "parent", "::", "setSource", "(", "$", "source", ")", ";", "}", "else", "{", "$", "msg", "=", "\"RuleProces...
Set the source of the error. @param \qtism\runtime\common\Processable $source The source of the error. @throws \InvalidArgumentException If $source is not an ExpressionProcessor object.
[ "Set", "the", "source", "of", "the", "error", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rules/RuleProcessingException.php#L75-L83
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/Utils.php
Utils.gcd
static public function gcd($a, $b) { $a = abs($a); $b = abs($b); $k = max($a, $b); $m = min($a, $b); while ($m !== 0) { $r = $k % $m; $k = $m; $m = $r; } return $k; }
php
static public function gcd($a, $b) { $a = abs($a); $b = abs($b); $k = max($a, $b); $m = min($a, $b); while ($m !== 0) { $r = $k % $m; $k = $m; $m = $r; } return $k; }
[ "static", "public", "function", "gcd", "(", "$", "a", ",", "$", "b", ")", "{", "$", "a", "=", "abs", "(", "$", "a", ")", ";", "$", "b", "=", "abs", "(", "$", "b", ")", ";", "$", "k", "=", "max", "(", "$", "a", ",", "$", "b", ")", ";",...
Compute the GCD (Greatest Common Divider) of $a and $b. If either $a or $b is negative, its absolute value will be used instead. @param integer $a A positive integer @param integer $b A positive integer @return integer The GCD of $a and $b.
[ "Compute", "the", "GCD", "(", "Greatest", "Common", "Divider", ")", "of", "$a", "and", "$b", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/Utils.php#L46-L61
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/Utils.php
Utils.lcm
static public function lcm($a, $b) { $a = abs($a); $b = abs($b); if ($a === 0 || $b === 0) { return 0; } $a = $a / self::gcd($a, $b); return $a * $b; }
php
static public function lcm($a, $b) { $a = abs($a); $b = abs($b); if ($a === 0 || $b === 0) { return 0; } $a = $a / self::gcd($a, $b); return $a * $b; }
[ "static", "public", "function", "lcm", "(", "$", "a", ",", "$", "b", ")", "{", "$", "a", "=", "abs", "(", "$", "a", ")", ";", "$", "b", "=", "abs", "(", "$", "b", ")", ";", "if", "(", "$", "a", "===", "0", "||", "$", "b", "===", "0", ...
Compute LCM (Least Common Multiple) of $a and $b. @param integer $a @param integer $b @return integer the LCM of $a and $b.
[ "Compute", "LCM", "(", "Least", "Common", "Multiple", ")", "of", "$a", "and", "$b", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/Utils.php#L70-L82
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/Utils.php
Utils.mean
static public function mean(array $sample) { $count = count($sample); if ($count === 0) { return false; } $sum = 0; foreach ($sample as $s) { $sType = gettype($s); if ($sType !== 'integer' && $sType !== 'double') { // only...
php
static public function mean(array $sample) { $count = count($sample); if ($count === 0) { return false; } $sum = 0; foreach ($sample as $s) { $sType = gettype($s); if ($sType !== 'integer' && $sType !== 'double') { // only...
[ "static", "public", "function", "mean", "(", "array", "$", "sample", ")", "{", "$", "count", "=", "count", "(", "$", "sample", ")", ";", "if", "(", "$", "count", "===", "0", ")", "{", "return", "false", ";", "}", "$", "sum", "=", "0", ";", "for...
Compute the arithmetic mean of $sample. @param array An array of numeric values. @return false|number The arithmetic mean of $sample or false if any of the values of $sample is not numeric or if $sample is empty.
[ "Compute", "the", "arithmetic", "mean", "of", "$sample", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/Utils.php#L90-L110
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/Utils.php
Utils.variance
static public function variance(array $sample, $correction = true) { $mean = static::mean($sample); if ($mean === false) { return false; } // We are sure that // 1. $sample is not empty. // 2. $sample contains only numeric values. $count = count(...
php
static public function variance(array $sample, $correction = true) { $mean = static::mean($sample); if ($mean === false) { return false; } // We are sure that // 1. $sample is not empty. // 2. $sample contains only numeric values. $count = count(...
[ "static", "public", "function", "variance", "(", "array", "$", "sample", ",", "$", "correction", "=", "true", ")", "{", "$", "mean", "=", "static", "::", "mean", "(", "$", "sample", ")", ";", "if", "(", "$", "mean", "===", "false", ")", "{", "retur...
Compute the variance of $sample. * To compute the population variance: $sample is considered as a population if $correction equals false. * To compute the sample variance: $sample is considered as sample if $correction equals true. IMPORTANT: If $correction is true, $sample must contain more than 1 value, otherwise t...
[ "Compute", "the", "variance", "of", "$sample", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/Utils.php#L127-L155
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/Utils.php
Utils.standardDeviation
static public function standardDeviation(array $sample, $correction = true) { $sampleVariance = static::variance($sample, $correction); if ($sampleVariance === false) { // non numeric values found in $sample or empty $sample or $correction applied // but count($sample) <= 1....
php
static public function standardDeviation(array $sample, $correction = true) { $sampleVariance = static::variance($sample, $correction); if ($sampleVariance === false) { // non numeric values found in $sample or empty $sample or $correction applied // but count($sample) <= 1....
[ "static", "public", "function", "standardDeviation", "(", "array", "$", "sample", ",", "$", "correction", "=", "true", ")", "{", "$", "sampleVariance", "=", "static", "::", "variance", "(", "$", "sample", ",", "$", "correction", ")", ";", "if", "(", "$",...
Compute the standard deviation of $sample. * To compute the population standard deviation: $sample is considered as a population if $correction equals false. * To compute the sample standard deviation: $sample is considered as sample if $correction equals true. IMPORTANT: If $correction is true, $sample must contain ...
[ "Compute", "the", "standard", "deviation", "of", "$sample", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/Utils.php#L172-L183
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/Utils.php
Utils.getPrecedingBackslashesCount
static public function getPrecedingBackslashesCount($string, $offset) { $count = 0; if ($offset < strlen($string)) { for ($i = $offset; $i > 0; $i--) { if ($string[$i - 1] === '\\') { $count++; } else { break; ...
php
static public function getPrecedingBackslashesCount($string, $offset) { $count = 0; if ($offset < strlen($string)) { for ($i = $offset; $i > 0; $i--) { if ($string[$i - 1] === '\\') { $count++; } else { break; ...
[ "static", "public", "function", "getPrecedingBackslashesCount", "(", "$", "string", ",", "$", "offset", ")", "{", "$", "count", "=", "0", ";", "if", "(", "$", "offset", "<", "strlen", "(", "$", "string", ")", ")", "{", "for", "(", "$", "i", "=", "$...
Get the amout of backslash (\) characters in $string that precede $offset. @param string $string @param integer $offset @return integer
[ "Get", "the", "amout", "of", "backslash", "(", "\\", ")", "characters", "in", "$string", "that", "precede", "$offset", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/Utils.php#L203-L218
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/Utils.php
Utils.escapeSymbols
static public function escapeSymbols($string, $symbols) { if (!is_array($symbols)) { $symbols = array($symbols); } $len = mb_strlen($string, 'UTF-8'); $returnValue = ''; for ($i = 0; $i < $len; $i++) { $char = mb_substr($string, $i, 1); // get a mult...
php
static public function escapeSymbols($string, $symbols) { if (!is_array($symbols)) { $symbols = array($symbols); } $len = mb_strlen($string, 'UTF-8'); $returnValue = ''; for ($i = 0; $i < $len; $i++) { $char = mb_substr($string, $i, 1); // get a mult...
[ "static", "public", "function", "escapeSymbols", "(", "$", "string", ",", "$", "symbols", ")", "{", "if", "(", "!", "is_array", "(", "$", "symbols", ")", ")", "{", "$", "symbols", "=", "array", "(", "$", "symbols", ")", ";", "}", "$", "len", "=", ...
Escape with a backslash (\) the $symbols in $string. @param string $string @param array|string $symbols An array of symbols or a single symbol. @return string The escaped string.
[ "Escape", "with", "a", "backslash", "(", "\\", ")", "the", "$symbols", "in", "$string", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/Utils.php#L227-L253
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/Utils.php
Utils.customOperatorClassToPhpClass
static public function customOperatorClassToPhpClass($class) { if (is_string($class) === false) { return false; } elseif (Format::isIdentifier($class, false) === false) { return false; } $class = strval($class); $tokens = explode('.', $class); ...
php
static public function customOperatorClassToPhpClass($class) { if (is_string($class) === false) { return false; } elseif (Format::isIdentifier($class, false) === false) { return false; } $class = strval($class); $tokens = explode('.', $class); ...
[ "static", "public", "function", "customOperatorClassToPhpClass", "(", "$", "class", ")", "{", "if", "(", "is_string", "(", "$", "class", ")", "===", "false", ")", "{", "return", "false", ";", "}", "elseif", "(", "Format", "::", "isIdentifier", "(", "$", ...
Transform a custom operator class e.g. 'org.qtism.custom.explode' into a PHP fully qualified class name e.g. 'org\qtism\custom\Explode'. @param string $class A custom operator class name where namespace separator is '.' (dot). @return boolean|string A fully qualified PHP class name corresponding to $class or false if ...
[ "Transform", "a", "custom", "operator", "class", "e", ".", "g", ".", "org", ".", "qtism", ".", "custom", ".", "explode", "into", "a", "PHP", "fully", "qualified", "class", "name", "e", ".", "g", ".", "org", "\\", "qtism", "\\", "custom", "\\", "Explo...
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/Utils.php#L262-L284
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/Utils.php
Utils.lastPregErrorMessage
static public function lastPregErrorMessage() { $error = preg_last_error(); $errorType = 'PCRE Engine error'; switch ($error) { case PREG_BACKTRACK_LIMIT_ERROR: $errorType = "PCRE Engine backtrack limit exceeded"; break; case PREG_RE...
php
static public function lastPregErrorMessage() { $error = preg_last_error(); $errorType = 'PCRE Engine error'; switch ($error) { case PREG_BACKTRACK_LIMIT_ERROR: $errorType = "PCRE Engine backtrack limit exceeded"; break; case PREG_RE...
[ "static", "public", "function", "lastPregErrorMessage", "(", ")", "{", "$", "error", "=", "preg_last_error", "(", ")", ";", "$", "errorType", "=", "'PCRE Engine error'", ";", "switch", "(", "$", "error", ")", "{", "case", "PREG_BACKTRACK_LIMIT_ERROR", ":", "$"...
Get a meaningful message for the last PREG error that occured. The following PREG error codes are considered by this method: * PREG_BACKTRACK_LIMIT_ERROR * PREG_RECURSION_LIMIT_ERROR * PREG_BAD_UTF8_ERROR * PREG_BAD_UTF8_OFFSET_ERROR @return string
[ "Get", "a", "meaningful", "message", "for", "the", "last", "PREG", "error", "that", "occured", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/Utils.php#L298-L319
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/Utils.php
Utils.prepareXsdPatternForPcre
static public function prepareXsdPatternForPcre($pattern) { // XML schema always implicitly anchors the entire regular expression // because there is no carret (^) nor dollar ($) signs. // see http://www.regular-expressions.info/xml.html $pattern = self::escapeSymbols($pattern, array...
php
static public function prepareXsdPatternForPcre($pattern) { // XML schema always implicitly anchors the entire regular expression // because there is no carret (^) nor dollar ($) signs. // see http://www.regular-expressions.info/xml.html $pattern = self::escapeSymbols($pattern, array...
[ "static", "public", "function", "prepareXsdPatternForPcre", "(", "$", "pattern", ")", "{", "// XML schema always implicitly anchors the entire regular expression", "// because there is no carret (^) nor dollar ($) signs.", "// see http://www.regular-expressions.info/xml.html", "$", "patter...
Prepare an XSD Regular Expression pattern into a PCRE compliant one. @return string
[ "Prepare", "an", "XSD", "Regular", "Expression", "pattern", "into", "a", "PCRE", "compliant", "one", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/Utils.php#L326-L338
oat-sa/qti-sdk
src/qtism/cli/Cli.php
Cli.main
public static function main() { $cli = new static(); // Initialize arguments from factory method. $arguments = $cli->setupArguments(); // Add help flag. $arguments->addFlag(array('help', 'h'), 'Show help screen.'); // Add verbose flag. ...
php
public static function main() { $cli = new static(); // Initialize arguments from factory method. $arguments = $cli->setupArguments(); // Add help flag. $arguments->addFlag(array('help', 'h'), 'Show help screen.'); // Add verbose flag. ...
[ "public", "static", "function", "main", "(", ")", "{", "$", "cli", "=", "new", "static", "(", ")", ";", "// Initialize arguments from factory method.", "$", "arguments", "=", "$", "cli", "->", "setupArguments", "(", ")", ";", "// Add help flag.", "$", "argumen...
Main CLI entry point.
[ "Main", "CLI", "entry", "point", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/cli/Cli.php#L87-L113
oat-sa/qti-sdk
src/qtism/cli/Cli.php
Cli.success
protected function success($message) { if ($this->isVerbose() === true) { $this->out("%g${message}%n", true); } exit(self::EXIT_SUCCESS); }
php
protected function success($message) { if ($this->isVerbose() === true) { $this->out("%g${message}%n", true); } exit(self::EXIT_SUCCESS); }
[ "protected", "function", "success", "(", "$", "message", ")", "{", "if", "(", "$", "this", "->", "isVerbose", "(", ")", "===", "true", ")", "{", "$", "this", "->", "out", "(", "\"%g${message}%n\"", ",", "true", ")", ";", "}", "exit", "(", "self", "...
Show a success message as a single line in stdout and return a zero POSIX exit status. This method produces no output if verbose mode is not in force but the exit status will still be returned. @param string $message The success message.
[ "Show", "a", "success", "message", "as", "a", "single", "line", "in", "stdout", "and", "return", "a", "zero", "POSIX", "exit", "status", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/cli/Cli.php#L181-L188
oat-sa/qti-sdk
src/qtism/cli/Cli.php
Cli.out
protected function out($data, $newLine = true) { CliTools\out($data); if ($newLine === true) { CliTools\out("\n"); } }
php
protected function out($data, $newLine = true) { CliTools\out($data); if ($newLine === true) { CliTools\out("\n"); } }
[ "protected", "function", "out", "(", "$", "data", ",", "$", "newLine", "=", "true", ")", "{", "CliTools", "\\", "out", "(", "$", "data", ")", ";", "if", "(", "$", "newLine", "===", "true", ")", "{", "CliTools", "\\", "out", "(", "\"\\n\"", ")", "...
Show raw data in console even if verbose mode is not in force. @param string $data The data to go in output. @param boolean $newLine Whether to display a new line after $data.
[ "Show", "raw", "data", "in", "console", "even", "if", "verbose", "mode", "is", "not", "in", "force", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/cli/Cli.php#L240-L247
oat-sa/qti-sdk
src/qtism/common/collections/AbstractCollection.php
AbstractCollection.offsetGet
public function offsetGet($offset) { return isset($this->dataPlaceHolder[$offset]) ? $this->dataPlaceHolder[$offset] : null; }
php
public function offsetGet($offset) { return isset($this->dataPlaceHolder[$offset]) ? $this->dataPlaceHolder[$offset] : null; }
[ "public", "function", "offsetGet", "(", "$", "offset", ")", "{", "return", "isset", "(", "$", "this", "->", "dataPlaceHolder", "[", "$", "offset", "]", ")", "?", "$", "this", "->", "dataPlaceHolder", "[", "$", "offset", "]", ":", "null", ";", "}" ]
Offset to retrieve. If the $offset does not reference any value, a null value is returned. @param mixed $offset The offset to retrieve. @return mixex The value at specified offset.
[ "Offset", "to", "retrieve", ".", "If", "the", "$offset", "does", "not", "reference", "any", "value", "a", "null", "value", "is", "returned", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/collections/AbstractCollection.php#L160-L163
oat-sa/qti-sdk
src/qtism/common/collections/AbstractCollection.php
AbstractCollection.offsetSet
public function offsetSet($offset, $value) { $this->checkType($value); if (is_null($offset)) { array_push($this->dataPlaceHolder, $value); } else { $this->dataPlaceHolder[$offset] = $value; } }
php
public function offsetSet($offset, $value) { $this->checkType($value); if (is_null($offset)) { array_push($this->dataPlaceHolder, $value); } else { $this->dataPlaceHolder[$offset] = $value; } }
[ "public", "function", "offsetSet", "(", "$", "offset", ",", "$", "value", ")", "{", "$", "this", "->", "checkType", "(", "$", "value", ")", ";", "if", "(", "is_null", "(", "$", "offset", ")", ")", "{", "array_push", "(", "$", "this", "->", "dataPla...
Offset to set. If a value is already set for the given $offset, its value will be overriden with $value. @param mixed $offset The offset to assign the value to. @param mixed $value The value to set. @throws \InvalidArgumentException If $value has not a valid type regarding the implementation.
[ "Offset", "to", "set", ".", "If", "a", "value", "is", "already", "set", "for", "the", "given", "$offset", "its", "value", "will", "be", "overriden", "with", "$value", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/collections/AbstractCollection.php#L173-L182
oat-sa/qti-sdk
src/qtism/common/collections/AbstractCollection.php
AbstractCollection.getArrayCopy
public function getArrayCopy($preserveKeys = false) { return ($preserveKeys === true) ? $this->dataPlaceHolder : array_values($this->dataPlaceHolder); }
php
public function getArrayCopy($preserveKeys = false) { return ($preserveKeys === true) ? $this->dataPlaceHolder : array_values($this->dataPlaceHolder); }
[ "public", "function", "getArrayCopy", "(", "$", "preserveKeys", "=", "false", ")", "{", "return", "(", "$", "preserveKeys", "===", "true", ")", "?", "$", "this", "->", "dataPlaceHolder", ":", "array_values", "(", "$", "this", "->", "dataPlaceHolder", ")", ...
Get a copy of the collection as an array. This method is implemented in order to implement ArrayObject in a near future. @return array The collection as an array of data.
[ "Get", "a", "copy", "of", "the", "collection", "as", "an", "array", ".", "This", "method", "is", "implemented", "in", "order", "to", "implement", "ArrayObject", "in", "a", "near", "future", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/collections/AbstractCollection.php#L195-L198
oat-sa/qti-sdk
src/qtism/common/collections/AbstractCollection.php
AbstractCollection.contains
public function contains($value) { foreach (array_keys($this->dataPlaceHolder) as $key) { $data = $this->dataPlaceHolder[$key]; if ($value === $data || ($data instanceof Comparable && $data->equals($value))) { return true; } } return false...
php
public function contains($value) { foreach (array_keys($this->dataPlaceHolder) as $key) { $data = $this->dataPlaceHolder[$key]; if ($value === $data || ($data instanceof Comparable && $data->equals($value))) { return true; } } return false...
[ "public", "function", "contains", "(", "$", "value", ")", "{", "foreach", "(", "array_keys", "(", "$", "this", "->", "dataPlaceHolder", ")", "as", "$", "key", ")", "{", "$", "data", "=", "$", "this", "->", "dataPlaceHolder", "[", "$", "key", "]", ";"...
Whether the collection contains a given $value. The comparison is strict, using the === operator. @param mixed $value A value. @return boolean Whether the collection contains $value.
[ "Whether", "the", "collection", "contains", "a", "given", "$value", ".", "The", "comparison", "is", "strict", "using", "the", "===", "operator", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/collections/AbstractCollection.php#L207-L217
oat-sa/qti-sdk
src/qtism/common/collections/AbstractCollection.php
AbstractCollection.attach
public function attach($object) { $this->checkType($object); if (gettype($object) !== 'object') { $msg = "You can only attach 'objects' into an AbstractCollection, '" . gettype($object) . "' given"; throw new InvalidArgumentException($msg); } elseif (!$this->contains...
php
public function attach($object) { $this->checkType($object); if (gettype($object) !== 'object') { $msg = "You can only attach 'objects' into an AbstractCollection, '" . gettype($object) . "' given"; throw new InvalidArgumentException($msg); } elseif (!$this->contains...
[ "public", "function", "attach", "(", "$", "object", ")", "{", "$", "this", "->", "checkType", "(", "$", "object", ")", ";", "if", "(", "gettype", "(", "$", "object", ")", "!==", "'object'", ")", "{", "$", "msg", "=", "\"You can only attach 'objects' into...
Attach a given $object to the collection. @param mixed $object An object. @throws \InvalidArgumentException If $object is not an 'object' type or not compliant with the typing of the collection.
[ "Attach", "a", "given", "$object", "to", "the", "collection", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/collections/AbstractCollection.php#L225-L235
oat-sa/qti-sdk
src/qtism/common/collections/AbstractCollection.php
AbstractCollection.detach
public function detach($object) { $this->checkType($object); if (gettype($object) !== 'object') { $msg = "You can only detach 'objects' into an AbstractCollection, '" . gettype($object) . "' given."; throw new InvalidArgumentException($msg); } foreach (array...
php
public function detach($object) { $this->checkType($object); if (gettype($object) !== 'object') { $msg = "You can only detach 'objects' into an AbstractCollection, '" . gettype($object) . "' given."; throw new InvalidArgumentException($msg); } foreach (array...
[ "public", "function", "detach", "(", "$", "object", ")", "{", "$", "this", "->", "checkType", "(", "$", "object", ")", ";", "if", "(", "gettype", "(", "$", "object", ")", "!==", "'object'", ")", "{", "$", "msg", "=", "\"You can only detach 'objects' into...
Detach a given $object from the collection. @param mixed $object An object. @throws \InvalidArgumentException If $object is not an 'object' type or not compliant with the typing of the collection. @throws \UnexpectedValueException If $object cannot be found in the collection.
[ "Detach", "a", "given", "$object", "from", "the", "collection", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/collections/AbstractCollection.php#L244-L263
oat-sa/qti-sdk
src/qtism/common/collections/AbstractCollection.php
AbstractCollection.replace
public function replace($object, $replacement) { $this->checkType($object); $this->checkType($replacement); if (gettype($object) !== 'object') { $msg = "You can only replace 'objects' into an AbstractCollection, '" . gettype($object) . "' given."; throw new InvalidAr...
php
public function replace($object, $replacement) { $this->checkType($object); $this->checkType($replacement); if (gettype($object) !== 'object') { $msg = "You can only replace 'objects' into an AbstractCollection, '" . gettype($object) . "' given."; throw new InvalidAr...
[ "public", "function", "replace", "(", "$", "object", ",", "$", "replacement", ")", "{", "$", "this", "->", "checkType", "(", "$", "object", ")", ";", "$", "this", "->", "checkType", "(", "$", "replacement", ")", ";", "if", "(", "gettype", "(", "$", ...
Replace an $object in the collection by another $replacement $object. @param mixed $object An object to be replaced. @param mixed $replacement An object to be used as a replacement. @throws \InvalidArgumentException If $object or $replacement are not compliant with the current collection typing. @throws \UnexpectedVal...
[ "Replace", "an", "$object", "in", "the", "collection", "by", "another", "$replacement", "$object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/collections/AbstractCollection.php#L273-L298
oat-sa/qti-sdk
src/qtism/common/collections/AbstractCollection.php
AbstractCollection.remove
public function remove($object) { foreach (array_keys($this->dataPlaceHolder) as $k) { if ($this->dataPlaceHolder[$k] === $object) { unset($this->dataPlaceHolder[$k]); return; } } }
php
public function remove($object) { foreach (array_keys($this->dataPlaceHolder) as $k) { if ($this->dataPlaceHolder[$k] === $object) { unset($this->dataPlaceHolder[$k]); return; } } }
[ "public", "function", "remove", "(", "$", "object", ")", "{", "foreach", "(", "array_keys", "(", "$", "this", "->", "dataPlaceHolder", ")", "as", "$", "k", ")", "{", "if", "(", "$", "this", "->", "dataPlaceHolder", "[", "$", "k", "]", "===", "$", "...
Remove $object from the collection. If $object is not in the collection, it remains as it is. @param mixed $object The object to remove from the collection.
[ "Remove", "$object", "from", "the", "collection", ".", "If", "$object", "is", "not", "in", "the", "collection", "it", "remains", "as", "it", "is", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/collections/AbstractCollection.php#L306-L315
oat-sa/qti-sdk
src/qtism/common/collections/AbstractCollection.php
AbstractCollection.merge
public function merge(AbstractCollection $collection) { if (is_subclass_of($collection, get_class($this)) === true || get_class($collection) === get_class($this)) { $newData = array_merge($this->dataPlaceHolder, $collection->getDataPlaceHolder()); $this->dataPlaceHolder = $newData; ...
php
public function merge(AbstractCollection $collection) { if (is_subclass_of($collection, get_class($this)) === true || get_class($collection) === get_class($this)) { $newData = array_merge($this->dataPlaceHolder, $collection->getDataPlaceHolder()); $this->dataPlaceHolder = $newData; ...
[ "public", "function", "merge", "(", "AbstractCollection", "$", "collection", ")", "{", "if", "(", "is_subclass_of", "(", "$", "collection", ",", "get_class", "(", "$", "this", ")", ")", "===", "true", "||", "get_class", "(", "$", "collection", ")", "===", ...
Merge the collection with another one. @param qtism\common\collections\AbstractCollection $collection @throws \InvalidArgumentException If $collection is not a subclass of the target of the call.
[ "Merge", "the", "collection", "with", "another", "one", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/collections/AbstractCollection.php#L342-L352
oat-sa/qti-sdk
src/qtism/common/collections/AbstractCollection.php
AbstractCollection.diff
public function diff(AbstractCollection $collection) { if (get_class($this) === get_class($collection)) { $newData = array_diff($this->dataPlaceHolder, $collection->getDataPlaceHolder()); return new static($newData); } else { $msg = "Difference may apply only on ...
php
public function diff(AbstractCollection $collection) { if (get_class($this) === get_class($collection)) { $newData = array_diff($this->dataPlaceHolder, $collection->getDataPlaceHolder()); return new static($newData); } else { $msg = "Difference may apply only on ...
[ "public", "function", "diff", "(", "AbstractCollection", "$", "collection", ")", "{", "if", "(", "get_class", "(", "$", "this", ")", "===", "get_class", "(", "$", "collection", ")", ")", "{", "$", "newData", "=", "array_diff", "(", "$", "this", "->", "...
Get the difference between this collection and another one. @param \qtism\common\collections\AbstractCollection $collection @return \qtism\common\collections\AbstractCollection
[ "Get", "the", "difference", "between", "this", "collection", "and", "another", "one", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/collections/AbstractCollection.php#L360-L370
oat-sa/qti-sdk
src/qtism/common/collections/AbstractCollection.php
AbstractCollection.intersect
public function intersect(AbstractCollection $collection) { if (get_class($this) === get_class($collection)) { $newData = array_intersect($this->dataPlaceHolder, $collection->getDataPlaceHolder()); return new static($newData); } else { $msg = "Intersection may ap...
php
public function intersect(AbstractCollection $collection) { if (get_class($this) === get_class($collection)) { $newData = array_intersect($this->dataPlaceHolder, $collection->getDataPlaceHolder()); return new static($newData); } else { $msg = "Intersection may ap...
[ "public", "function", "intersect", "(", "AbstractCollection", "$", "collection", ")", "{", "if", "(", "get_class", "(", "$", "this", ")", "===", "get_class", "(", "$", "collection", ")", ")", "{", "$", "newData", "=", "array_intersect", "(", "$", "this", ...
Get the intersection between this collection and another one. @param \qtism\common\collections\AbstractCollection $collection @return \qtism\common\collections\AbstractCollection
[ "Get", "the", "intersection", "between", "this", "collection", "and", "another", "one", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/collections/AbstractCollection.php#L378-L388
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/MemberProcessor.php
MemberProcessor.process
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->sameBaseType() === false) { $msg = "The Member operator only accepts values with the same baseType."; throw new ...
php
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->sameBaseType() === false) { $msg = "The Member operator only accepts values with the same baseType."; throw new ...
[ "public", "function", "process", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "if", "(", "$", "operands", "->", "containsNull", "(", ")", "===", "true", ")", "{", "return", "null", ";", "}", "if", "(", "$", ...
Process the Member operator. @return boolean Whether the first operand is contained by the second one as a boolean value, or NULL if any of the sub-expressions are NULL. @throws \qtism\runtime\expressions\operators\OperatorProcessingException
[ "Process", "the", "Member", "operator", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/MemberProcessor.php#L57-L89
oat-sa/qti-sdk
src/qtism/data/content/interactions/MatchInteraction.php
MatchInteraction.setSimpleMatchSets
public function setSimpleMatchSets(SimpleMatchSetCollection $simpleMatchSets) { if (count($simpleMatchSets) === 2) { $this->simpleMatchSets = $simpleMatchSets; } else { $msg = "A MatchInteraction object must be composed of exactly two SimpleMatchSet objects."; thr...
php
public function setSimpleMatchSets(SimpleMatchSetCollection $simpleMatchSets) { if (count($simpleMatchSets) === 2) { $this->simpleMatchSets = $simpleMatchSets; } else { $msg = "A MatchInteraction object must be composed of exactly two SimpleMatchSet objects."; thr...
[ "public", "function", "setSimpleMatchSets", "(", "SimpleMatchSetCollection", "$", "simpleMatchSets", ")", "{", "if", "(", "count", "(", "$", "simpleMatchSets", ")", "===", "2", ")", "{", "$", "this", "->", "simpleMatchSets", "=", "$", "simpleMatchSets", ";", "...
Set the set of choices. The first defines the source choices and the second one the targets. @param \qtism\data\content\interactions\SimpleMatchSetCollection $simpleMatchSets A collection of exactly two SimpleMatchSet objects. @throws \InvalidArgumentException If $simpleMatchSets does not contain exactly two SimpleMat...
[ "Set", "the", "set", "of", "choices", ".", "The", "first", "defines", "the", "source", "choices", "and", "the", "second", "one", "the", "targets", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/interactions/MatchInteraction.php#L203-L211
oat-sa/qti-sdk
src/qtism/data/storage/FileResolver.php
FileResolver.setBasePath
public function setBasePath($basePath = '') { if (gettype($basePath) === 'string') { $this->basePath = $basePath; } else { $msg = "The basePath argument must be a valid string, '" . gettype($basePath) . "' given."; throw new InvalidArgumentException($msg); ...
php
public function setBasePath($basePath = '') { if (gettype($basePath) === 'string') { $this->basePath = $basePath; } else { $msg = "The basePath argument must be a valid string, '" . gettype($basePath) . "' given."; throw new InvalidArgumentException($msg); ...
[ "public", "function", "setBasePath", "(", "$", "basePath", "=", "''", ")", "{", "if", "(", "gettype", "(", "$", "basePath", ")", "===", "'string'", ")", "{", "$", "this", "->", "basePath", "=", "$", "basePath", ";", "}", "else", "{", "$", "msg", "=...
Set the basePath. @param string $basePath A base path. @throws \InvalidArgumentException If $basePath is not a string value.
[ "Set", "the", "basePath", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/FileResolver.php#L60-L68
oat-sa/qti-sdk
src/qtism/data/state/MatchTableEntry.php
MatchTableEntry.setSourceValue
public function setSourceValue($sourceValue) { if (is_int($sourceValue)) { $this->sourceValue = $sourceValue; } else { $msg = "SourceValue must be an integer, '" . gettype($sourceValue) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setSourceValue($sourceValue) { if (is_int($sourceValue)) { $this->sourceValue = $sourceValue; } else { $msg = "SourceValue must be an integer, '" . gettype($sourceValue) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setSourceValue", "(", "$", "sourceValue", ")", "{", "if", "(", "is_int", "(", "$", "sourceValue", ")", ")", "{", "$", "this", "->", "sourceValue", "=", "$", "sourceValue", ";", "}", "else", "{", "$", "msg", "=", "\"SourceValue must...
Set the source integer that must be matched exactly. @param integer $sourceValue An integer value. @throws \InvalidArgumentException If $sourceValue is not an integer.
[ "Set", "the", "source", "integer", "that", "must", "be", "matched", "exactly", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/MatchTableEntry.php#L86-L94
oat-sa/qti-sdk
src/qtism/data/content/TemplateElement.php
TemplateElement.setTemplateIdentifier
public function setTemplateIdentifier($templateIdentifier) { if (Format::isIdentifier($templateIdentifier, false) === true) { $this->templateIdentifier = $templateIdentifier; } else { $msg = "The 'templateIdentifier' argument must be a valid QTI identifier, '" . $templateIden...
php
public function setTemplateIdentifier($templateIdentifier) { if (Format::isIdentifier($templateIdentifier, false) === true) { $this->templateIdentifier = $templateIdentifier; } else { $msg = "The 'templateIdentifier' argument must be a valid QTI identifier, '" . $templateIden...
[ "public", "function", "setTemplateIdentifier", "(", "$", "templateIdentifier", ")", "{", "if", "(", "Format", "::", "isIdentifier", "(", "$", "templateIdentifier", ",", "false", ")", "===", "true", ")", "{", "$", "this", "->", "templateIdentifier", "=", "$", ...
Set the template variable identifier. @param string $templateIdentifier A QTI identifier. @throws \InvalidArgumentException If $templateIdentifier is not a valid QTI identifier.
[ "Set", "the", "template", "variable", "identifier", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/TemplateElement.php#L89-L97
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/IndexProcessor.php
IndexProcessor.process
public function process() { $operands = $this->getOperands(); if ($operands->containsNull()) { return null; } if ($operands->exclusivelyOrdered() === false) { $msg = "The Index operator only accepts values with a cardinality of ordered."; throw n...
php
public function process() { $operands = $this->getOperands(); if ($operands->containsNull()) { return null; } if ($operands->exclusivelyOrdered() === false) { $msg = "The Index operator only accepts values with a cardinality of ordered."; throw n...
[ "public", "function", "process", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "if", "(", "$", "operands", "->", "containsNull", "(", ")", ")", "{", "return", "null", ";", "}", "if", "(", "$", "operands", "->...
Process the Index operator. @return mixed|null A QTIRuntime compliant scalar value. NULL is returned if expression->n exceeds the number of values in the container or the sub-expression is NULL. @throws \qtism\runtime\expressions\operators\OperatorProcessingException
[ "Process", "the", "Index", "operator", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/IndexProcessor.php#L55-L98
oat-sa/qti-sdk
src/qtism/data/storage/php/PhpVariable.php
PhpVariable.setName
public function setName($name) { if (is_string($name) === false) { $msg = "The 'name' argument must be a string value, '" . gettype($name) . "' given."; throw new InvalidArgumentException($msg); } $this->name = $name; }
php
public function setName($name) { if (is_string($name) === false) { $msg = "The 'name' argument must be a string value, '" . gettype($name) . "' given."; throw new InvalidArgumentException($msg); } $this->name = $name; }
[ "public", "function", "setName", "(", "$", "name", ")", "{", "if", "(", "is_string", "(", "$", "name", ")", "===", "false", ")", "{", "$", "msg", "=", "\"The 'name' argument must be a string value, '\"", ".", "gettype", "(", "$", "name", ")", ".", "\"' giv...
Set the name of the variable. @param string $name The name of the variable without the leading dollar sign ('$'). @throws InvalidArgumentException If $name is not a string value.
[ "Set", "the", "name", "of", "the", "variable", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/php/PhpVariable.php#L59-L67
oat-sa/qti-sdk
src/qtism/data/content/ModalFeedbackRule.php
ModalFeedbackRule.setTitle
public function setTitle($title) { if (is_string($title) === true) { $this->title = $title; } else { $msg = "The 'title' argument must be a string, '" . gettype($title) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setTitle($title) { if (is_string($title) === true) { $this->title = $title; } else { $msg = "The 'title' argument must be a string, '" . gettype($title) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setTitle", "(", "$", "title", ")", "{", "if", "(", "is_string", "(", "$", "title", ")", "===", "true", ")", "{", "$", "this", "->", "title", "=", "$", "title", ";", "}", "else", "{", "$", "msg", "=", "\"The 'title' argument mus...
Set the title of the feedback. An empty string means there is no title. @param string $title @throws InvalidArgumentException If $title is not a string.
[ "Set", "the", "title", "of", "the", "feedback", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/ModalFeedbackRule.php#L176-L184
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/ColMarshaller.php
ColMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = self::getDOMCradle()->createElement('col'); if ($component->getSpan() !== 1) { $this->setDOMElementAttribute($element, 'span', $component->getSpan()); } $this->fillElement($element, $component); ...
php
protected function marshall(QtiComponent $component) { $element = self::getDOMCradle()->createElement('col'); if ($component->getSpan() !== 1) { $this->setDOMElementAttribute($element, 'span', $component->getSpan()); } $this->fillElement($element, $component); ...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "self", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "'col'", ")", ";", "if", "(", "$", "component", "->", "getSpan", "(", ")", "!==...
Marshall a Col object into a DOMElement object. @param \QtiComponent $component A Col object. @return \DOMElement The according DOMElement object. @throws \qtism\data\storage\xml\marshalling\MarshallingException
[ "Marshall", "a", "Col", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/ColMarshaller.php#L44-L55
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/ColMarshaller.php
ColMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { $component = new Col(); if (($span = $this->getDOMElementAttributeAs($element, 'span', 'integer')) !== null) { $component->setSpan($span); } $this->fillBodyElement($component, $element); return $component; ...
php
protected function unmarshall(DOMElement $element) { $component = new Col(); if (($span = $this->getDOMElementAttributeAs($element, 'span', 'integer')) !== null) { $component->setSpan($span); } $this->fillBodyElement($component, $element); return $component; ...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "$", "component", "=", "new", "Col", "(", ")", ";", "if", "(", "(", "$", "span", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'span'", ...
Unmarshall a DOMElement object corresponding to an XHTML col element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A Col object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "an", "XHTML", "col", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/ColMarshaller.php#L64-L75
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/StatsOperatorProcessor.php
StatsOperatorProcessor.process
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->exclusivelyMultipleOrOrdered() === false) { $msg = "The StatsOperator operator only accepts operands with a multiple or orde...
php
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->exclusivelyMultipleOrOrdered() === false) { $msg = "The StatsOperator operator only accepts operands with a multiple or orde...
[ "public", "function", "process", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "if", "(", "$", "operands", "->", "containsNull", "(", ")", "===", "true", ")", "{", "return", "null", ";", "}", "if", "(", "$", ...
Process the StatsOperator. @return float A single float or NULL if the sub-expression or any value contained therein is NULL. @throws \qtism\runtime\expressions\operators\OperatorProcessingException
[ "Process", "the", "StatsOperator", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/StatsOperatorProcessor.php#L67-L89
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/StatsOperatorProcessor.php
StatsOperatorProcessor.filterValues
protected static function filterValues(array $data) { $returnValue = array(); foreach ($data as $d) { if ($d !== null) { $returnValue[] = $d->getValue(); } else { $returnValue[] = $d; } } return $returnValue; }
php
protected static function filterValues(array $data) { $returnValue = array(); foreach ($data as $d) { if ($d !== null) { $returnValue[] = $d->getValue(); } else { $returnValue[] = $d; } } return $returnValue; }
[ "protected", "static", "function", "filterValues", "(", "array", "$", "data", ")", "{", "$", "returnValue", "=", "array", "(", ")", ";", "foreach", "(", "$", "data", "as", "$", "d", ")", "{", "if", "(", "$", "d", "!==", "null", ")", "{", "$", "re...
Filter the $data array by transforming Float and Integer object into PHP runtime values. @param array $data An array of Float and/or Integer values. @return array A filtered array with PHP float and integers.
[ "Filter", "the", "$data", "array", "by", "transforming", "Float", "and", "Integer", "object", "into", "PHP", "runtime", "values", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/StatsOperatorProcessor.php#L168-L180
oat-sa/qti-sdk
src/qtism/common/utils/Version.php
Version.compare
static public function compare($version1, $version2, $operator = null) { $version1 = trim($version1); $version2 = trim($version2); // Because version_compare consider 2.1 < 2.1.0... $version1 = self::appendPatchVersion($version1); $version2 = self::appendPatchVersion...
php
static public function compare($version1, $version2, $operator = null) { $version1 = trim($version1); $version2 = trim($version2); // Because version_compare consider 2.1 < 2.1.0... $version1 = self::appendPatchVersion($version1); $version2 = self::appendPatchVersion...
[ "static", "public", "function", "compare", "(", "$", "version1", ",", "$", "version2", ",", "$", "operator", "=", "null", ")", "{", "$", "version1", "=", "trim", "(", "$", "version1", ")", ";", "$", "version2", "=", "trim", "(", "$", "version2", ")",...
Compare two version numbers of QTI, following the rules of Semantic Versioning. This method provides QTI version comparison. Two versions are compared using an optional operator. When no $operator is provided, this method returns * -1 if $version1 is lower than $version2 * 0 if $version1 is equal to $version2 * 1 if ...
[ "Compare", "two", "version", "numbers", "of", "QTI", "following", "the", "rules", "of", "Semantic", "Versioning", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/utils/Version.php#L61-L88
oat-sa/qti-sdk
src/qtism/common/utils/Version.php
Version.isKnown
static public function isKnown($version) { $version = self::appendPatchVersion($version); return in_array($version, self::knownVersions()); }
php
static public function isKnown($version) { $version = self::appendPatchVersion($version); return in_array($version, self::knownVersions()); }
[ "static", "public", "function", "isKnown", "(", "$", "version", ")", "{", "$", "version", "=", "self", "::", "appendPatchVersion", "(", "$", "version", ")", ";", "return", "in_array", "(", "$", "version", ",", "self", "::", "knownVersions", "(", ")", ")"...
Wether or not a $version containing a major, minor and patch version is a known QTI version. @param string $version A version with major, minor and patch version e.g. '2.1.1'. @return boolean
[ "Wether", "or", "not", "a", "$version", "containing", "a", "major", "minor", "and", "patch", "version", "is", "a", "known", "QTI", "version", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/utils/Version.php#L97-L101
oat-sa/qti-sdk
src/qtism/common/utils/Version.php
Version.appendPatchVersion
static public function appendPatchVersion($version) { $shortKnownVersions = array('2.0', '2.1', '2.2'); if (in_array($version, $shortKnownVersions) === true) { $version = $version . '.0'; } return $version; }
php
static public function appendPatchVersion($version) { $shortKnownVersions = array('2.0', '2.1', '2.2'); if (in_array($version, $shortKnownVersions) === true) { $version = $version . '.0'; } return $version; }
[ "static", "public", "function", "appendPatchVersion", "(", "$", "version", ")", "{", "$", "shortKnownVersions", "=", "array", "(", "'2.0'", ",", "'2.1'", ",", "'2.2'", ")", ";", "if", "(", "in_array", "(", "$", "version", ",", "$", "shortKnownVersions", ")...
Append patch version to $version if $version only contains major and minor versions. @param string $version @return string
[ "Append", "patch", "version", "to", "$version", "if", "$version", "only", "contains", "major", "and", "minor", "versions", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/utils/Version.php#L121-L129
oat-sa/qti-sdk
src/qtism/data/AssessmentSection.php
AssessmentSection.setTitle
public function setTitle($title) { if (gettype($title) === 'string') { $this->title = $title; } else { $msg = "Title must be a string, '" . gettype($title) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setTitle($title) { if (gettype($title) === 'string') { $this->title = $title; } else { $msg = "Title must be a string, '" . gettype($title) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setTitle", "(", "$", "title", ")", "{", "if", "(", "gettype", "(", "$", "title", ")", "===", "'string'", ")", "{", "$", "this", "->", "title", "=", "$", "title", ";", "}", "else", "{", "$", "msg", "=", "\"Title must be a string...
Set the title of the Assessment Section. @param string $title A title. @throws \InvalidArgumentException If $title is not a string.
[ "Set", "the", "title", "of", "the", "Assessment", "Section", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/AssessmentSection.php#L130-L138
oat-sa/qti-sdk
src/qtism/data/AssessmentSection.php
AssessmentSection.setVisible
public function setVisible($visible) { if (is_bool($visible)) { $this->visible = $visible; } else { $msg = "Visible must be a boolean, '" . gettype($visible) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setVisible($visible) { if (is_bool($visible)) { $this->visible = $visible; } else { $msg = "Visible must be a boolean, '" . gettype($visible) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setVisible", "(", "$", "visible", ")", "{", "if", "(", "is_bool", "(", "$", "visible", ")", ")", "{", "$", "this", "->", "visible", "=", "$", "visible", ";", "}", "else", "{", "$", "msg", "=", "\"Visible must be a boolean, '\"", ...
Set the visibility of the section. @param boolean $visible true if it must be visible, false otherwise. @throws \InvalidArgumentException If $visible is not a boolean.
[ "Set", "the", "visibility", "of", "the", "section", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/AssessmentSection.php#L156-L164
oat-sa/qti-sdk
src/qtism/data/AssessmentSection.php
AssessmentSection.setKeepTogether
public function setKeepTogether($keepTogether) { if (is_bool($keepTogether)) { $this->keepTogether = $keepTogether; } else { $msg = "KeepTogether must be a boolean, '" . gettype($keepTogether) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setKeepTogether($keepTogether) { if (is_bool($keepTogether)) { $this->keepTogether = $keepTogether; } else { $msg = "KeepTogether must be a boolean, '" . gettype($keepTogether) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setKeepTogether", "(", "$", "keepTogether", ")", "{", "if", "(", "is_bool", "(", "$", "keepTogether", ")", ")", "{", "$", "this", "->", "keepTogether", "=", "$", "keepTogether", ";", "}", "else", "{", "$", "msg", "=", "\"KeepTogeth...
Set if the items must be kept together if the section is invisible. @param boolean $keepTogether true if the items must be kept together, false otherwise. @throws \InvalidArgumentException If $keepTogether is not a boolean.
[ "Set", "if", "the", "items", "must", "be", "kept", "together", "if", "the", "section", "is", "invisible", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/AssessmentSection.php#L182-L190
oat-sa/qti-sdk
src/qtism/runtime/processing/Utils.php
Utils.templateProcessingImpactedVariables
static public function templateProcessingImpactedVariables(TemplateProcessing $templateProcessing) { $identifiers = array(); $classNames = array( 'setTemplateValue', 'setCorrectResponse', 'setDefaultValue' ); $iterator = $templateProcessin...
php
static public function templateProcessingImpactedVariables(TemplateProcessing $templateProcessing) { $identifiers = array(); $classNames = array( 'setTemplateValue', 'setCorrectResponse', 'setDefaultValue' ); $iterator = $templateProcessin...
[ "static", "public", "function", "templateProcessingImpactedVariables", "(", "TemplateProcessing", "$", "templateProcessing", ")", "{", "$", "identifiers", "=", "array", "(", ")", ";", "$", "classNames", "=", "array", "(", "'setTemplateValue'", ",", "'setCorrectRespons...
Obtain a list of the identifiers of variables that might have their values changed by a templateProcessing description. A variable is considered to be possibly impacted if: * It is the target of a setTemplateValue template rule. * It is the target of a setCorrectResponse template rule. * It is the target of a setDefa...
[ "Obtain", "a", "list", "of", "the", "identifiers", "of", "variables", "that", "might", "have", "their", "values", "changed", "by", "a", "templateProcessing", "description", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/processing/Utils.php#L49-L65
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/RepeatMarshaller.php
RepeatMarshaller.unmarshallChildrenKnown
protected function unmarshallChildrenKnown(DOMElement $element, QtiComponentCollection $children) { if (($numberRepeats = $this->getDOMElementAttributeAs($element, 'numberRepeats')) !== null) { if (Format::isInteger($numberRepeats)) { $numberRepeats = intval($numberRepeats); ...
php
protected function unmarshallChildrenKnown(DOMElement $element, QtiComponentCollection $children) { if (($numberRepeats = $this->getDOMElementAttributeAs($element, 'numberRepeats')) !== null) { if (Format::isInteger($numberRepeats)) { $numberRepeats = intval($numberRepeats); ...
[ "protected", "function", "unmarshallChildrenKnown", "(", "DOMElement", "$", "element", ",", "QtiComponentCollection", "$", "children", ")", "{", "if", "(", "(", "$", "numberRepeats", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "...
Unmarshall a QTI repeat operator element into a Repeat object. @param \DOMElement $element The repeat element to unmarshall. @param \qtism\data\QtiComponentCollection $children A collection containing the child Expression objects composing the Operator. @return \qtism\data\QtiComponent A Repeat object. @throws \qtism\...
[ "Unmarshall", "a", "QTI", "repeat", "operator", "element", "into", "a", "Repeat", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/RepeatMarshaller.php#L67-L82
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/OutcomeProcessingMarshaller.php
OutcomeProcessingMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = self::getDOMCradle()->createElement($component->getQtiClassName()); foreach ($component->getOutcomeRules() as $outcomeRule) { $marshaller = $this->getMarshallerFactory()->createMarshaller($outcomeRule); $eleme...
php
protected function marshall(QtiComponent $component) { $element = self::getDOMCradle()->createElement($component->getQtiClassName()); foreach ($component->getOutcomeRules() as $outcomeRule) { $marshaller = $this->getMarshallerFactory()->createMarshaller($outcomeRule); $eleme...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "self", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "$", "component", "->", "getQtiClassName", "(", ")", ")", ";", "foreach", "(", "$...
Marshall an OutcomeProcessing object into a DOMElement object. @param \qtism\data\QtiComponent $component An OutcomeProcessing object. @return \DOMElement The according DOMElement object. @throws \qtism\data\storage\xml\marshalling\MarshallingException
[ "Marshall", "an", "OutcomeProcessing", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/OutcomeProcessingMarshaller.php#L45-L55
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/OutcomeProcessingMarshaller.php
OutcomeProcessingMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { $outcomeRuleElts = self::getChildElements($element); $outcomeRules = new OutcomeRuleCollection(); for ($i = 0; $i < count($outcomeRuleElts); $i++) { $marshaller = $this->getMarshallerFactory()->createMarshaller($outcomeRuleElt...
php
protected function unmarshall(DOMElement $element) { $outcomeRuleElts = self::getChildElements($element); $outcomeRules = new OutcomeRuleCollection(); for ($i = 0; $i < count($outcomeRuleElts); $i++) { $marshaller = $this->getMarshallerFactory()->createMarshaller($outcomeRuleElt...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "$", "outcomeRuleElts", "=", "self", "::", "getChildElements", "(", "$", "element", ")", ";", "$", "outcomeRules", "=", "new", "OutcomeRuleCollection", "(", ")", ";", "for", ...
Unmarshall a DOMElement object corresponding to a QTI outcomeProcessing element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent An OutcomeProcessing object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "outcomeProcessing", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/OutcomeProcessingMarshaller.php#L64-L77
oat-sa/qti-sdk
src/qtism/runtime/rendering/css/CssScoper.php
CssScoper.render
public function render($file, $id = '') { if (empty($id) === true) { $id = uniqid(); } $this->init($id, $file); $stream = $this->getStream(); while ($stream->eof() === false) { try { $char = $stream->read(1); $this->...
php
public function render($file, $id = '') { if (empty($id) === true) { $id = uniqid(); } $this->init($id, $file); $stream = $this->getStream(); while ($stream->eof() === false) { try { $char = $stream->read(1); $this->...
[ "public", "function", "render", "(", "$", "file", ",", "$", "id", "=", "''", ")", "{", "if", "(", "empty", "(", "$", "id", ")", "===", "true", ")", "{", "$", "id", "=", "uniqid", "(", ")", ";", "}", "$", "this", "->", "init", "(", "$", "id"...
Rescope the content of a given CSS file. @param string $file The path to the file that has to be rescoped. @param string $id The scope identifier. If not given, will be randomly generated. @return string The rescoped content of $file. @throws \qtism\runtime\rendering\RenderingException If something goes wrong while re...
[ "Rescope", "the", "content", "of", "a", "given", "CSS", "file", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/css/CssScoper.php#L409-L474
oat-sa/qti-sdk
src/qtism/runtime/rendering/css/CssScoper.php
CssScoper.init
protected function init($id, $file) { $this->setState(self::RUNNING); $this->setId($id); $this->setBuffer(array()); $this->setOutput(''); $this->setPreviousChar(false); $this->setPreviousSignificantChar(false); if (($data = @file_get_contents($file)) !== fals...
php
protected function init($id, $file) { $this->setState(self::RUNNING); $this->setId($id); $this->setBuffer(array()); $this->setOutput(''); $this->setPreviousChar(false); $this->setPreviousSignificantChar(false); if (($data = @file_get_contents($file)) !== fals...
[ "protected", "function", "init", "(", "$", "id", ",", "$", "file", ")", "{", "$", "this", "->", "setState", "(", "self", "::", "RUNNING", ")", ";", "$", "this", "->", "setId", "(", "$", "id", ")", ";", "$", "this", "->", "setBuffer", "(", "array"...
Initialize the object to be ready for a new rescoping. @param string $id The identifier to be used for scoping. @param string $file The path to the CSS file to be scoped. @throws \qtism\runtime\rendering\RenderingException
[ "Initialize", "the", "object", "to", "be", "ready", "for", "a", "new", "rescoping", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/css/CssScoper.php#L483-L499
oat-sa/qti-sdk
src/qtism/runtime/rendering/css/CssScoper.php
CssScoper.afterCharReading
protected function afterCharReading($char) { $this->setPreviousChar($char); if (self::isWhiteSpace($char) === false) { $this->setPreviousSignificantChar($char); } }
php
protected function afterCharReading($char) { $this->setPreviousChar($char); if (self::isWhiteSpace($char) === false) { $this->setPreviousSignificantChar($char); } }
[ "protected", "function", "afterCharReading", "(", "$", "char", ")", "{", "$", "this", "->", "setPreviousChar", "(", "$", "char", ")", ";", "if", "(", "self", "::", "isWhiteSpace", "(", "$", "char", ")", "===", "false", ")", "{", "$", "this", "->", "s...
Instructions to perform after any character read. @param string $char
[ "Instructions", "to", "perform", "after", "any", "character", "read", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/css/CssScoper.php#L576-L583
oat-sa/qti-sdk
src/qtism/runtime/rendering/css/CssScoper.php
CssScoper.runningState
protected function runningState() { $char = $this->getCurrentChar(); if ($char === self::CHAR_AT) { $this->setState(self::IN_ATRULE); $this->bufferize($char); $this->output($char); } elseif ($char === self::CHAR_STAR && $this->getPreviousChar() === self::...
php
protected function runningState() { $char = $this->getCurrentChar(); if ($char === self::CHAR_AT) { $this->setState(self::IN_ATRULE); $this->bufferize($char); $this->output($char); } elseif ($char === self::CHAR_STAR && $this->getPreviousChar() === self::...
[ "protected", "function", "runningState", "(", ")", "{", "$", "char", "=", "$", "this", "->", "getCurrentChar", "(", ")", ";", "if", "(", "$", "char", "===", "self", "::", "CHAR_AT", ")", "{", "$", "this", "->", "setState", "(", "self", "::", "IN_ATRU...
Instructions to be performed in 'running' state.
[ "Instructions", "to", "be", "performed", "in", "running", "state", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/css/CssScoper.php#L666-L685
oat-sa/qti-sdk
src/qtism/runtime/rendering/css/CssScoper.php
CssScoper.inAtRuleState
protected function inAtRuleState() { $char = $this->getCurrentChar(); if ($char === self::CHAR_DOUBLEQUOTE) { $this->setState(self::IN_ATRULESTRING); } elseif ($char === self::CHAR_TERMINATOR) { $this->setState(self::RUNNING); $this->cleanBuffer(); ...
php
protected function inAtRuleState() { $char = $this->getCurrentChar(); if ($char === self::CHAR_DOUBLEQUOTE) { $this->setState(self::IN_ATRULESTRING); } elseif ($char === self::CHAR_TERMINATOR) { $this->setState(self::RUNNING); $this->cleanBuffer(); ...
[ "protected", "function", "inAtRuleState", "(", ")", "{", "$", "char", "=", "$", "this", "->", "getCurrentChar", "(", ")", ";", "if", "(", "$", "char", "===", "self", "::", "CHAR_DOUBLEQUOTE", ")", "{", "$", "this", "->", "setState", "(", "self", "::", ...
Instructions to be performed in 'atRule' state.
[ "Instructions", "to", "be", "performed", "in", "atRule", "state", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/css/CssScoper.php#L690-L711
oat-sa/qti-sdk
src/qtism/runtime/rendering/css/CssScoper.php
CssScoper.inAtRuleStringState
protected function inAtRuleStringState() { $char = $this->getCurrentChar(); if ($char === self::CHAR_DOUBLEQUOTE && $this->isEscaping() === false) { $this->cleanBuffer(); $this->setState(self::IN_ATRULE); } elseif ($char === self::CHAR_ESCAPE) { $this->bu...
php
protected function inAtRuleStringState() { $char = $this->getCurrentChar(); if ($char === self::CHAR_DOUBLEQUOTE && $this->isEscaping() === false) { $this->cleanBuffer(); $this->setState(self::IN_ATRULE); } elseif ($char === self::CHAR_ESCAPE) { $this->bu...
[ "protected", "function", "inAtRuleStringState", "(", ")", "{", "$", "char", "=", "$", "this", "->", "getCurrentChar", "(", ")", ";", "if", "(", "$", "char", "===", "self", "::", "CHAR_DOUBLEQUOTE", "&&", "$", "this", "->", "isEscaping", "(", ")", "===", ...
Instructions to be performed in 'atRuleString' state.
[ "Instructions", "to", "be", "performed", "in", "atRuleString", "state", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/css/CssScoper.php#L716-L730
oat-sa/qti-sdk
src/qtism/runtime/rendering/css/CssScoper.php
CssScoper.inAtRuleBodyState
protected function inAtRuleBodyState() { $char = $this->getCurrentChar(); if ($char === self::CHAR_CLOSINGBRACE) { $buffer = implode('', $this->getBuffer()); $openingCount = substr_count($buffer, self::CHAR_OPENINGBRACE); $closingCount = substr_count($buffer, sel...
php
protected function inAtRuleBodyState() { $char = $this->getCurrentChar(); if ($char === self::CHAR_CLOSINGBRACE) { $buffer = implode('', $this->getBuffer()); $openingCount = substr_count($buffer, self::CHAR_OPENINGBRACE); $closingCount = substr_count($buffer, sel...
[ "protected", "function", "inAtRuleBodyState", "(", ")", "{", "$", "char", "=", "$", "this", "->", "getCurrentChar", "(", ")", ";", "if", "(", "$", "char", "===", "self", "::", "CHAR_CLOSINGBRACE", ")", "{", "$", "buffer", "=", "implode", "(", "''", ","...
Instructions to be performed in 'atRuleBody' state.
[ "Instructions", "to", "be", "performed", "in", "atRuleBody", "state", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/css/CssScoper.php#L735-L755
oat-sa/qti-sdk
src/qtism/runtime/rendering/css/CssScoper.php
CssScoper.inSelectorState
protected function inSelectorState() { $char = $this->getCurrentChar(); if ($char === self::CHAR_OPENINGBRACE) { $this->updateSelector(); $this->cleanBuffer(); $this->setState(self::IN_CLASSBODY); } else { $this->bufferize($char); } ...
php
protected function inSelectorState() { $char = $this->getCurrentChar(); if ($char === self::CHAR_OPENINGBRACE) { $this->updateSelector(); $this->cleanBuffer(); $this->setState(self::IN_CLASSBODY); } else { $this->bufferize($char); } ...
[ "protected", "function", "inSelectorState", "(", ")", "{", "$", "char", "=", "$", "this", "->", "getCurrentChar", "(", ")", ";", "if", "(", "$", "char", "===", "self", "::", "CHAR_OPENINGBRACE", ")", "{", "$", "this", "->", "updateSelector", "(", ")", ...
Instructions to be performed in 'selector' state.
[ "Instructions", "to", "be", "performed", "in", "selector", "state", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/css/CssScoper.php#L760-L771
oat-sa/qti-sdk
src/qtism/runtime/rendering/css/CssScoper.php
CssScoper.inClassBodyState
protected function inClassBodyState() { $char = $this->getCurrentChar(); if ($char === self::CHAR_DOUBLEQUOTE) { $this->setState(self::IN_CLASSSTRING); } elseif ($char === self::CHAR_CLOSINGBRACE) { $this->setState(self::RUNNING); } elseif ($char === self::CH...
php
protected function inClassBodyState() { $char = $this->getCurrentChar(); if ($char === self::CHAR_DOUBLEQUOTE) { $this->setState(self::IN_CLASSSTRING); } elseif ($char === self::CHAR_CLOSINGBRACE) { $this->setState(self::RUNNING); } elseif ($char === self::CH...
[ "protected", "function", "inClassBodyState", "(", ")", "{", "$", "char", "=", "$", "this", "->", "getCurrentChar", "(", ")", ";", "if", "(", "$", "char", "===", "self", "::", "CHAR_DOUBLEQUOTE", ")", "{", "$", "this", "->", "setState", "(", "self", "::...
Instructions to be performed in 'classBody' state.
[ "Instructions", "to", "be", "performed", "in", "classBody", "state", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/css/CssScoper.php#L776-L789
oat-sa/qti-sdk
src/qtism/runtime/rendering/css/CssScoper.php
CssScoper.inMainCommentState
protected function inMainCommentState() { $char = $this->getCurrentChar(); if ($char === self::CHAR_SLASH && $this->getPreviousChar() === self::CHAR_STAR) { $this->setState(self::RUNNING); } $this->output($char); }
php
protected function inMainCommentState() { $char = $this->getCurrentChar(); if ($char === self::CHAR_SLASH && $this->getPreviousChar() === self::CHAR_STAR) { $this->setState(self::RUNNING); } $this->output($char); }
[ "protected", "function", "inMainCommentState", "(", ")", "{", "$", "char", "=", "$", "this", "->", "getCurrentChar", "(", ")", ";", "if", "(", "$", "char", "===", "self", "::", "CHAR_SLASH", "&&", "$", "this", "->", "getPreviousChar", "(", ")", "===", ...
Instructions to be performed in 'mainComment' state.
[ "Instructions", "to", "be", "performed", "in", "mainComment", "state", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/css/CssScoper.php#L794-L803
oat-sa/qti-sdk
src/qtism/runtime/rendering/css/CssScoper.php
CssScoper.inClassCommentState
protected function inClassCommentState() { $char = $this->getCurrentChar(); if ($char === self::CHAR_SLASH && $this->getPreviousChar() === self::CHAR_STAR) { $this->setState(self::IN_CLASSBODY); } $this->output($char); }
php
protected function inClassCommentState() { $char = $this->getCurrentChar(); if ($char === self::CHAR_SLASH && $this->getPreviousChar() === self::CHAR_STAR) { $this->setState(self::IN_CLASSBODY); } $this->output($char); }
[ "protected", "function", "inClassCommentState", "(", ")", "{", "$", "char", "=", "$", "this", "->", "getCurrentChar", "(", ")", ";", "if", "(", "$", "char", "===", "self", "::", "CHAR_SLASH", "&&", "$", "this", "->", "getPreviousChar", "(", ")", "===", ...
Instructions to be performed in 'classComment' state.
[ "Instructions", "to", "be", "performed", "in", "classComment", "state", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/css/CssScoper.php#L808-L817
oat-sa/qti-sdk
src/qtism/runtime/rendering/css/CssScoper.php
CssScoper.inClassStringState
protected function inClassStringState() { $char = $this->getCurrentChar(); if ($char === self::CHAR_DOUBLEQUOTE && $this->isEscaping() === false) { $this->cleanBuffer(); $this->setState(self::IN_CLASSBODY); } elseif ($char === self::CHAR_ESCAPE) { $this->...
php
protected function inClassStringState() { $char = $this->getCurrentChar(); if ($char === self::CHAR_DOUBLEQUOTE && $this->isEscaping() === false) { $this->cleanBuffer(); $this->setState(self::IN_CLASSBODY); } elseif ($char === self::CHAR_ESCAPE) { $this->...
[ "protected", "function", "inClassStringState", "(", ")", "{", "$", "char", "=", "$", "this", "->", "getCurrentChar", "(", ")", ";", "if", "(", "$", "char", "===", "self", "::", "CHAR_DOUBLEQUOTE", "&&", "$", "this", "->", "isEscaping", "(", ")", "===", ...
Instructions to be performed in 'classString' state.
[ "Instructions", "to", "be", "performed", "in", "classString", "state", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/css/CssScoper.php#L822-L836
oat-sa/qti-sdk
src/qtism/runtime/rendering/css/CssScoper.php
CssScoper.isWhiteSpace
private static function isWhiteSpace($char) { return $char === self::CHAR_SPACE || $char === self::CHAR_CARRIAGERETURN || $char === self::CHAR_NEWLINE || $char === self::CHAR_TAB || $char === self::CHAR_VERTICALTAB; }
php
private static function isWhiteSpace($char) { return $char === self::CHAR_SPACE || $char === self::CHAR_CARRIAGERETURN || $char === self::CHAR_NEWLINE || $char === self::CHAR_TAB || $char === self::CHAR_VERTICALTAB; }
[ "private", "static", "function", "isWhiteSpace", "(", "$", "char", ")", "{", "return", "$", "char", "===", "self", "::", "CHAR_SPACE", "||", "$", "char", "===", "self", "::", "CHAR_CARRIAGERETURN", "||", "$", "char", "===", "self", "::", "CHAR_NEWLINE", "|...
Whether a given $char is considered to be white space. @param string $char @return boolean
[ "Whether", "a", "given", "$char", "is", "considered", "to", "be", "white", "space", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/css/CssScoper.php#L844-L847
oat-sa/qti-sdk
src/qtism/runtime/rendering/css/CssScoper.php
CssScoper.bufferize
protected function bufferize($char) { $buffer = $this->getBuffer(); $buffer[] = $char; $this->setBuffer($buffer); }
php
protected function bufferize($char) { $buffer = $this->getBuffer(); $buffer[] = $char; $this->setBuffer($buffer); }
[ "protected", "function", "bufferize", "(", "$", "char", ")", "{", "$", "buffer", "=", "$", "this", "->", "getBuffer", "(", ")", ";", "$", "buffer", "[", "]", "=", "$", "char", ";", "$", "this", "->", "setBuffer", "(", "$", "buffer", ")", ";", "}"...
Put a given $char in the read buffer. @param string $char
[ "Put", "a", "given", "$char", "in", "the", "read", "buffer", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/css/CssScoper.php#L882-L887
oat-sa/qti-sdk
src/qtism/runtime/rendering/css/CssScoper.php
CssScoper.output
protected function output($char) { $output = $this->getOutput(); $output .= $char; $this->setOutput($output); }
php
protected function output($char) { $output = $this->getOutput(); $output .= $char; $this->setOutput($output); }
[ "protected", "function", "output", "(", "$", "char", ")", "{", "$", "output", "=", "$", "this", "->", "getOutput", "(", ")", ";", "$", "output", ".=", "$", "char", ";", "$", "this", "->", "setOutput", "(", "$", "output", ")", ";", "}" ]
Output a given $char as a scoping result. @param string $char
[ "Output", "a", "given", "$char", "as", "a", "scoping", "result", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/css/CssScoper.php#L914-L919
oat-sa/qti-sdk
src/qtism/runtime/rendering/css/CssScoper.php
CssScoper.updateSelector
protected function updateSelector() { $buffer = implode('', $this->getBuffer()); $qtiClassMap = ($this->isWebComponentFriendly()) ? array_merge(self::$qtiClassMapping, self::$wcFriendlyQtiClassMapping) : self::$qtiClassMapping; if (strpos($buffer, ',') === false) { // Do not re...
php
protected function updateSelector() { $buffer = implode('', $this->getBuffer()); $qtiClassMap = ($this->isWebComponentFriendly()) ? array_merge(self::$qtiClassMapping, self::$wcFriendlyQtiClassMapping) : self::$qtiClassMapping; if (strpos($buffer, ',') === false) { // Do not re...
[ "protected", "function", "updateSelector", "(", ")", "{", "$", "buffer", "=", "implode", "(", "''", ",", "$", "this", "->", "getBuffer", "(", ")", ")", ";", "$", "qtiClassMap", "=", "(", "$", "this", "->", "isWebComponentFriendly", "(", ")", ")", "?", ...
Update selector implementation. Update the currently processed CSS selector by prefixing it with the appropriate id.
[ "Update", "selector", "implementation", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/css/CssScoper.php#L943-L981
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/RoundToMarshaller.php
RoundToMarshaller.marshallChildrenKnown
protected function marshallChildrenKnown(QtiComponent $component, array $elements) { $element = self::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'figures', $component->getFigures()); $this->setDOMElementAttribute($element, 'rounding...
php
protected function marshallChildrenKnown(QtiComponent $component, array $elements) { $element = self::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'figures', $component->getFigures()); $this->setDOMElementAttribute($element, 'rounding...
[ "protected", "function", "marshallChildrenKnown", "(", "QtiComponent", "$", "component", ",", "array", "$", "elements", ")", "{", "$", "element", "=", "self", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "$", "component", "->", "getQtiClassName", ...
Unmarshall a RoundTo object into a QTI roundTo element. @param \qtism\data\QtiComponent $component The RoundTo object to marshall. @param array $elements An array of child DOMEelement objects. @return \DOMElement The marshalled QTI roundTo element.
[ "Unmarshall", "a", "RoundTo", "object", "into", "a", "QTI", "roundTo", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/RoundToMarshaller.php#L48-L60
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/RoundToMarshaller.php
RoundToMarshaller.unmarshallChildrenKnown
protected function unmarshallChildrenKnown(DOMElement $element, QtiComponentCollection $children) { if (($figures = $this->getDOMElementAttributeAs($element, 'figures', 'string')) !== null) { if (!Format::isVariableRef($figures)) { $figures = intval($figures); } ...
php
protected function unmarshallChildrenKnown(DOMElement $element, QtiComponentCollection $children) { if (($figures = $this->getDOMElementAttributeAs($element, 'figures', 'string')) !== null) { if (!Format::isVariableRef($figures)) { $figures = intval($figures); } ...
[ "protected", "function", "unmarshallChildrenKnown", "(", "DOMElement", "$", "element", ",", "QtiComponentCollection", "$", "children", ")", "{", "if", "(", "(", "$", "figures", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'figur...
Unmarshall a QTI roundTo operator element into a RoundTo object. @param \DOMElement $element The roundTo element to unmarshall. @param \qtism\data\QtiComponentCollection $children A collection containing the child Expression objects composing the Operator. @return \qtism\data\QtiComponent A RoundTo object. @throws \qt...
[ "Unmarshall", "a", "QTI", "roundTo", "operator", "element", "into", "a", "RoundTo", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/RoundToMarshaller.php#L70-L89
oat-sa/qti-sdk
src/qtism/runtime/expressions/RandomIntegerProcessor.php
RandomIntegerProcessor.process
public function process() { $expr = $this->getExpression(); $min = $expr->getMin(); $max = $expr->getMax(); $step = $expr->getStep(); $state = $this->getState(); $min = (gettype($min) === 'integer') ? $min : $state[Utils::sanitizeVariableRef($min)]->getValue(); ...
php
public function process() { $expr = $this->getExpression(); $min = $expr->getMin(); $max = $expr->getMax(); $step = $expr->getStep(); $state = $this->getState(); $min = (gettype($min) === 'integer') ? $min : $state[Utils::sanitizeVariableRef($min)]->getValue(); ...
[ "public", "function", "process", "(", ")", "{", "$", "expr", "=", "$", "this", "->", "getExpression", "(", ")", ";", "$", "min", "=", "$", "expr", "->", "getMin", "(", ")", ";", "$", "max", "=", "$", "expr", "->", "getMax", "(", ")", ";", "$", ...
Process the RandomInteger expression. * Throws an ExpressionProcessingException if 'min' is greater than 'max'. * Throws an ExpressionProcessingException if a variable reference is not found in the current state. * Throws an ExpressionProcessingException if a variable reference's value is not an integer. @return inte...
[ "Process", "the", "RandomInteger", "expression", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/RandomIntegerProcessor.php#L53-L84
oat-sa/qti-sdk
src/qtism/data/content/xhtml/tables/Col.php
Col.setSpan
public function setSpan($span) { if (is_int($span) === true && $span > 0) { $this->span = $span; } else { $msg = "The 'span' attribute must be a strictly positive (> 0) integer, '" . gettype($span) . "' given."; throw new InvalidArgumentException($msg); } ...
php
public function setSpan($span) { if (is_int($span) === true && $span > 0) { $this->span = $span; } else { $msg = "The 'span' attribute must be a strictly positive (> 0) integer, '" . gettype($span) . "' given."; throw new InvalidArgumentException($msg); } ...
[ "public", "function", "setSpan", "(", "$", "span", ")", "{", "if", "(", "is_int", "(", "$", "span", ")", "===", "true", "&&", "$", "span", ">", "0", ")", "{", "$", "this", "->", "span", "=", "$", "span", ";", "}", "else", "{", "$", "msg", "="...
Set the span attribute. @param integer $span A strictly positive integer. @throws \InvalidArgumentException If $span is not a positive integer.
[ "Set", "the", "span", "attribute", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/xhtml/tables/Col.php#L67-L75
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/OperatorProcessorFactory.php
OperatorProcessorFactory.createProcessor
public function createProcessor(QtiComponent $expression, OperandsCollection $operands = null) { if ($expression instanceof Operator) { if (is_null($operands) === true) { $operands = new OperandsCollection(); } if ($expression instanceof Cust...
php
public function createProcessor(QtiComponent $expression, OperandsCollection $operands = null) { if ($expression instanceof Operator) { if (is_null($operands) === true) { $operands = new OperandsCollection(); } if ($expression instanceof Cust...
[ "public", "function", "createProcessor", "(", "QtiComponent", "$", "expression", ",", "OperandsCollection", "$", "operands", "=", "null", ")", "{", "if", "(", "$", "expression", "instanceof", "Operator", ")", "{", "if", "(", "is_null", "(", "$", "operands", ...
Create the OperatorProcessor relevant to the given $expression. @param \qtism\data\expressions\Expression $expression The Operator object you want to get the processor. @param \qtism\runtime\expressions\operators\OperandsCollection $operands The operands to be involved in the Operator object. @return \qtism\runtime\ex...
[ "Create", "the", "OperatorProcessor", "relevant", "to", "the", "given", "$expression", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/OperatorProcessorFactory.php#L61-L97
oat-sa/qti-sdk
src/qtism/data/state/OutcomeDeclaration.php
OutcomeDeclaration.setInterpretation
public function setInterpretation($interpretation) { if (gettype($interpretation) === 'string') { $this->interpretation = $interpretation; } else { $msg = "Interpretation must be a string, '" . gettype($interpretation) . "' given."; throw new InvalidArgumentExcept...
php
public function setInterpretation($interpretation) { if (gettype($interpretation) === 'string') { $this->interpretation = $interpretation; } else { $msg = "Interpretation must be a string, '" . gettype($interpretation) . "' given."; throw new InvalidArgumentExcept...
[ "public", "function", "setInterpretation", "(", "$", "interpretation", ")", "{", "if", "(", "gettype", "(", "$", "interpretation", ")", "===", "'string'", ")", "{", "$", "this", "->", "interpretation", "=", "$", "interpretation", ";", "}", "else", "{", "$"...
Set the human interpretation of the outcome variable's value. @param string $interpretation A string. @throws \InvalidArgumentException If $interpretation is not a string.
[ "Set", "the", "human", "interpretation", "of", "the", "outcome", "variable", "s", "value", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/OutcomeDeclaration.php#L209-L217
oat-sa/qti-sdk
src/qtism/data/state/OutcomeDeclaration.php
OutcomeDeclaration.setLongInterpretation
public function setLongInterpretation($longInterpretation) { if (gettype($longInterpretation) === 'string') { $this->longInterpretation = $longInterpretation; } else { $msg = "LongInterpretation must be a string, '" . gettype($longInterpretation) . "' given."; thr...
php
public function setLongInterpretation($longInterpretation) { if (gettype($longInterpretation) === 'string') { $this->longInterpretation = $longInterpretation; } else { $msg = "LongInterpretation must be a string, '" . gettype($longInterpretation) . "' given."; thr...
[ "public", "function", "setLongInterpretation", "(", "$", "longInterpretation", ")", "{", "if", "(", "gettype", "(", "$", "longInterpretation", ")", "===", "'string'", ")", "{", "$", "this", "->", "longInterpretation", "=", "$", "longInterpretation", ";", "}", ...
Set a link (URI) to an extended interpretation of the outcome variable's value. @param string $longInterpretation A string. @throws \InvalidArgumentException If $longInterpretation is not a string.
[ "Set", "a", "link", "(", "URI", ")", "to", "an", "extended", "interpretation", "of", "the", "outcome", "variable", "s", "value", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/OutcomeDeclaration.php#L235-L243
oat-sa/qti-sdk
src/qtism/data/state/OutcomeDeclaration.php
OutcomeDeclaration.setNormalMinimum
public function setNormalMinimum($normalMinimum) { if (is_numeric($normalMinimum) || (is_bool($normalMinimum) && $normalMinimum === false)) { $this->normalMinimum = $normalMinimum; } else { $msg = "NormalMinimum must be a number or (boolean) false, '" . gettype($normalMinimum...
php
public function setNormalMinimum($normalMinimum) { if (is_numeric($normalMinimum) || (is_bool($normalMinimum) && $normalMinimum === false)) { $this->normalMinimum = $normalMinimum; } else { $msg = "NormalMinimum must be a number or (boolean) false, '" . gettype($normalMinimum...
[ "public", "function", "setNormalMinimum", "(", "$", "normalMinimum", ")", "{", "if", "(", "is_numeric", "(", "$", "normalMinimum", ")", "||", "(", "is_bool", "(", "$", "normalMinimum", ")", "&&", "$", "normalMinimum", "===", "false", ")", ")", "{", "$", ...
Set the normal minimum. @param boolean|numeric $normalMinimum A numeric value. @throws \InvalidArgumentException If $normalMinimum is not numeric nor false.
[ "Set", "the", "normal", "minimum", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/OutcomeDeclaration.php#L261-L269
oat-sa/qti-sdk
src/qtism/data/state/OutcomeDeclaration.php
OutcomeDeclaration.setNormalMaximum
public function setNormalMaximum($normalMaximum) { if (is_numeric($normalMaximum) || (is_bool($normalMaximum) && $normalMaximum === false)) { $this->normalMaximum = $normalMaximum; } else { $msg = "NormalMaximum must be a number or (boolean) false, '" . gettype($normalMaximum...
php
public function setNormalMaximum($normalMaximum) { if (is_numeric($normalMaximum) || (is_bool($normalMaximum) && $normalMaximum === false)) { $this->normalMaximum = $normalMaximum; } else { $msg = "NormalMaximum must be a number or (boolean) false, '" . gettype($normalMaximum...
[ "public", "function", "setNormalMaximum", "(", "$", "normalMaximum", ")", "{", "if", "(", "is_numeric", "(", "$", "normalMaximum", ")", "||", "(", "is_bool", "(", "$", "normalMaximum", ")", "&&", "$", "normalMaximum", "===", "false", ")", ")", "{", "$", ...
Set the normal maximum. @param boolean|number $normalMaximum A numeric value. @throws \InvalidArgumentException If $normalMaximum is not a numeric value nor false.
[ "Set", "the", "normal", "maximum", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/OutcomeDeclaration.php#L287-L295
oat-sa/qti-sdk
src/qtism/data/state/OutcomeDeclaration.php
OutcomeDeclaration.setMasteryValue
public function setMasteryValue($masteryValue) { if (is_numeric($masteryValue) || (is_bool($masteryValue) && $masteryValue === false)) { $this->masteryValue = $masteryValue; } else { $msg = "MasteryValue must be a number or (boolean) false, '" . gettype($masteryValue) . "' gi...
php
public function setMasteryValue($masteryValue) { if (is_numeric($masteryValue) || (is_bool($masteryValue) && $masteryValue === false)) { $this->masteryValue = $masteryValue; } else { $msg = "MasteryValue must be a number or (boolean) false, '" . gettype($masteryValue) . "' gi...
[ "public", "function", "setMasteryValue", "(", "$", "masteryValue", ")", "{", "if", "(", "is_numeric", "(", "$", "masteryValue", ")", "||", "(", "is_bool", "(", "$", "masteryValue", ")", "&&", "$", "masteryValue", "===", "false", ")", ")", "{", "$", "this...
Set the mastery value. Set to false if not specified. @param boolean|number $masteryValue A numeric value or false. @throws \InvalidArgumentException If $masteryValue is not numeric nor false.
[ "Set", "the", "mastery", "value", ".", "Set", "to", "false", "if", "not", "specified", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/OutcomeDeclaration.php#L313-L321
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/DeleteProcessor.php
DeleteProcessor.process
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->sameBaseType() === false) { $msg = "The Delete operator only accepts operands with the same baseType."; throw ne...
php
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->sameBaseType() === false) { $msg = "The Delete operator only accepts operands with the same baseType."; throw ne...
[ "public", "function", "process", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "if", "(", "$", "operands", "->", "containsNull", "(", ")", "===", "true", ")", "{", "return", "null", ";", "}", "if", "(", "$", ...
Process the Delete operator. @return \qtism\common\collections\Container A new container derived from the second sub-expression with all instances of the first sub-expression removed, or NULL if either sub-expression is considered to be NULL. @throws \qtism\runtime\expressions\operators\OperatorProcessingException
[ "Process", "the", "Delete", "operator", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/DeleteProcessor.php#L60-L99
oat-sa/qti-sdk
src/qtism/data/content/interactions/GraphicGapMatchInteraction.php
GraphicGapMatchInteraction.setGapImgs
public function setGapImgs(GapImgCollection $gapImgs) { if (count($gapImgs) > 0) { $this->gapImgs = $gapImgs; } else { $msg = "A GraphicGapMatch interaction must composed of at least 1 GapImg object, none given."; throw new InvalidArgumentException($msg); ...
php
public function setGapImgs(GapImgCollection $gapImgs) { if (count($gapImgs) > 0) { $this->gapImgs = $gapImgs; } else { $msg = "A GraphicGapMatch interaction must composed of at least 1 GapImg object, none given."; throw new InvalidArgumentException($msg); ...
[ "public", "function", "setGapImgs", "(", "GapImgCollection", "$", "gapImgs", ")", "{", "if", "(", "count", "(", "$", "gapImgs", ")", ">", "0", ")", "{", "$", "this", "->", "gapImgs", "=", "$", "gapImgs", ";", "}", "else", "{", "$", "msg", "=", "\"A...
Set the list of choices for filling the gaps. @param \qtism\data\content\interactions\GapImgCollection $gapImgs A collection of GapImg objects. @throws \InvalidArgumentException If $gapImgs is empty.
[ "Set", "the", "list", "of", "choices", "for", "filling", "the", "gaps", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/interactions/GraphicGapMatchInteraction.php#L105-L113