repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
oat-sa/qti-sdk
src/qtism/data/content/interactions/ExtendedTextInteraction.php
ExtendedTextInteraction.setFormat
public function setFormat($format) { if (in_array($format, TextFormat::asArray()) === true) { $this->format = $format; } else { $msg = "The 'format' argument must be a value from the TextFormat enumeration, '" . gettype($format) . "' given."; throw new InvalidArgu...
php
public function setFormat($format) { if (in_array($format, TextFormat::asArray()) === true) { $this->format = $format; } else { $msg = "The 'format' argument must be a value from the TextFormat enumeration, '" . gettype($format) . "' given."; throw new InvalidArgu...
[ "public", "function", "setFormat", "(", "$", "format", ")", "{", "if", "(", "in_array", "(", "$", "format", ",", "TextFormat", "::", "asArray", "(", ")", ")", "===", "true", ")", "{", "$", "this", "->", "format", "=", "$", "format", ";", "}", "else...
Set the format of the text entered by the candidate. @param integer $format A value from the TextFormat enumeration. @throws \InvalidArgumentException If $format is not a value from the TextFormat enumeration.
[ "Set", "the", "format", "of", "the", "text", "entered", "by", "the", "candidate", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/interactions/ExtendedTextInteraction.php#L472-L480
oat-sa/qti-sdk
src/qtism/data/rules/ResponseElse.php
ResponseElse.setOutcomeRules
public function setOutcomeRules(ResponseRuleCollection $responseRules) { if (count($responseRules) > 0) { $this->responseRules = $responseRules; } else { $msg = "A ResponseElse object must be bound to at least one ResponseRule object."; throw new InvalidArgumentEx...
php
public function setOutcomeRules(ResponseRuleCollection $responseRules) { if (count($responseRules) > 0) { $this->responseRules = $responseRules; } else { $msg = "A ResponseElse object must be bound to at least one ResponseRule object."; throw new InvalidArgumentEx...
[ "public", "function", "setOutcomeRules", "(", "ResponseRuleCollection", "$", "responseRules", ")", "{", "if", "(", "count", "(", "$", "responseRules", ")", ">", "0", ")", "{", "$", "this", "->", "responseRules", "=", "$", "responseRules", ";", "}", "else", ...
Set the ResponseRule objects to be evaluated. @param \qtism\data\rules\ResponseRuleCollection $responseRules A collection of ResponseRule objects. @throws \InvalidArgumentException If $responseRules is an empty collection.
[ "Set", "the", "ResponseRule", "objects", "to", "be", "evaluated", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/rules/ResponseElse.php#L72-L80
oat-sa/qti-sdk
src/qtism/data/content/interactions/GapMatchInteraction.php
GapMatchInteraction.setGapChoices
public function setGapChoices(GapChoiceCollection $gapChoices) { if (count($gapChoices) > 0) { $this->gapChoices = $gapChoices; } else { $msg = "A GapMatchInteraction object must be composed of at least one GapChoice object, none given."; throw new InvalidArgument...
php
public function setGapChoices(GapChoiceCollection $gapChoices) { if (count($gapChoices) > 0) { $this->gapChoices = $gapChoices; } else { $msg = "A GapMatchInteraction object must be composed of at least one GapChoice object, none given."; throw new InvalidArgument...
[ "public", "function", "setGapChoices", "(", "GapChoiceCollection", "$", "gapChoices", ")", "{", "if", "(", "count", "(", "$", "gapChoices", ")", ">", "0", ")", "{", "$", "this", "->", "gapChoices", "=", "$", "gapChoices", ";", "}", "else", "{", "$", "m...
Set the collection of choices for filling the gaps. @param \qtism\data\content\interactions\GapChoiceCollection $gapChoices A collection of at least one GapChoice object. @throws \InvalidArgumentException If $gapChoices is empty.
[ "Set", "the", "collection", "of", "choices", "for", "filling", "the", "gaps", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/interactions/GapMatchInteraction.php#L139-L147
oat-sa/qti-sdk
src/qtism/runtime/rules/AbstractConditionProcessor.php
AbstractConditionProcessor.pushTrail
public function pushTrail($components) { $trail = &$this->getTrail(); if ($components instanceof QtiComponent) { array_push($trail, $components); } else { $i = count($components); // collection while ($i >= 1) { $i--; ...
php
public function pushTrail($components) { $trail = &$this->getTrail(); if ($components instanceof QtiComponent) { array_push($trail, $components); } else { $i = count($components); // collection while ($i >= 1) { $i--; ...
[ "public", "function", "pushTrail", "(", "$", "components", ")", "{", "$", "trail", "=", "&", "$", "this", "->", "getTrail", "(", ")", ";", "if", "(", "$", "components", "instanceof", "QtiComponent", ")", "{", "array_push", "(", "$", "trail", ",", "$", ...
Push some Rule objects on the trail stack. @param \qtism\data\QtiComponentCollection|\qtism\data\QtiComponent $components A collection of Rule objects.
[ "Push", "some", "Rule", "objects", "on", "the", "trail", "stack", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rules/AbstractConditionProcessor.php#L102-L116
oat-sa/qti-sdk
src/qtism/runtime/rules/AbstractConditionProcessor.php
AbstractConditionProcessor.process
public function process() { $state = $this->getState(); $this->pushTrail($this->getRule()); $className = ucfirst($this->getQtiNature()); $nsClass = 'qtism\\data\\rules\\' . $className . 'Condition'; $ruleGetter = "get${className}Rules"; $statementGetter = "get${class...
php
public function process() { $state = $this->getState(); $this->pushTrail($this->getRule()); $className = ucfirst($this->getQtiNature()); $nsClass = 'qtism\\data\\rules\\' . $className . 'Condition'; $ruleGetter = "get${className}Rules"; $statementGetter = "get${class...
[ "public", "function", "process", "(", ")", "{", "$", "state", "=", "$", "this", "->", "getState", "(", ")", ";", "$", "this", "->", "pushTrail", "(", "$", "this", "->", "getRule", "(", ")", ")", ";", "$", "className", "=", "ucfirst", "(", "$", "t...
Process the OutcomeCondition/ResponseCondition according to the current state. @throws \qtism\runtime\rules\RuleProcessingException
[ "Process", "the", "OutcomeCondition", "/", "ResponseCondition", "according", "to", "the", "current", "state", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rules/AbstractConditionProcessor.php#L155-L212
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/BaseValueMarshaller.php
BaseValueMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'baseType', BaseType::getNameByConstant($component->getBaseType())); self::setDOMElementValue($element, $component-...
php
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'baseType', BaseType::getNameByConstant($component->getBaseType())); self::setDOMElementValue($element, $component-...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "static", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "$", "component", "->", "getQtiClassName", "(", ")", ")", ";", "$", "this", "->...
Marshall a BaseValue object into a DOMElement object. @param \qtism\data\QtiComponent $component A BaseValue object. @return \DOMElement The according DOMElement object.
[ "Marshall", "a", "BaseValue", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/BaseValueMarshaller.php#L45-L53
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/BaseValueMarshaller.php
BaseValueMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { if (($baseType = $this->getDOMElementAttributeAs($element, 'baseType', 'string')) !== null) { $value = $element->nodeValue; $baseTypeCst = BaseType::getConstantByName($baseType); // A little bit of cleanin...
php
protected function unmarshall(DOMElement $element) { if (($baseType = $this->getDOMElementAttributeAs($element, 'baseType', 'string')) !== null) { $value = $element->nodeValue; $baseTypeCst = BaseType::getConstantByName($baseType); // A little bit of cleanin...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "if", "(", "(", "$", "baseType", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'baseType'", ",", "'string'", ")", ")", "!==", "null", ")", ...
Unmarshall a DOMElement object corresponding to a QTI baseValue element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A BaseValue object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "baseValue", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/BaseValueMarshaller.php#L62-L81
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/IsNullProcessor.php
IsNullProcessor.process
public function process() { $operands = $this->getOperands(); $expression = $this->getExpression(); return new QtiBoolean($operands->containsNull()); }
php
public function process() { $operands = $this->getOperands(); $expression = $this->getExpression(); return new QtiBoolean($operands->containsNull()); }
[ "public", "function", "process", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "$", "expression", "=", "$", "this", "->", "getExpression", "(", ")", ";", "return", "new", "QtiBoolean", "(", "$", "operands", "->",...
Process the IsNullExpression object from the QTI Data Model. @return boolean Whether the sub-expression is considered to be NULL. @throws \qtism\runtime\expressions\operators\OperatorProcessingException If something goes wrong.
[ "Process", "the", "IsNullExpression", "object", "from", "the", "QTI", "Data", "Model", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/IsNullProcessor.php#L52-L58
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/VariableDeclarationMarshaller.php
VariableDeclarationMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'identifier', $component->getIdentifier()); $this->setDOMElementAttribute($element, 'cardinality', Cardinality::get...
php
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'identifier', $component->getIdentifier()); $this->setDOMElementAttribute($element, 'cardinality', Cardinality::get...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "static", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "$", "component", "->", "getQtiClassName", "(", ")", ")", ";", "$", "this", "->...
Marshall a VariableDeclaration object into a DOMElement object. @param \qtism\data\QtiComponent $component An OutcomeDeclaration object. @return \DOMElement The according DOMElement object.
[ "Marshall", "a", "VariableDeclaration", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/VariableDeclarationMarshaller.php#L46-L65
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/VariableDeclarationMarshaller.php
VariableDeclarationMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { try { // identifier is a mandatory value for the variableDeclaration element. if (($identifier = $this->getDOMElementAttributeAs($element, 'identifier')) !== null) { // cardinality is a mandatory value too. ...
php
protected function unmarshall(DOMElement $element) { try { // identifier is a mandatory value for the variableDeclaration element. if (($identifier = $this->getDOMElementAttributeAs($element, 'identifier')) !== null) { // cardinality is a mandatory value too. ...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "try", "{", "// identifier is a mandatory value for the variableDeclaration element.", "if", "(", "(", "$", "identifier", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", ...
Unmarshall a DOMElement object corresponding to a QTI variableDeclaration element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A VariableDeclaration object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "variableDeclaration", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/VariableDeclarationMarshaller.php#L74-L112
oat-sa/qti-sdk
src/qtism/data/storage/php/marshalling/PhpQtiDatatypeMarshaller.php
PhpQtiDatatypeMarshaller.marshall
public function marshall() { $toMarshall = $this->getToMarshall(); try { if ($toMarshall instanceof QtiCoords) { $this->marshallCoords(); return; } elseif ($toMarshall instanceof QtiPair) { $this->marshallPair(); ...
php
public function marshall() { $toMarshall = $this->getToMarshall(); try { if ($toMarshall instanceof QtiCoords) { $this->marshallCoords(); return; } elseif ($toMarshall instanceof QtiPair) { $this->marshallPair(); ...
[ "public", "function", "marshall", "(", ")", "{", "$", "toMarshall", "=", "$", "this", "->", "getToMarshall", "(", ")", ";", "try", "{", "if", "(", "$", "toMarshall", "instanceof", "QtiCoords", ")", "{", "$", "this", "->", "marshallCoords", "(", ")", ";...
Marshall a QtiDatatype object into PHP source code. @throws \qtism\data\storage\php\marshalling\PhpMarshallingException If an error occurs during marshalling.
[ "Marshall", "a", "QtiDatatype", "object", "into", "PHP", "source", "code", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/php/marshalling/PhpQtiDatatypeMarshaller.php#L50-L84
oat-sa/qti-sdk
src/qtism/data/storage/php/marshalling/PhpQtiDatatypeMarshaller.php
PhpQtiDatatypeMarshaller.marshallCoords
protected function marshallCoords() { // Retrieve the coordinates array. $coords = $this->getToMarshall(); $array = $coords->getArrayCopy(); // Retrieve the shape. $shape = $coords->getShape(); // -- Actual marshalling. $ctx = $this->getContext(); $a...
php
protected function marshallCoords() { // Retrieve the coordinates array. $coords = $this->getToMarshall(); $array = $coords->getArrayCopy(); // Retrieve the shape. $shape = $coords->getShape(); // -- Actual marshalling. $ctx = $this->getContext(); $a...
[ "protected", "function", "marshallCoords", "(", ")", "{", "// Retrieve the coordinates array.", "$", "coords", "=", "$", "this", "->", "getToMarshall", "(", ")", ";", "$", "array", "=", "$", "coords", "->", "getArrayCopy", "(", ")", ";", "// Retrieve the shape."...
Marshall a Coords QTI datatype object. @throws \qtism\data\storage\php\marshalling\PhpMarshallingException
[ "Marshall", "a", "Coords", "QTI", "datatype", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/php/marshalling/PhpQtiDatatypeMarshaller.php#L101-L140
oat-sa/qti-sdk
src/qtism/data/storage/php/marshalling/PhpQtiDatatypeMarshaller.php
PhpQtiDatatypeMarshaller.marshallPair
protected function marshallPair() { $pair = $this->getToMarshall(); $ctx = $this->getContext(); $access = $ctx->getStreamAccess(); try { $varName = $ctx->generateVariableName($pair); $access->writeVariable($varName); $access->writeEquals($ctx->mus...
php
protected function marshallPair() { $pair = $this->getToMarshall(); $ctx = $this->getContext(); $access = $ctx->getStreamAccess(); try { $varName = $ctx->generateVariableName($pair); $access->writeVariable($varName); $access->writeEquals($ctx->mus...
[ "protected", "function", "marshallPair", "(", ")", "{", "$", "pair", "=", "$", "this", "->", "getToMarshall", "(", ")", ";", "$", "ctx", "=", "$", "this", "->", "getContext", "(", ")", ";", "$", "access", "=", "$", "ctx", "->", "getStreamAccess", "("...
Marshall a Pair QTI datatype object. @throws \qtism\data\storage\php\marshalling\PhpMarshallingException
[ "Marshall", "a", "Pair", "QTI", "datatype", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/php/marshalling/PhpQtiDatatypeMarshaller.php#L147-L166
oat-sa/qti-sdk
src/qtism/data/storage/php/marshalling/PhpQtiDatatypeMarshaller.php
PhpQtiDatatypeMarshaller.marshallDuration
protected function marshallDuration() { $duration = $this->getToMarshall(); $ctx = $this->getContext(); $access = $ctx->getStreamAccess(); try { $varName = $ctx->generateVariableName($duration); $access->writeVariable($varName); $access->writeEqua...
php
protected function marshallDuration() { $duration = $this->getToMarshall(); $ctx = $this->getContext(); $access = $ctx->getStreamAccess(); try { $varName = $ctx->generateVariableName($duration); $access->writeVariable($varName); $access->writeEqua...
[ "protected", "function", "marshallDuration", "(", ")", "{", "$", "duration", "=", "$", "this", "->", "getToMarshall", "(", ")", ";", "$", "ctx", "=", "$", "this", "->", "getContext", "(", ")", ";", "$", "access", "=", "$", "ctx", "->", "getStreamAccess...
Marshall a Duration QTI datatype object. @throws \qtism\data\storage\php\marshalling\PhpMarshallingException
[ "Marshall", "a", "Duration", "QTI", "datatype", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/php/marshalling/PhpQtiDatatypeMarshaller.php#L173-L192
oat-sa/qti-sdk
src/qtism/data/storage/php/marshalling/PhpQtiDatatypeMarshaller.php
PhpQtiDatatypeMarshaller.marshallIdentifier
protected function marshallIdentifier() { $identifier = $this->getToMarshall(); $ctx = $this->getContext(); $access = $ctx->getStreamAccess(); try { $varName = $ctx->generateVariableName($identifier); $access->writeVariable($varName); $access->wri...
php
protected function marshallIdentifier() { $identifier = $this->getToMarshall(); $ctx = $this->getContext(); $access = $ctx->getStreamAccess(); try { $varName = $ctx->generateVariableName($identifier); $access->writeVariable($varName); $access->wri...
[ "protected", "function", "marshallIdentifier", "(", ")", "{", "$", "identifier", "=", "$", "this", "->", "getToMarshall", "(", ")", ";", "$", "ctx", "=", "$", "this", "->", "getContext", "(", ")", ";", "$", "access", "=", "$", "ctx", "->", "getStreamAc...
Marshall an Identifier QTI datatype object. @throws \qtism\data\storage\php\marshalling\PhpMarshallingException
[ "Marshall", "an", "Identifier", "QTI", "datatype", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/php/marshalling/PhpQtiDatatypeMarshaller.php#L199-L218
oat-sa/qti-sdk
src/qtism/data/storage/php/marshalling/PhpQtiDatatypeMarshaller.php
PhpQtiDatatypeMarshaller.marshallPoint
protected function marshallPoint() { $point = $this->getToMarshall(); $ctx = $this->getContext(); $access = $ctx->getStreamAccess(); try { $varName = $ctx->generateVariableName($point); $access->writeVariable($varName); $access->writeEquals($ctx->...
php
protected function marshallPoint() { $point = $this->getToMarshall(); $ctx = $this->getContext(); $access = $ctx->getStreamAccess(); try { $varName = $ctx->generateVariableName($point); $access->writeVariable($varName); $access->writeEquals($ctx->...
[ "protected", "function", "marshallPoint", "(", ")", "{", "$", "point", "=", "$", "this", "->", "getToMarshall", "(", ")", ";", "$", "ctx", "=", "$", "this", "->", "getContext", "(", ")", ";", "$", "access", "=", "$", "ctx", "->", "getStreamAccess", "...
Marshall a Point QTI datatype object. @throws \qtism\data\storage\php\marshalling\PhpMarshallingException
[ "Marshall", "a", "Point", "QTI", "datatype", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/php/marshalling/PhpQtiDatatypeMarshaller.php#L225-L244
oat-sa/qti-sdk
src/qtism/data/rules/Selection.php
Selection.setSelect
public function setSelect($select) { if (is_int($select)) { $this->select = $select; } else { $msg = "Select must be an integer, '" . gettype($select) . "' given."; } }
php
public function setSelect($select) { if (is_int($select)) { $this->select = $select; } else { $msg = "Select must be an integer, '" . gettype($select) . "' given."; } }
[ "public", "function", "setSelect", "(", "$", "select", ")", "{", "if", "(", "is_int", "(", "$", "select", ")", ")", "{", "$", "this", "->", "select", "=", "$", "select", ";", "}", "else", "{", "$", "msg", "=", "\"Select must be an integer, '\"", ".", ...
Set the number of child elements to be selected. @param integer $select An integer. @throws \InvalidArgumentException If $select is not an integer.
[ "Set", "the", "number", "of", "child", "elements", "to", "be", "selected", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/rules/Selection.php#L104-L111
oat-sa/qti-sdk
src/qtism/data/rules/Selection.php
Selection.setWithReplacement
public function setWithReplacement($withReplacement) { if (is_bool($withReplacement)) { $this->withReplacement = $withReplacement; } else { $msg = "WithReplacement must be a boolean, '" . gettype($withReplacement) . "' given."; throw new InvalidArgumentException($...
php
public function setWithReplacement($withReplacement) { if (is_bool($withReplacement)) { $this->withReplacement = $withReplacement; } else { $msg = "WithReplacement must be a boolean, '" . gettype($withReplacement) . "' given."; throw new InvalidArgumentException($...
[ "public", "function", "setWithReplacement", "(", "$", "withReplacement", ")", "{", "if", "(", "is_bool", "(", "$", "withReplacement", ")", ")", "{", "$", "this", "->", "withReplacement", "=", "$", "withReplacement", ";", "}", "else", "{", "$", "msg", "=", ...
Set if the selection of items must be with or without replacements. @param boolean $withReplacement true if it must be with replacements, false otherwise. @throws \InvalidArgumentException If $withReplacement is not a boolean.
[ "Set", "if", "the", "selection", "of", "items", "must", "be", "with", "or", "without", "replacements", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/rules/Selection.php#L129-L137
oat-sa/qti-sdk
src/qtism/data/rules/Selection.php
Selection.setXmlString
public function setXmlString($xmlString) { $this->xmlString = $xmlString; if ($this->externalComponent !== null) { $this->getExternalComponent()->setXmlString($xmlString); } }
php
public function setXmlString($xmlString) { $this->xmlString = $xmlString; if ($this->externalComponent !== null) { $this->getExternalComponent()->setXmlString($xmlString); } }
[ "public", "function", "setXmlString", "(", "$", "xmlString", ")", "{", "$", "this", "->", "xmlString", "=", "$", "xmlString", ";", "if", "(", "$", "this", "->", "externalComponent", "!==", "null", ")", "{", "$", "this", "->", "getExternalComponent", "(", ...
Set the xml string content of the selection itself and its content. @param string $xmlString
[ "Set", "the", "xml", "string", "content", "of", "the", "selection", "itself", "and", "its", "content", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/rules/Selection.php#L144-L151
oat-sa/qti-sdk
src/qtism/runtime/rendering/qtipl/rules/RuleQtiPLRenderer.php
RuleQtiPLRenderer.render
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); return $something->getQtiClassName() . $renderer->writeChildElement($something->getExpression()); }
php
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); return $something->getQtiClassName() . $renderer->writeChildElement($something->getExpression()); }
[ "public", "function", "render", "(", "$", "something", ")", "{", "$", "renderer", "=", "new", "QtiPLRenderer", "(", "$", "this", "->", "getCRO", "(", ")", ")", ";", "return", "$", "something", "->", "getQtiClassName", "(", ")", ".", "$", "renderer", "-...
Render a QtiComponent object into another constitution. @param mixed $something Something to render into another consitution. @return mixed The rendered component into another constitution. @throws \qtism\runtime\rendering\RenderingException If something goes wrong while rendering the component.
[ "Render", "a", "QtiComponent", "object", "into", "another", "constitution", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/qtipl/rules/RuleQtiPLRenderer.php#L46-L50
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/PreConditionMarshaller.php
PreConditionMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $marshaller = $this->getMarshallerFactory()->createMarshaller($component->getExpression()); $element->appendChild($marshaller->marshall($component->getExpr...
php
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $marshaller = $this->getMarshallerFactory()->createMarshaller($component->getExpression()); $element->appendChild($marshaller->marshall($component->getExpr...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "static", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "$", "component", "->", "getQtiClassName", "(", ")", ")", ";", "$", "marshaller",...
Marshall a PreCondition object into a DOMElement object. @param \qtism\data\QtiComponent $component A PreCondition object. @return \DOMElement The according DOMElement object.
[ "Marshall", "a", "PreCondition", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/PreConditionMarshaller.php#L43-L51
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/PreConditionMarshaller.php
PreConditionMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { $expressionElt = self::getFirstChildElement($element); if ($expressionElt !== false) { $marshaller = $this->getMarshallerFactory()->createMarshaller($expressionElt); $object = new PreCondition($marshaller->unmarshall($expr...
php
protected function unmarshall(DOMElement $element) { $expressionElt = self::getFirstChildElement($element); if ($expressionElt !== false) { $marshaller = $this->getMarshallerFactory()->createMarshaller($expressionElt); $object = new PreCondition($marshaller->unmarshall($expr...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "$", "expressionElt", "=", "self", "::", "getFirstChildElement", "(", "$", "element", ")", ";", "if", "(", "$", "expressionElt", "!==", "false", ")", "{", "$", "marshaller", ...
Unmarshall a DOMElement object corresponding to a QTI preCondition element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A Precondition object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException If $element does not contain any QTI expression element.
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "preCondition", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/PreConditionMarshaller.php#L60-L73
oat-sa/qti-sdk
src/qtism/data/processing/ResponseProcessing.php
ResponseProcessing.setTemplate
public function setTemplate($template) { if (Format::isUri($template) === true || (gettype($template) === 'string' && empty($template) === true)) { $this->template = $template; } else { $msg = "The given template '${template}' is not a valid URI."; throw new Inval...
php
public function setTemplate($template) { if (Format::isUri($template) === true || (gettype($template) === 'string' && empty($template) === true)) { $this->template = $template; } else { $msg = "The given template '${template}' is not a valid URI."; throw new Inval...
[ "public", "function", "setTemplate", "(", "$", "template", ")", "{", "if", "(", "Format", "::", "isUri", "(", "$", "template", ")", "===", "true", "||", "(", "gettype", "(", "$", "template", ")", "===", "'string'", "&&", "empty", "(", "$", "template", ...
Set the optional response processing template. An empty string ('') indicates there is no template description. @param string $template The URI of the template. @throws \InvalidArgumentException If $template is not a valid URI nor an empty string.
[ "Set", "the", "optional", "response", "processing", "template", ".", "An", "empty", "string", "(", ")", "indicates", "there", "is", "no", "template", "description", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/processing/ResponseProcessing.php#L145-L153
oat-sa/qti-sdk
src/qtism/data/processing/ResponseProcessing.php
ResponseProcessing.setTemplateLocation
public function setTemplateLocation($templateLocation) { if (Format::isUri($templateLocation) === true || (gettype($templateLocation) === 'string' && empty($templateLocation) === true)) { $this->templateLocation = $templateLocation; } else { $msg = "The given templateLocation...
php
public function setTemplateLocation($templateLocation) { if (Format::isUri($templateLocation) === true || (gettype($templateLocation) === 'string' && empty($templateLocation) === true)) { $this->templateLocation = $templateLocation; } else { $msg = "The given templateLocation...
[ "public", "function", "setTemplateLocation", "(", "$", "templateLocation", ")", "{", "if", "(", "Format", "::", "isUri", "(", "$", "templateLocation", ")", "===", "true", "||", "(", "gettype", "(", "$", "templateLocation", ")", "===", "'string'", "&&", "empt...
Set the optional response processing template location. An empty string ('') indicates there is no template location description. @param string $templateLocaton The URI of the template location. @throws \InvalidArgumentException If $templateLocation is not a valid URI nor an empty string.
[ "Set", "the", "optional", "response", "processing", "template", "location", ".", "An", "empty", "string", "(", ")", "indicates", "there", "is", "no", "template", "location", "description", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/processing/ResponseProcessing.php#L183-L191
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/MatchTableMarshaller.php
MatchTableMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { $matchTableEntryElements = $element->getElementsByTagName('matchTableEntry'); if ($matchTableEntryElements->length > 0) { $matchTableEntries = new MatchTableEntryCollection(); for ($i = 0; $i < $matchTableEntryElements->le...
php
protected function unmarshall(DOMElement $element) { $matchTableEntryElements = $element->getElementsByTagName('matchTableEntry'); if ($matchTableEntryElements->length > 0) { $matchTableEntries = new MatchTableEntryCollection(); for ($i = 0; $i < $matchTableEntryElements->le...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "$", "matchTableEntryElements", "=", "$", "element", "->", "getElementsByTagName", "(", "'matchTableEntry'", ")", ";", "if", "(", "$", "matchTableEntryElements", "->", "length", ">...
Unmarshall a DOMElement object corresponding to a QTI MatchTable element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A MatchTable object. @throws \UnmarshallingException If the $element to unmarshall has no matchTableEntry children.
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "MatchTable", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/MatchTableMarshaller.php#L119-L148
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/ProductProcessor.php
ProductProcessor.process
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } elseif ($operands->anythingButRecord() === false) { $msg = "The Product operator only accepts operands with a single, multiple or ordered cardinalit...
php
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } elseif ($operands->anythingButRecord() === false) { $msg = "The Product operator only accepts operands with a single, multiple or ordered cardinalit...
[ "public", "function", "process", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "if", "(", "$", "operands", "->", "containsNull", "(", ")", "===", "true", ")", "{", "return", "null", ";", "}", "elseif", "(", "...
Process the Product operator. @throws \qtism\runtime\expressions\operators\OperatorProcessingException If invalid operands are given.
[ "Process", "the", "Product", "operator", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/ProductProcessor.php#L53-L80
oat-sa/qti-sdk
src/qtism/runtime/processing/PrintedVariableEngine.php
PrintedVariableEngine.setComponent
public function setComponent(QtiComponent $printedVariable) { if ($printedVariable instanceof PrintedVariable) { parent::setComponent($printedVariable); } else { $msg = "The PrintedVariableEngine class only accepts PrintedVariable objects to be executed."; throw n...
php
public function setComponent(QtiComponent $printedVariable) { if ($printedVariable instanceof PrintedVariable) { parent::setComponent($printedVariable); } else { $msg = "The PrintedVariableEngine class only accepts PrintedVariable objects to be executed."; throw n...
[ "public", "function", "setComponent", "(", "QtiComponent", "$", "printedVariable", ")", "{", "if", "(", "$", "printedVariable", "instanceof", "PrintedVariable", ")", "{", "parent", "::", "setComponent", "(", "$", "printedVariable", ")", ";", "}", "else", "{", ...
Set the PrintedVariable object to be executed by the engine depending on the current context. @param \qtism\data\QtiComponent $printedVariable A PrintedVariable object. @throws \InvalidArgumentException If $printedVariable is not a PrintedVariable object.
[ "Set", "the", "PrintedVariable", "object", "to", "be", "executed", "by", "the", "engine", "depending", "on", "the", "current", "context", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/processing/PrintedVariableEngine.php#L92-L100
oat-sa/qti-sdk
src/qtism/runtime/processing/PrintedVariableEngine.php
PrintedVariableEngine.process
public function process() { $printedVariable = $this->getComponent(); $identifier = $printedVariable->getIdentifier(); $state = $this->getContext(); if ($state[$identifier] === null) { return ''; } $variable = $state->getVariable($identifier); $v...
php
public function process() { $printedVariable = $this->getComponent(); $identifier = $printedVariable->getIdentifier(); $state = $this->getContext(); if ($state[$identifier] === null) { return ''; } $variable = $state->getVariable($identifier); $v...
[ "public", "function", "process", "(", ")", "{", "$", "printedVariable", "=", "$", "this", "->", "getComponent", "(", ")", ";", "$", "identifier", "=", "$", "printedVariable", "->", "getIdentifier", "(", ")", ";", "$", "state", "=", "$", "this", "->", "...
Processes the encapsulated PrintedVariable object into a formatted string, depending on the PrintedVariable object and the current context. * If the value to format is an OrderedContainer, and no 'index' attribue value is given, the whole container is displayed. * If no specific precision is given for a float display,...
[ "Processes", "the", "encapsulated", "PrintedVariable", "object", "into", "a", "formatted", "string", "depending", "on", "the", "PrintedVariable", "object", "and", "the", "current", "context", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/processing/PrintedVariableEngine.php#L112-L171
oat-sa/qti-sdk
src/qtism/runtime/processing/PrintedVariableEngine.php
PrintedVariableEngine.processOrderedMultiple
private function processOrderedMultiple(Variable $variable) { $processedValues = array(); $baseType = $variable->getBaseType(); foreach ($variable->getValue() as $v) { $processedValues[] = $this->processValue($baseType, $v); } return implode($this->getComponent(...
php
private function processOrderedMultiple(Variable $variable) { $processedValues = array(); $baseType = $variable->getBaseType(); foreach ($variable->getValue() as $v) { $processedValues[] = $this->processValue($baseType, $v); } return implode($this->getComponent(...
[ "private", "function", "processOrderedMultiple", "(", "Variable", "$", "variable", ")", "{", "$", "processedValues", "=", "array", "(", ")", ";", "$", "baseType", "=", "$", "variable", "->", "getBaseType", "(", ")", ";", "foreach", "(", "$", "variable", "-...
Processes all values of an ordered/multiple container and merge them into a single string. @param \qtism\runtime\common\Variable $variable The ordered/multiple container Variable to process. @return string All the values delimited by printedVariable->delimiter.
[ "Processes", "all", "values", "of", "an", "ordered", "/", "multiple", "container", "and", "merge", "them", "into", "a", "single", "string", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/processing/PrintedVariableEngine.php#L180-L190
oat-sa/qti-sdk
src/qtism/runtime/processing/PrintedVariableEngine.php
PrintedVariableEngine.processRecord
private function processRecord(Variable $variable) { $processedValues = array(); $baseType = $variable->getBaseType(); $mappingIndicator = $this->getComponent()->getMappingIndicator(); foreach ($variable->getValue() as $k => $v) { $processedValues[] = "${k}${mappingIndic...
php
private function processRecord(Variable $variable) { $processedValues = array(); $baseType = $variable->getBaseType(); $mappingIndicator = $this->getComponent()->getMappingIndicator(); foreach ($variable->getValue() as $k => $v) { $processedValues[] = "${k}${mappingIndic...
[ "private", "function", "processRecord", "(", "Variable", "$", "variable", ")", "{", "$", "processedValues", "=", "array", "(", ")", ";", "$", "baseType", "=", "$", "variable", "->", "getBaseType", "(", ")", ";", "$", "mappingIndicator", "=", "$", "this", ...
Processes all values of a record container and merge them into a single string. @param \qtism\runtime\common\RecordContainer $variable The record to process. @return string All the key/values delimited by printedVariable->delimiter. Indicator between keys and values is defined by printedVariable->mappingIndicator.
[ "Processes", "all", "values", "of", "a", "record", "container", "and", "merge", "them", "into", "a", "single", "string", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/processing/PrintedVariableEngine.php#L199-L210
oat-sa/qti-sdk
src/qtism/runtime/processing/PrintedVariableEngine.php
PrintedVariableEngine.processValue
private function processValue($baseType, $value) { $printedVariable = $this->getComponent(); if ($value === null) { return 'null'; } if ($baseType === BaseType::INT_OR_IDENTIFIER) { $baseType = (is_int($value) === true) ? BaseType::INTEGER : BaseType::STRING...
php
private function processValue($baseType, $value) { $printedVariable = $this->getComponent(); if ($value === null) { return 'null'; } if ($baseType === BaseType::INT_OR_IDENTIFIER) { $baseType = (is_int($value) === true) ? BaseType::INTEGER : BaseType::STRING...
[ "private", "function", "processValue", "(", "$", "baseType", ",", "$", "value", ")", "{", "$", "printedVariable", "=", "$", "this", "->", "getComponent", "(", ")", ";", "if", "(", "$", "value", "===", "null", ")", "{", "return", "'null'", ";", "}", "...
Process a $value depending on its $baseType. @param integer $baseType The baseType of the value to process. @param mixed $value A QTI Runtime compliant value. @throws \qtism\runtime\processing\PrintedVariableProcessingException If the baseType is unknown. @return string
[ "Process", "a", "$value", "depending", "on", "its", "$baseType", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/processing/PrintedVariableEngine.php#L220-L265
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/TablePartMarshaller.php
TablePartMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = self::getDOMCradle()->createElement($component->getQtiClassName()); foreach ($component->getContent() as $tr) { $marshaller = $this->getMarshallerFactory()->createMarshaller($tr); $element->appendChild($marsha...
php
protected function marshall(QtiComponent $component) { $element = self::getDOMCradle()->createElement($component->getQtiClassName()); foreach ($component->getContent() as $tr) { $marshaller = $this->getMarshallerFactory()->createMarshaller($tr); $element->appendChild($marsha...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "self", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "$", "component", "->", "getQtiClassName", "(", ")", ")", ";", "foreach", "(", "$...
Marshall a Tbody/Thead/Tfoot object into a DOMElement object. @param \qtism\data\QtiComponent $component A TBody/Thead/Tfoot object. @return \DOMElement The according DOMElement object. @throws \qtism\data\storage\xml\marshalling\MarshallingException
[ "Marshall", "a", "Tbody", "/", "Thead", "/", "Tfoot", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/TablePartMarshaller.php#L44-L56
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/TablePartMarshaller.php
TablePartMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { $trs = new TrCollection(); foreach ($this->getChildElementsByTagName($element, 'tr') as $trElt) { $marshaller = $this->getMarshallerFactory()->createMarshaller($trElt); $trs[] = $marshaller->unmarshall($trElt); } ...
php
protected function unmarshall(DOMElement $element) { $trs = new TrCollection(); foreach ($this->getChildElementsByTagName($element, 'tr') as $trElt) { $marshaller = $this->getMarshallerFactory()->createMarshaller($trElt); $trs[] = $marshaller->unmarshall($trElt); } ...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "$", "trs", "=", "new", "TrCollection", "(", ")", ";", "foreach", "(", "$", "this", "->", "getChildElementsByTagName", "(", "$", "element", ",", "'tr'", ")", "as", "$", "...
Unmarshall a DOMElement object corresponding to an XHTML tbody/thead/tfoot element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A Tbody/Thead/Tfoot object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "an", "XHTML", "tbody", "/", "thead", "/", "tfoot", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/TablePartMarshaller.php#L65-L85
oat-sa/qti-sdk
src/qtism/data/expressions/OutcomeMaximum.php
OutcomeMaximum.setOutcomeIdentifier
public function setOutcomeIdentifier($outcomeIdentifier) { if (Format::isIdentifier($outcomeIdentifier)) { $this->outcomeIdentifier = $outcomeIdentifier; } else { $msg = "'${outcomeIdentifier}' is not a valid QTI Identifier."; throw new InvalidArgumentException($m...
php
public function setOutcomeIdentifier($outcomeIdentifier) { if (Format::isIdentifier($outcomeIdentifier)) { $this->outcomeIdentifier = $outcomeIdentifier; } else { $msg = "'${outcomeIdentifier}' is not a valid QTI Identifier."; throw new InvalidArgumentException($m...
[ "public", "function", "setOutcomeIdentifier", "(", "$", "outcomeIdentifier", ")", "{", "if", "(", "Format", "::", "isIdentifier", "(", "$", "outcomeIdentifier", ")", ")", "{", "$", "this", "->", "outcomeIdentifier", "=", "$", "outcomeIdentifier", ";", "}", "el...
Set the outcome identifier. @param string $outcomeIdentifier A QTI Identifier. @throws \InvalidArgumentException If $outcomeIdentifier is not a valid QTI Identifier.
[ "Set", "the", "outcome", "identifier", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/expressions/OutcomeMaximum.php#L83-L91
oat-sa/qti-sdk
src/qtism/data/expressions/OutcomeMaximum.php
OutcomeMaximum.setWeightIdentifier
public function setWeightIdentifier($weightIdentifier) { if (Format::isIdentifier($weightIdentifier) || $weightIdentifier == '') { $this->weightIdentifier = $weightIdentifier; } else { $msg = "'${weightIdentifier}' is not a valid QTI Identifier."; throw new Invali...
php
public function setWeightIdentifier($weightIdentifier) { if (Format::isIdentifier($weightIdentifier) || $weightIdentifier == '') { $this->weightIdentifier = $weightIdentifier; } else { $msg = "'${weightIdentifier}' is not a valid QTI Identifier."; throw new Invali...
[ "public", "function", "setWeightIdentifier", "(", "$", "weightIdentifier", ")", "{", "if", "(", "Format", "::", "isIdentifier", "(", "$", "weightIdentifier", ")", "||", "$", "weightIdentifier", "==", "''", ")", "{", "$", "this", "->", "weightIdentifier", "=", ...
Set the weight identifier. Can be '' (empty string) if no weight specified. @param string $weightIdentifier A QTI Identifier or '' (empty string) if not specified. @throws \InvalidArgumentException If $weightIdentifier is not a valid QTI Identifier nor '' (empty string).
[ "Set", "the", "weight", "identifier", ".", "Can", "be", "(", "empty", "string", ")", "if", "no", "weight", "specified", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/expressions/OutcomeMaximum.php#L109-L117
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/RubricBlockMarshaller.php
RubricBlockMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = $this->createElement($component); $arrayViews = array(); foreach ($component->getViews() as $view) { $key = array_search($view, View::asArray()); // replace '_' by the space char. $arrayVie...
php
protected function marshall(QtiComponent $component) { $element = $this->createElement($component); $arrayViews = array(); foreach ($component->getViews() as $view) { $key = array_search($view, View::asArray()); // replace '_' by the space char. $arrayVie...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "$", "this", "->", "createElement", "(", "$", "component", ")", ";", "$", "arrayViews", "=", "array", "(", ")", ";", "foreach", "(", "$", "componen...
Marshall a RubricBlock object into a DOMElement object. @param \qtism\data\QtiComponent $component A RubricBlock object. @return \DOMElement The according DOMElement object.
[ "Marshall", "a", "RubricBlock", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/RubricBlockMarshaller.php#L51-L87
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/RubricBlockMarshaller.php
RubricBlockMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { // First we retrieve the mandatory views. if (($value = $this->getDOMElementAttributeAs($element, 'view', 'string')) !== null) { $viewsArray = explode("\x20", $value); $viewsCollection = new ViewCollection(); $r...
php
protected function unmarshall(DOMElement $element) { // First we retrieve the mandatory views. if (($value = $this->getDOMElementAttributeAs($element, 'view', 'string')) !== null) { $viewsArray = explode("\x20", $value); $viewsCollection = new ViewCollection(); $r...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "// First we retrieve the mandatory views.", "if", "(", "(", "$", "value", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'view'", ",", "'string'", ...
Unmarshall a DOMElement object corresponding to a QTI rubrickBlock element. @param \DOMElement $element A DOMElement object. @return \qtism\data\content\RubricBlock A RubricBlock object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException If the mandatory attribute 'href' is missing from $element.
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "rubrickBlock", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/RubricBlockMarshaller.php#L96-L153
oat-sa/qti-sdk
src/qtism/data/storage/php/marshalling/PhpMarshallingContext.php
PhpMarshallingContext.pushOnVariableStack
public function pushOnVariableStack($values) { if (is_array($values) === false) { $values = array($values); } foreach ($values as $value) { if (is_string($value) === false) { $msg = "The pushOnVariableStack method only accepts non-empty string values....
php
public function pushOnVariableStack($values) { if (is_array($values) === false) { $values = array($values); } foreach ($values as $value) { if (is_string($value) === false) { $msg = "The pushOnVariableStack method only accepts non-empty string values....
[ "public", "function", "pushOnVariableStack", "(", "$", "values", ")", "{", "if", "(", "is_array", "(", "$", "values", ")", "===", "false", ")", "{", "$", "values", "=", "array", "(", "$", "values", ")", ";", "}", "foreach", "(", "$", "values", "as", ...
Push some value(s) on the variable names stack. @param string|array $values A string or an array of strings to be pushed on the variable names stack. @throws \InvalidArgumentException If $value or an item of $value is not a non-empty string.
[ "Push", "some", "value", "(", "s", ")", "on", "the", "variable", "names", "stack", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/php/marshalling/PhpMarshallingContext.php#L201-L215
oat-sa/qti-sdk
src/qtism/data/storage/php/marshalling/PhpMarshallingContext.php
PhpMarshallingContext.popFromVariableStack
public function popFromVariableStack($quantity = 1) { $quantity = intval($quantity); if ($quantity < 1) { $msg = "The 'quantity' argument must be >= 1, '${quantity}' given."; throw new InvalidArgumentException($msg); } $stack = $this->getVariableStack(); ...
php
public function popFromVariableStack($quantity = 1) { $quantity = intval($quantity); if ($quantity < 1) { $msg = "The 'quantity' argument must be >= 1, '${quantity}' given."; throw new InvalidArgumentException($msg); } $stack = $this->getVariableStack(); ...
[ "public", "function", "popFromVariableStack", "(", "$", "quantity", "=", "1", ")", "{", "$", "quantity", "=", "intval", "(", "$", "quantity", ")", ";", "if", "(", "$", "quantity", "<", "1", ")", "{", "$", "msg", "=", "\"The 'quantity' argument must be >= 1...
Pop a given $quantity of values from the variable names stack. @param integer $quantity @return array An array of strings. @throws \RuntimeException If the the quantity of elements in the stack before popping is less than $quantity. @throws \InvalidArgumentException If $quantity < 1.
[ "Pop", "a", "given", "$quantity", "of", "values", "from", "the", "variable", "names", "stack", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/php/marshalling/PhpMarshallingContext.php#L225-L247
oat-sa/qti-sdk
src/qtism/data/storage/php/marshalling/PhpMarshallingContext.php
PhpMarshallingContext.generateVariableName
public function generateVariableName($value) { $occurence = 0; if (is_object($value) === true) { $counter = $this->getObjectCount(); $className = get_class($value); if (isset($counter[$className]) === false) { $occurence = 0; $cou...
php
public function generateVariableName($value) { $occurence = 0; if (is_object($value) === true) { $counter = $this->getObjectCount(); $className = get_class($value); if (isset($counter[$className]) === false) { $occurence = 0; $cou...
[ "public", "function", "generateVariableName", "(", "$", "value", ")", "{", "$", "occurence", "=", "0", ";", "if", "(", "is_object", "(", "$", "value", ")", "===", "true", ")", "{", "$", "counter", "=", "$", "this", "->", "getObjectCount", "(", ")", "...
Generates a suitable variable name to be used for a given value. @param mixed $value A value. @return string A variable name without the leading dollar sign ('$').
[ "Generates", "a", "suitable", "variable", "name", "to", "be", "used", "for", "a", "given", "value", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/php/marshalling/PhpMarshallingContext.php#L255-L287
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/ShufflingGroupMarshaller.php
ShufflingGroupMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'identifiers', implode("\x20", $component->getIdentifiers()->getArrayCopy())); $fixedIdentifiers = $compone...
php
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'identifiers', implode("\x20", $component->getIdentifiers()->getArrayCopy())); $fixedIdentifiers = $compone...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "static", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "$", "component", "->", "getQtiClassName", "(", ")", ")", ";", "$", "this", "->...
Marshall a ShufflingGroup object into a DOMElement object. @param \qtism\data\QtiComponent $component A ShufflingGroup object. @return \DOMElement The according DOMElement object.
[ "Marshall", "a", "ShufflingGroup", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/ShufflingGroupMarshaller.php#L44-L55
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/ShufflingGroupMarshaller.php
ShufflingGroupMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { if (($identifiers = $this->getDOMElementAttributeAs($element, 'identifiers')) !== null) { $identifiers = explode("\x20", $identifiers); $component = new ShufflingGroup(new IdentifierCollection($identifiers)); ...
php
protected function unmarshall(DOMElement $element) { if (($identifiers = $this->getDOMElementAttributeAs($element, 'identifiers')) !== null) { $identifiers = explode("\x20", $identifiers); $component = new ShufflingGroup(new IdentifierCollection($identifiers)); ...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "if", "(", "(", "$", "identifiers", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'identifiers'", ")", ")", "!==", "null", ")", "{", "$", ...
Unmarshall a DOMElement object corresponding to a QTI ShufflingGroup element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A ShufflingGroup object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "ShufflingGroup", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/ShufflingGroupMarshaller.php#L64-L80
oat-sa/qti-sdk
src/qtism/runtime/common/MultipleContainer.php
MultipleContainer.createFromDataModel
public static function createFromDataModel(ValueCollection $valueCollection, $baseType = BaseType::INTEGER) { $container = new static($baseType); foreach ($valueCollection as $value) { $container[] = RuntimeUtils::valueToRuntime($value->getValue(), $value->getBaseType()); } ...
php
public static function createFromDataModel(ValueCollection $valueCollection, $baseType = BaseType::INTEGER) { $container = new static($baseType); foreach ($valueCollection as $value) { $container[] = RuntimeUtils::valueToRuntime($value->getValue(), $value->getBaseType()); } ...
[ "public", "static", "function", "createFromDataModel", "(", "ValueCollection", "$", "valueCollection", ",", "$", "baseType", "=", "BaseType", "::", "INTEGER", ")", "{", "$", "container", "=", "new", "static", "(", "$", "baseType", ")", ";", "foreach", "(", "...
Create a MultipleContainer object from a Data Model ValueCollection object. @param \qtism\data\state\ValueCollection $valueCollection A collection of qtism\data\state\Value objects. @param integer $baseType A value from the BaseType enumeration. @return \qtism\runtime\common\MultipleContainer A MultipleContainer objec...
[ "Create", "a", "MultipleContainer", "object", "from", "a", "Data", "Model", "ValueCollection", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/common/MultipleContainer.php#L113-L121
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/VariableMappingMarshaller.php
VariableMappingMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'sourceIdentifier', $component->getSource()); $this->setDOMElementAttribute($element, 'targetIdentifier', $componen...
php
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'sourceIdentifier', $component->getSource()); $this->setDOMElementAttribute($element, 'targetIdentifier', $componen...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "static", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "$", "component", "->", "getQtiClassName", "(", ")", ")", ";", "$", "this", "->...
Marshall a VariableMapping object into a DOMElement object. @param \qtism\data\QtiComponent $component A VariableMapping object. @return \DOMElement The according DOMElement object.
[ "Marshall", "a", "VariableMapping", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/VariableMappingMarshaller.php#L44-L52
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/VariableMappingMarshaller.php
VariableMappingMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { if (($source = $this->getDOMElementAttributeAs($element, 'sourceIdentifier', 'string')) !== null) { if (($target = $this->getDOMElementAttributeAs($element, 'targetIdentifier', 'string')) !== null) { try { $...
php
protected function unmarshall(DOMElement $element) { if (($source = $this->getDOMElementAttributeAs($element, 'sourceIdentifier', 'string')) !== null) { if (($target = $this->getDOMElementAttributeAs($element, 'targetIdentifier', 'string')) !== null) { try { $...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "if", "(", "(", "$", "source", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'sourceIdentifier'", ",", "'string'", ")", ")", "!==", "null", ...
Unmarshall a DOMElement object corresponding to a QTI variableMapping element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A VariableMapping object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException If the mandatory attributes 'sourceIdentifier' or 'targetIdentifi...
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "variableMapping", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/VariableMappingMarshaller.php#L61-L81
oat-sa/qti-sdk
src/qtism/data/storage/php/marshalling/PhpMarshaller.php
PhpMarshaller.setToMarshall
public function setToMarshall($toMarshall) { if ($this->isMarshallable($toMarshall) === false) { $msg = "The value to marshall cannot be managed by this implementation."; throw new InvalidArgumentException($msg); } $this->toMarshall = $toMarshall; }
php
public function setToMarshall($toMarshall) { if ($this->isMarshallable($toMarshall) === false) { $msg = "The value to marshall cannot be managed by this implementation."; throw new InvalidArgumentException($msg); } $this->toMarshall = $toMarshall; }
[ "public", "function", "setToMarshall", "(", "$", "toMarshall", ")", "{", "if", "(", "$", "this", "->", "isMarshallable", "(", "$", "toMarshall", ")", "===", "false", ")", "{", "$", "msg", "=", "\"The value to marshall cannot be managed by this implementation.\"", ...
Set the value that has to be marshalled. @param mixed $toMarshall The value to be marshalled. @throws \InvalidArgumentException If the value $toMarshall cannot be managed by this implementation.
[ "Set", "the", "value", "that", "has", "to", "be", "marshalled", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/php/marshalling/PhpMarshaller.php#L68-L76
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/RubricBlockRefMarshaller.php
RubricBlockRefMarshaller.marshall
public function marshall(QtiComponent $component) { $element = self::getDOMCradle()->createElement('rubricBlockRef'); $this->setDOMElementAttribute($element, 'identifier', $component->getIdentifier()); $this->setDOMElementAttribute($element, 'href', $component->getHref()); return $e...
php
public function marshall(QtiComponent $component) { $element = self::getDOMCradle()->createElement('rubricBlockRef'); $this->setDOMElementAttribute($element, 'identifier', $component->getIdentifier()); $this->setDOMElementAttribute($element, 'href', $component->getHref()); return $e...
[ "public", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "self", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "'rubricBlockRef'", ")", ";", "$", "this", "->", "setDOMElementAttribute", "(", "$", "...
Marshall a RubricBlockRef object to its XML counterpart. @param \qtism\data\QtiComponent $component @return \DOMElement
[ "Marshall", "a", "RubricBlockRef", "object", "to", "its", "XML", "counterpart", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/RubricBlockRefMarshaller.php#L43-L50
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/RubricBlockRefMarshaller.php
RubricBlockRefMarshaller.unmarshall
public function unmarshall(DOMElement $element) { if (($identifier = $this->getDOMElementAttributeAs($element, 'identifier')) !== null) { if (($href = $this->getDOMElementAttributeAs($element, 'href')) !== null) { return new RubricBlockRef($identifier, $href); } else...
php
public function unmarshall(DOMElement $element) { if (($identifier = $this->getDOMElementAttributeAs($element, 'identifier')) !== null) { if (($href = $this->getDOMElementAttributeAs($element, 'href')) !== null) { return new RubricBlockRef($identifier, $href); } else...
[ "public", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "if", "(", "(", "$", "identifier", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'identifier'", ")", ")", "!==", "null", ")", "{", "if", "("...
Unmarshall a DOMElement to its RubricBlockRef data model representation. @param \DOMElement $element @return \qtism\data\QtiComponent A RubricBlockRef object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException If the 'identifier' or 'href' attribute is missing from the XML definition.
[ "Unmarshall", "a", "DOMElement", "to", "its", "RubricBlockRef", "data", "model", "representation", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/RubricBlockRefMarshaller.php#L59-L73
oat-sa/qti-sdk
src/qtism/common/beans/Bean.php
Bean.getGetter
public function getGetter($property) { if (is_string($property) === true) { $propertyName = $property; } elseif ($property instanceof BeanProperty) { $propertyName = $property->getName(); } else { $msg = "The 'property' argument must be a string or a BeanP...
php
public function getGetter($property) { if (is_string($property) === true) { $propertyName = $property; } elseif ($property instanceof BeanProperty) { $propertyName = $property->getName(); } else { $msg = "The 'property' argument must be a string or a BeanP...
[ "public", "function", "getGetter", "(", "$", "property", ")", "{", "if", "(", "is_string", "(", "$", "property", ")", "===", "true", ")", "{", "$", "propertyName", "=", "$", "property", ";", "}", "elseif", "(", "$", "property", "instanceof", "BeanPropert...
Get the getter related to the property with name $propertyName. @param string|qtism\common\beans\BeanProperty $property The name of the property/the BeanProperty object the getter is related to. @return \qtism\common\beans\BeanMethod A BeanMethod object. @throws \qtism\common\beans\BeanException If no such valid bean ...
[ "Get", "the", "getter", "related", "to", "the", "property", "with", "name", "$propertyName", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/beans/Bean.php#L111-L133
oat-sa/qti-sdk
src/qtism/common/beans/Bean.php
Bean.hasGetter
public function hasGetter($property) { if (is_string($property) === true) { $propertyName = $property; } elseif ($property instanceof BeanProperty) { $propertyName = $property->getName(); } else { $msg = "The 'property' argument must be a string or a BeanP...
php
public function hasGetter($property) { if (is_string($property) === true) { $propertyName = $property; } elseif ($property instanceof BeanProperty) { $propertyName = $property->getName(); } else { $msg = "The 'property' argument must be a string or a BeanP...
[ "public", "function", "hasGetter", "(", "$", "property", ")", "{", "if", "(", "is_string", "(", "$", "property", ")", "===", "true", ")", "{", "$", "propertyName", "=", "$", "property", ";", "}", "elseif", "(", "$", "property", "instanceof", "BeanPropert...
Whether the bean has a valid getter for a property with name $propertyName. A getter is considered to be valid if: * Its name is 'get' + ucfirst($propertyName). * Its visibility is public. * A valid bean property exists for $propertyName. @param string|qtism\common\beans\BeanProperty $property The name of the propert...
[ "Whether", "the", "bean", "has", "a", "valid", "getter", "for", "a", "property", "with", "name", "$propertyName", ".", "A", "getter", "is", "considered", "to", "be", "valid", "if", ":" ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/beans/Bean.php#L147-L171
oat-sa/qti-sdk
src/qtism/common/beans/Bean.php
Bean.getGetters
public function getGetters($excludeConstructor = false) { $methods = new BeanMethodCollection(); foreach ($this->getProperties() as $prop) { if (($getterName = $this->hasGetter($prop->getName())) !== false) { if ($excludeConstructor === false || $this->hasConstructorPar...
php
public function getGetters($excludeConstructor = false) { $methods = new BeanMethodCollection(); foreach ($this->getProperties() as $prop) { if (($getterName = $this->hasGetter($prop->getName())) !== false) { if ($excludeConstructor === false || $this->hasConstructorPar...
[ "public", "function", "getGetters", "(", "$", "excludeConstructor", "=", "false", ")", "{", "$", "methods", "=", "new", "BeanMethodCollection", "(", ")", ";", "foreach", "(", "$", "this", "->", "getProperties", "(", ")", "as", "$", "prop", ")", "{", "if"...
Get the valid bean getters of the bean. @return \qtism\common\beans\BeanMethodCollection A collection of BeanMethod objects.
[ "Get", "the", "valid", "bean", "getters", "of", "the", "bean", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/beans/Bean.php#L178-L192
oat-sa/qti-sdk
src/qtism/common/beans/Bean.php
Bean.getSetter
public function getSetter($property) { if (is_string($property) === true) { $propertyName = $property; } elseif ($property instanceof BeanProperty) { $propertyName = $property->getName(); } else { $msg = "The 'property' argument must be a string or a BeanP...
php
public function getSetter($property) { if (is_string($property) === true) { $propertyName = $property; } elseif ($property instanceof BeanProperty) { $propertyName = $property->getName(); } else { $msg = "The 'property' argument must be a string or a BeanP...
[ "public", "function", "getSetter", "(", "$", "property", ")", "{", "if", "(", "is_string", "(", "$", "property", ")", "===", "true", ")", "{", "$", "propertyName", "=", "$", "property", ";", "}", "elseif", "(", "$", "property", "instanceof", "BeanPropert...
Get the setter related to the property with name $propertyName. @param string|BeanProperty $property The name of the property/The BeanProperty object the setter is related to. @return \qtism\common\beans\BeanMethod A BeanMethod object. @throws \qtism\common\beans\BeanException If no such valid bean property or setter ...
[ "Get", "the", "setter", "related", "to", "the", "property", "with", "name", "$propertyName", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/beans/Bean.php#L202-L224
oat-sa/qti-sdk
src/qtism/common/beans/Bean.php
Bean.hasSetter
public function hasSetter($property) { if (is_string($property) === true) { $propertyName = $property; } elseif ($property instanceof BeanProperty) { $propertyName = $property->getName(); } else { $msg = "The 'property' argument must be a string or a BeanP...
php
public function hasSetter($property) { if (is_string($property) === true) { $propertyName = $property; } elseif ($property instanceof BeanProperty) { $propertyName = $property->getName(); } else { $msg = "The 'property' argument must be a string or a BeanP...
[ "public", "function", "hasSetter", "(", "$", "property", ")", "{", "if", "(", "is_string", "(", "$", "property", ")", "===", "true", ")", "{", "$", "propertyName", "=", "$", "property", ";", "}", "elseif", "(", "$", "property", "instanceof", "BeanPropert...
Whether the bean has a valid setter for a property with name $propertyName. A setter is considered to be valid if: * Its name is 'set' + ucfirst($propertyName). * Its visibility is public. * A valid bean property exists for $propertyName. @param string|\qtism\common\beans\BeanProperty $property The name of the proper...
[ "Whether", "the", "bean", "has", "a", "valid", "setter", "for", "a", "property", "with", "name", "$propertyName", ".", "A", "setter", "is", "considered", "to", "be", "valid", "if", ":" ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/beans/Bean.php#L237-L256
oat-sa/qti-sdk
src/qtism/common/beans/Bean.php
Bean.getSetters
public function getSetters($excludeConstructor = false) { $methods = new BeanMethodCollection(); foreach ($this->getProperties() as $prop) { if ($this->hasSetter($prop->getName()) === true) { if ($excludeConstructor === false || $this->hasConstructorParameter($prop->get...
php
public function getSetters($excludeConstructor = false) { $methods = new BeanMethodCollection(); foreach ($this->getProperties() as $prop) { if ($this->hasSetter($prop->getName()) === true) { if ($excludeConstructor === false || $this->hasConstructorParameter($prop->get...
[ "public", "function", "getSetters", "(", "$", "excludeConstructor", "=", "false", ")", "{", "$", "methods", "=", "new", "BeanMethodCollection", "(", ")", ";", "foreach", "(", "$", "this", "->", "getProperties", "(", ")", "as", "$", "prop", ")", "{", "if"...
Get the valid setters of this bean. @return \qtism\common\beans\BeanMethodCollection A collection of BeanMethod objects.
[ "Get", "the", "valid", "setters", "of", "this", "bean", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/beans/Bean.php#L263-L277
oat-sa/qti-sdk
src/qtism/common/beans/Bean.php
Bean.getProperty
public function getProperty($propertyName) { $className = $className = $this->getClass()->getName(); if ($this->hasProperty($propertyName) === true) { try { return new BeanProperty($className, $propertyName); } catch (BeanException $e) { $msg...
php
public function getProperty($propertyName) { $className = $className = $this->getClass()->getName(); if ($this->hasProperty($propertyName) === true) { try { return new BeanProperty($className, $propertyName); } catch (BeanException $e) { $msg...
[ "public", "function", "getProperty", "(", "$", "propertyName", ")", "{", "$", "className", "=", "$", "className", "=", "$", "this", "->", "getClass", "(", ")", "->", "getName", "(", ")", ";", "if", "(", "$", "this", "->", "hasProperty", "(", "$", "pr...
Get a bean property with name $propertyName. @param string $propertyName The name of the bean property. @return \qtism\common\beans\BeanProperty A BeanProperty object.
[ "Get", "a", "bean", "property", "with", "name", "$propertyName", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/beans/Bean.php#L300-L316
oat-sa/qti-sdk
src/qtism/common/beans/Bean.php
Bean.getProperties
public function getProperties() { $properties = new BeanPropertyCollection(); // Properties already taken into account accross the hierarchy. $registeredProperties = array(); $target = $this->getClass(); while ($target) { foreach ($target->getProperties() as $p...
php
public function getProperties() { $properties = new BeanPropertyCollection(); // Properties already taken into account accross the hierarchy. $registeredProperties = array(); $target = $this->getClass(); while ($target) { foreach ($target->getProperties() as $p...
[ "public", "function", "getProperties", "(", ")", "{", "$", "properties", "=", "new", "BeanPropertyCollection", "(", ")", ";", "// Properties already taken into account accross the hierarchy.", "$", "registeredProperties", "=", "array", "(", ")", ";", "$", "target", "=...
Get the bean properties. Only valid annotated bean properties will be returned. @return \qtism\common\beans\BeanPropertyCollection A collection of BeanProperty objects ordered by apparition in source code.
[ "Get", "the", "bean", "properties", ".", "Only", "valid", "annotated", "bean", "properties", "will", "be", "returned", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/beans/Bean.php#L323-L347
oat-sa/qti-sdk
src/qtism/common/beans/Bean.php
Bean.getConstructorGetters
public function getConstructorGetters() { $getters = new BeanMethodCollection(); foreach ($this->getConstructorParameters() as $param) { $getters[] = $this->getGetter($param->getName()); } return $getters; }
php
public function getConstructorGetters() { $getters = new BeanMethodCollection(); foreach ($this->getConstructorParameters() as $param) { $getters[] = $this->getGetter($param->getName()); } return $getters; }
[ "public", "function", "getConstructorGetters", "(", ")", "{", "$", "getters", "=", "new", "BeanMethodCollection", "(", ")", ";", "foreach", "(", "$", "this", "->", "getConstructorParameters", "(", ")", "as", "$", "param", ")", "{", "$", "getters", "[", "]"...
Get the bean getters related to the parameters of the bean's constructor. @return \qtism\common\beans\BeanMethodCollection A collection of BeanMethod objects.
[ "Get", "the", "bean", "getters", "related", "to", "the", "parameters", "of", "the", "bean", "s", "constructor", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/beans/Bean.php#L354-L363
oat-sa/qti-sdk
src/qtism/common/beans/Bean.php
Bean.getConstructorSetters
public function getConstructorSetters() { $setters = new BeanMethodCollection(); foreach ($this->getConstructorParameters() as $param) { $setters[] = $this->getSetter($param->getName()); } return $setters; }
php
public function getConstructorSetters() { $setters = new BeanMethodCollection(); foreach ($this->getConstructorParameters() as $param) { $setters[] = $this->getSetter($param->getName()); } return $setters; }
[ "public", "function", "getConstructorSetters", "(", ")", "{", "$", "setters", "=", "new", "BeanMethodCollection", "(", ")", ";", "foreach", "(", "$", "this", "->", "getConstructorParameters", "(", ")", "as", "$", "param", ")", "{", "$", "setters", "[", "]"...
Get the bean setters related to the parameters of the bean's constructor. @return \qtism\common\beans\BeanMethodCollection A collection of BeanMethod objects.
[ "Get", "the", "bean", "setters", "related", "to", "the", "parameters", "of", "the", "bean", "s", "constructor", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/beans/Bean.php#L370-L379
oat-sa/qti-sdk
src/qtism/common/beans/Bean.php
Bean.getConstructorParameters
public function getConstructorParameters() { $parameters = new BeanParameterCollection(); if (($ctor = $this->getClass()->getConstructor()) !== null) { foreach ($ctor->getParameters() as $param) { if ($this->hasProperty($param->getName()) === true) { ...
php
public function getConstructorParameters() { $parameters = new BeanParameterCollection(); if (($ctor = $this->getClass()->getConstructor()) !== null) { foreach ($ctor->getParameters() as $param) { if ($this->hasProperty($param->getName()) === true) { ...
[ "public", "function", "getConstructorParameters", "(", ")", "{", "$", "parameters", "=", "new", "BeanParameterCollection", "(", ")", ";", "if", "(", "(", "$", "ctor", "=", "$", "this", "->", "getClass", "(", ")", "->", "getConstructor", "(", ")", ")", "!...
Get the constructor parameters of the bean. Only parameters that have the same name than a valid bean property will be returned. @return \qtism\common\beans\BeanParameterCollection A collection of BeanParameter objects.
[ "Get", "the", "constructor", "parameters", "of", "the", "bean", ".", "Only", "parameters", "that", "have", "the", "same", "name", "than", "a", "valid", "bean", "property", "will", "be", "returned", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/beans/Bean.php#L387-L401
oat-sa/qti-sdk
src/qtism/common/beans/Bean.php
Bean.hasConstructorParameter
public function hasConstructorParameter($parameterName) { $hasConstructorParameter = false; if (($ctor = $this->getClass()->getConstructor()) !== null) { foreach ($ctor->getParameters() as $param) { if ($param->getName() === $parameterName && $this->hasProperty($param->...
php
public function hasConstructorParameter($parameterName) { $hasConstructorParameter = false; if (($ctor = $this->getClass()->getConstructor()) !== null) { foreach ($ctor->getParameters() as $param) { if ($param->getName() === $parameterName && $this->hasProperty($param->...
[ "public", "function", "hasConstructorParameter", "(", "$", "parameterName", ")", "{", "$", "hasConstructorParameter", "=", "false", ";", "if", "(", "(", "$", "ctor", "=", "$", "this", "->", "getClass", "(", ")", "->", "getConstructor", "(", ")", ")", "!=="...
Whether the bean has a constructor parameter $parameterName which is related to a valid bean property. @param string $parameterName The name of the parameter. @return boolean
[ "Whether", "the", "bean", "has", "a", "constructor", "parameter", "$parameterName", "which", "is", "related", "to", "a", "valid", "bean", "property", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/beans/Bean.php#L410-L425
oat-sa/qti-sdk
src/qtism/common/beans/Bean.php
Bean.isPropertyAnnotated
protected function isPropertyAnnotated($propertyName) { $target = $this->getClass(); $isAnnotated = false; while ($target) { if ($target->hasProperty($propertyName)) { $comment = $target->getProperty($propertyName)->getDocComment(); if (empty($co...
php
protected function isPropertyAnnotated($propertyName) { $target = $this->getClass(); $isAnnotated = false; while ($target) { if ($target->hasProperty($propertyName)) { $comment = $target->getProperty($propertyName)->getDocComment(); if (empty($co...
[ "protected", "function", "isPropertyAnnotated", "(", "$", "propertyName", ")", "{", "$", "target", "=", "$", "this", "->", "getClass", "(", ")", ";", "$", "isAnnotated", "=", "false", ";", "while", "(", "$", "target", ")", "{", "if", "(", "$", "target"...
Whether a given property is annotated with the appropriate bean annotation. @param string $propertyName The name of the property. @return boolean
[ "Whether", "a", "given", "property", "is", "annotated", "with", "the", "appropriate", "bean", "annotation", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/beans/Bean.php#L433-L456
oat-sa/qti-sdk
src/qtism/common/beans/Bean.php
Bean.validateStrictBean
protected function validateStrictBean() { /* * 1st rule to respect: * All the constructor's parameters must be bound * to a valid annotated property, and the appropriate * getter and setter. (This implies the bean has a constructor) */ if ($this->getClass...
php
protected function validateStrictBean() { /* * 1st rule to respect: * All the constructor's parameters must be bound * to a valid annotated property, and the appropriate * getter and setter. (This implies the bean has a constructor) */ if ($this->getClass...
[ "protected", "function", "validateStrictBean", "(", ")", "{", "/*\n * 1st rule to respect:\n * All the constructor's parameters must be bound\n * to a valid annotated property, and the appropriate\n * getter and setter. (This implies the bean has a constructor)\n ...
Contains the internal logic of bean validation. Throws exceptions to know why it's not a valid bean. @throws \qtism\common\beans\BeanException
[ "Contains", "the", "internal", "logic", "of", "bean", "validation", ".", "Throws", "exceptions", "to", "know", "why", "it", "s", "not", "a", "valid", "bean", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/beans/Bean.php#L464-L510
oat-sa/qti-sdk
src/qtism/runtime/rendering/qtipl/expressions/operators/StringMatchQtiPLRenderer.php
StringMatchQtiPLRenderer.render
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); $attributes = []; $attributes['caseSensitive'] = strtolower(var_export($something->isCaseSensitive(), true)); if ($something->mustSubstring()) { $attributes['substring'] = "true"; ...
php
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); $attributes = []; $attributes['caseSensitive'] = strtolower(var_export($something->isCaseSensitive(), true)); if ($something->mustSubstring()) { $attributes['substring'] = "true"; ...
[ "public", "function", "render", "(", "$", "something", ")", "{", "$", "renderer", "=", "new", "QtiPLRenderer", "(", "$", "this", "->", "getCRO", "(", ")", ")", ";", "$", "attributes", "=", "[", "]", ";", "$", "attributes", "[", "'caseSensitive'", "]", ...
Render a QtiComponent object into another constitution. @param mixed $something Something to render into another consitution. @return mixed The rendered component into another constitution. @throws \qtism\runtime\rendering\RenderingException If something goes wrong while rendering the component.
[ "Render", "a", "QtiComponent", "object", "into", "another", "constitution", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/qtipl/expressions/operators/StringMatchQtiPLRenderer.php#L46-L58
oat-sa/qti-sdk
src/qtism/common/datatypes/QtiPair.php
QtiPair.setFirst
public function setFirst($first) { if (Format::isIdentifier($first)) { $this->first = $first; } else { $msg = "'${first}' is an invalid QTI identifier."; throw new InvalidArgumentException($msg); } }
php
public function setFirst($first) { if (Format::isIdentifier($first)) { $this->first = $first; } else { $msg = "'${first}' is an invalid QTI identifier."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setFirst", "(", "$", "first", ")", "{", "if", "(", "Format", "::", "isIdentifier", "(", "$", "first", ")", ")", "{", "$", "this", "->", "first", "=", "$", "first", ";", "}", "else", "{", "$", "msg", "=", "\"'${first}' is an inv...
Set the first identifier of the pair. @param string $first A QTI Identifier. @throws \InvalidArgumentException If $first is an invalid QTI Identifier.
[ "Set", "the", "first", "identifier", "of", "the", "pair", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/datatypes/QtiPair.php#L75-L83
oat-sa/qti-sdk
src/qtism/common/datatypes/QtiPair.php
QtiPair.setSecond
public function setSecond($second) { if (Format::isIdentifier($second)) { $this->second = $second; } else { $msg = "'${second}' is an invalid QTI identifier."; throw new InvalidArgumentException($msg); } }
php
public function setSecond($second) { if (Format::isIdentifier($second)) { $this->second = $second; } else { $msg = "'${second}' is an invalid QTI identifier."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setSecond", "(", "$", "second", ")", "{", "if", "(", "Format", "::", "isIdentifier", "(", "$", "second", ")", ")", "{", "$", "this", "->", "second", "=", "$", "second", ";", "}", "else", "{", "$", "msg", "=", "\"'${second}' is ...
Set the second identifier of the pair. @param string $second A QTI Identifier. @throws \InvalidArgumentException If $identifier is not a valid QTI Identifier.
[ "Set", "the", "second", "identifier", "of", "the", "pair", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/datatypes/QtiPair.php#L101-L109
oat-sa/qti-sdk
src/qtism/common/datatypes/QtiPair.php
QtiPair.equals
public function equals($obj) { if (gettype($obj) === 'object' && $obj instanceof self) { $a = array($this->getFirst(), $this->getSecond()); $b = array($obj->getFirst(), $obj->getSecond()); return in_array($b[0], $a) && in_array($b[1], $a); } return false...
php
public function equals($obj) { if (gettype($obj) === 'object' && $obj instanceof self) { $a = array($this->getFirst(), $this->getSecond()); $b = array($obj->getFirst(), $obj->getSecond()); return in_array($b[0], $a) && in_array($b[1], $a); } return false...
[ "public", "function", "equals", "(", "$", "obj", ")", "{", "if", "(", "gettype", "(", "$", "obj", ")", "===", "'object'", "&&", "$", "obj", "instanceof", "self", ")", "{", "$", "a", "=", "array", "(", "$", "this", "->", "getFirst", "(", ")", ",",...
Whether a given $obj is equal to this Pair. Two Pair objects are considered to be identical if the first and second values of $obj are the same as the ones of $obj. @param mixed $obj A value to compare. @return boolean Whether or not the equality could be established.
[ "Whether", "a", "given", "$obj", "is", "equal", "to", "this", "Pair", ".", "Two", "Pair", "objects", "are", "considered", "to", "be", "identical", "if", "the", "first", "and", "second", "values", "of", "$obj", "are", "the", "same", "as", "the", "ones", ...
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/datatypes/QtiPair.php#L139-L149
oat-sa/qti-sdk
src/qtism/common/datatypes/files/FileSystemFileManager.php
FileSystemFileManager.createFromFile
public function createFromFile($path, $mimeType, $filename = '') { $destination = $this->buildDestination(); try { return FileSystemFile::createFromExistingFile($path, $destination, $mimeType, $filename); } catch (RuntimeException $e) { $msg = "An error occured while...
php
public function createFromFile($path, $mimeType, $filename = '') { $destination = $this->buildDestination(); try { return FileSystemFile::createFromExistingFile($path, $destination, $mimeType, $filename); } catch (RuntimeException $e) { $msg = "An error occured while...
[ "public", "function", "createFromFile", "(", "$", "path", ",", "$", "mimeType", ",", "$", "filename", "=", "''", ")", "{", "$", "destination", "=", "$", "this", "->", "buildDestination", "(", ")", ";", "try", "{", "return", "FileSystemFile", "::", "creat...
Create a FileSystemFile object from an existing file on the file system. @param string $path The canonical path to the file. @param string $mimeType The mime-type of the file (if you want to force it). @param string $filename The file name of the file (if you want to force it). @throws \qtism\common\datatypes\files\Fi...
[ "Create", "a", "FileSystemFile", "object", "from", "an", "existing", "file", "on", "the", "file", "system", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/datatypes/files/FileSystemFileManager.php#L75-L85
oat-sa/qti-sdk
src/qtism/common/datatypes/files/FileSystemFileManager.php
FileSystemFileManager.createFromData
public function createFromData($data, $mimeType, $filename = '') { $destination = $this->buildDestination(); try { return FileSystemFile::createFromData($data, $destination, $mimeType, $filename); } catch (RuntimeException $e) { $msg = "An error occured while creatin...
php
public function createFromData($data, $mimeType, $filename = '') { $destination = $this->buildDestination(); try { return FileSystemFile::createFromData($data, $destination, $mimeType, $filename); } catch (RuntimeException $e) { $msg = "An error occured while creatin...
[ "public", "function", "createFromData", "(", "$", "data", ",", "$", "mimeType", ",", "$", "filename", "=", "''", ")", "{", "$", "destination", "=", "$", "this", "->", "buildDestination", "(", ")", ";", "try", "{", "return", "FileSystemFile", "::", "creat...
Create a FileSystemFile from existing data on the file system. @param string $data The binary data of the FileSystemFile object to be created. @param string $mimeType A mime-type. @param string $filename A file name e.g. "myfile.txt". @throws \qtism\common\datatypes\files\FileManagerException @return \qtism\common\dat...
[ "Create", "a", "FileSystemFile", "from", "existing", "data", "on", "the", "file", "system", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/datatypes/files/FileSystemFileManager.php#L96-L106
oat-sa/qti-sdk
src/qtism/common/datatypes/files/FileSystemFileManager.php
FileSystemFileManager.retrieve
public function retrieve($identifier) { try { return FileSystemFile::retrieveFile($identifier); } catch (RuntimeException $e) { $msg = "An error occured while retrieving a QTI FileSystemFile object."; throw new FileManagerException($msg, 0, $e); } }
php
public function retrieve($identifier) { try { return FileSystemFile::retrieveFile($identifier); } catch (RuntimeException $e) { $msg = "An error occured while retrieving a QTI FileSystemFile object."; throw new FileManagerException($msg, 0, $e); } }
[ "public", "function", "retrieve", "(", "$", "identifier", ")", "{", "try", "{", "return", "FileSystemFile", "::", "retrieveFile", "(", "$", "identifier", ")", ";", "}", "catch", "(", "RuntimeException", "$", "e", ")", "{", "$", "msg", "=", "\"An error occu...
Retrieve a FileSystemFile object from its unique identifier. @param string identifier @throws \qtism\common\datatypes\files\FileManagerException @return \qtism\common\datatypes\files\FileSystemFile
[ "Retrieve", "a", "FileSystemFile", "object", "from", "its", "unique", "identifier", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/datatypes/files/FileSystemFileManager.php#L115-L123
oat-sa/qti-sdk
src/qtism/common/datatypes/files/FileSystemFileManager.php
FileSystemFileManager.delete
public function delete(QtiFile $file) { $deletion = @unlink($file->getPath()); if ($deletion === false) { $msg = "The File System File located at '" . $file->getPath() . "' could not be deleted gracefully."; throw new FileManagerException($msg); } }
php
public function delete(QtiFile $file) { $deletion = @unlink($file->getPath()); if ($deletion === false) { $msg = "The File System File located at '" . $file->getPath() . "' could not be deleted gracefully."; throw new FileManagerException($msg); } }
[ "public", "function", "delete", "(", "QtiFile", "$", "file", ")", "{", "$", "deletion", "=", "@", "unlink", "(", "$", "file", "->", "getPath", "(", ")", ")", ";", "if", "(", "$", "deletion", "===", "false", ")", "{", "$", "msg", "=", "\"The File Sy...
Delete a FileSystemFile object from the persistence. @throws \qtism\common\datatypes\files\FileManagerException
[ "Delete", "a", "FileSystemFile", "object", "from", "the", "persistence", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/datatypes/files/FileSystemFileManager.php#L130-L137
oat-sa/qti-sdk
src/qtism/data/expressions/MathConstant.php
MathConstant.setName
public function setName($name) { if (in_array($name, MathEnumeration::asArray())) { $this->name = $name; } else { $msg = "${name} is not a valid QTI Math constant."; throw new InvalidArgumentException($msg); } }
php
public function setName($name) { if (in_array($name, MathEnumeration::asArray())) { $this->name = $name; } else { $msg = "${name} is not a valid QTI Math constant."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setName", "(", "$", "name", ")", "{", "if", "(", "in_array", "(", "$", "name", ",", "MathEnumeration", "::", "asArray", "(", ")", ")", ")", "{", "$", "this", "->", "name", "=", "$", "name", ";", "}", "else", "{", "$", "msg"...
Set the name of the math constant. @param string $name The name of the math constant. @throws \InvalidArgumentException If $name is not a valid QTI math constant name.
[ "Set", "the", "name", "of", "the", "math", "constant", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/expressions/MathConstant.php#L71-L79
oat-sa/qti-sdk
src/qtism/data/state/InterpolationTable.php
InterpolationTable.setInterpolationTableEntries
public function setInterpolationTableEntries(InterpolationTableEntryCollection $interpolationTableEntries) { if (count($interpolationTableEntries) > 0) { $this->interpolationTableEntries = $interpolationTableEntries; } else { $msg = "An InterpolationTable object must contain ...
php
public function setInterpolationTableEntries(InterpolationTableEntryCollection $interpolationTableEntries) { if (count($interpolationTableEntries) > 0) { $this->interpolationTableEntries = $interpolationTableEntries; } else { $msg = "An InterpolationTable object must contain ...
[ "public", "function", "setInterpolationTableEntries", "(", "InterpolationTableEntryCollection", "$", "interpolationTableEntries", ")", "{", "if", "(", "count", "(", "$", "interpolationTableEntries", ")", ">", "0", ")", "{", "$", "this", "->", "interpolationTableEntries"...
Set the InterpolationTableEntry objects contained by the current InterpolationTable. @param \qtism\data\state\InterpolationTableEntryCollection $interpolationTableEntries A collection of InterpolationTableEntry objects. @throws \InvalidArgumentException If $interpolationTableEntries is an empty collection.
[ "Set", "the", "InterpolationTableEntry", "objects", "contained", "by", "the", "current", "InterpolationTable", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/InterpolationTable.php#L81-L89
oat-sa/qti-sdk
src/qtism/runtime/processing/PrintedVariableProcessingException.php
PrintedVariableProcessingException.setSource
public function setSource(Processable $source) { if ($source instanceof PrintedVariableEngine) { parent::setSource($source); } else { $msg = "PrintedVariableProcessingException::setSource only accepts PrintedVariableEngine objects."; throw new InvalidArgumentExcep...
php
public function setSource(Processable $source) { if ($source instanceof PrintedVariableEngine) { parent::setSource($source); } else { $msg = "PrintedVariableProcessingException::setSource only accepts PrintedVariableEngine objects."; throw new InvalidArgumentExcep...
[ "public", "function", "setSource", "(", "Processable", "$", "source", ")", "{", "if", "(", "$", "source", "instanceof", "PrintedVariableEngine", ")", "{", "parent", "::", "setSource", "(", "$", "source", ")", ";", "}", "else", "{", "$", "msg", "=", "\"Pr...
Set the source of the error. @param \qtism\runtime\common\Processable $source The source of the error. @throws \InvalidArgumentException If $source is not a PrintedVariableEngine object.
[ "Set", "the", "source", "of", "the", "error", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/processing/PrintedVariableProcessingException.php#L44-L52
oat-sa/qti-sdk
src/qtism/common/enums/BaseType.php
BaseType.getConstantByName
public static function getConstantByName($name) { switch (trim(strtolower($name))) { case 'identifier': return self::IDENTIFIER; break; case 'boolean': return self::BOOLEAN; break; case 'integer': r...
php
public static function getConstantByName($name) { switch (trim(strtolower($name))) { case 'identifier': return self::IDENTIFIER; break; case 'boolean': return self::BOOLEAN; break; case 'integer': r...
[ "public", "static", "function", "getConstantByName", "(", "$", "name", ")", "{", "switch", "(", "trim", "(", "strtolower", "(", "$", "name", ")", ")", ")", "{", "case", "'identifier'", ":", "return", "self", "::", "IDENTIFIER", ";", "break", ";", "case",...
Get a constant value from the BaseType enumeration by baseType name. * 'identifier' -> BaseType::IDENTIFIER * 'boolean' -> BaseType::BOOLEAN * 'integer' -> BaseType::INTEGER * 'float' -> BaseType::FLOAT * 'string' -> BaseType::STRING * 'point' -> BaseType::POINT * 'pair' -> BaseType::PAIR * 'directedPair' -> BaseType:...
[ "Get", "a", "constant", "value", "from", "the", "BaseType", "enumeration", "by", "baseType", "name", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/enums/BaseType.php#L214-L273
oat-sa/qti-sdk
src/qtism/common/enums/BaseType.php
BaseType.getNameByConstant
public static function getNameByConstant($constant) { switch ($constant) { case self::IDENTIFIER: return 'identifier'; break; case self::BOOLEAN: return 'boolean'; break; case self::INTEGER: return ...
php
public static function getNameByConstant($constant) { switch ($constant) { case self::IDENTIFIER: return 'identifier'; break; case self::BOOLEAN: return 'boolean'; break; case self::INTEGER: return ...
[ "public", "static", "function", "getNameByConstant", "(", "$", "constant", ")", "{", "switch", "(", "$", "constant", ")", "{", "case", "self", "::", "IDENTIFIER", ":", "return", "'identifier'", ";", "break", ";", "case", "self", "::", "BOOLEAN", ":", "retu...
Get the QTI name of a BaseType. @param int $constant A constant value from the BaseType enumeration. @return string|boolean The QTI name or false if not match.
[ "Get", "the", "QTI", "name", "of", "a", "BaseType", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/enums/BaseType.php#L281-L340
oat-sa/qti-sdk
src/qtism/common/beans/BeanProperty.php
BeanProperty.setProperty
protected function setProperty(ReflectionProperty $property) { if (mb_strpos($property->getDocComment(), Bean::ANNOTATION_PROPERTY, 0, 'UTF-8') !== false) { $this->property = $property; } else { $msg = "The property must be annotated with '@qtism-bean-property'."; ...
php
protected function setProperty(ReflectionProperty $property) { if (mb_strpos($property->getDocComment(), Bean::ANNOTATION_PROPERTY, 0, 'UTF-8') !== false) { $this->property = $property; } else { $msg = "The property must be annotated with '@qtism-bean-property'."; ...
[ "protected", "function", "setProperty", "(", "ReflectionProperty", "$", "property", ")", "{", "if", "(", "mb_strpos", "(", "$", "property", "->", "getDocComment", "(", ")", ",", "Bean", "::", "ANNOTATION_PROPERTY", ",", "0", ",", "'UTF-8'", ")", "!==", "fals...
Set the wrapped ReflectionProperty object. @param \ReflectionProperty $property A ReflectionProperty object. @throws \qtism\common\beans\BeanException If the given $property is not annotated with @qtism-bean-property.
[ "Set", "the", "wrapped", "ReflectionProperty", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/beans/BeanProperty.php#L80-L88
oat-sa/qti-sdk
src/qtism/runtime/rendering/markup/Utils.php
Utils.printVariable
public static function printVariable(State $context, $identifier, $format = '', $powerForm = false, $base = 10, $index = -1, $delimiter = ';', $field = '', $mappingIndicator = '=') { try { $printedVariable = new PrintedVariable($identifier); $printedVariable->setFormat($format); ...
php
public static function printVariable(State $context, $identifier, $format = '', $powerForm = false, $base = 10, $index = -1, $delimiter = ';', $field = '', $mappingIndicator = '=') { try { $printedVariable = new PrintedVariable($identifier); $printedVariable->setFormat($format); ...
[ "public", "static", "function", "printVariable", "(", "State", "$", "context", ",", "$", "identifier", ",", "$", "format", "=", "''", ",", "$", "powerForm", "=", "false", ",", "$", "base", "=", "10", ",", "$", "index", "=", "-", "1", ",", "$", "del...
Helper method to be used in QTI template oriented rendering to produce the final value of a qti:printedVariable component. If an error occurs while printing the variable, the return value will contain the error message. @param State $context A State object from where values will be retrieved prior to formatting, depe...
[ "Helper", "method", "to", "be", "used", "in", "QTI", "template", "oriented", "rendering", "to", "produce", "the", "final", "value", "of", "a", "qti", ":", "printedVariable", "component", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/markup/Utils.php#L58-L79
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/ResponseValidityConstraintMarshaller.php
ResponseValidityConstraintMarshaller.marshall
public function marshall(QtiComponent $component) { $element = self::getDOMCradle()->createElement('responseValidityConstraint'); $this->setDOMElementAttribute($element, 'responseIdentifier', $component->getResponseIdentifier()); $this->setDOMElementAttribute($element, 'minConstraint', $comp...
php
public function marshall(QtiComponent $component) { $element = self::getDOMCradle()->createElement('responseValidityConstraint'); $this->setDOMElementAttribute($element, 'responseIdentifier', $component->getResponseIdentifier()); $this->setDOMElementAttribute($element, 'minConstraint', $comp...
[ "public", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "self", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "'responseValidityConstraint'", ")", ";", "$", "this", "->", "setDOMElementAttribute", "("...
Marshall a ResponseValidityConstraint object to its XML counterpart. @param \qtism\data\QtiComponent $component @return \DOMElement
[ "Marshall", "a", "ResponseValidityConstraint", "object", "to", "its", "XML", "counterpart", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/ResponseValidityConstraintMarshaller.php#L45-L62
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/ResponseValidityConstraintMarshaller.php
ResponseValidityConstraintMarshaller.unmarshall
public function unmarshall(DOMElement $element) { if (($responseIdentifier = $this->getDOMElementAttributeAs($element, 'responseIdentifier')) !== null) { if (($minConstraint = $this->getDOMElementAttributeAs($element, 'minConstraint', 'integer')) !== null) { ...
php
public function unmarshall(DOMElement $element) { if (($responseIdentifier = $this->getDOMElementAttributeAs($element, 'responseIdentifier')) !== null) { if (($minConstraint = $this->getDOMElementAttributeAs($element, 'minConstraint', 'integer')) !== null) { ...
[ "public", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "if", "(", "(", "$", "responseIdentifier", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'responseIdentifier'", ")", ")", "!==", "null", ")", "{...
Unmarshall a DOMElement to its ResponseValidityConstraint data model representation. @param \DOMElement $element @return \qtism\data\QtiComponent A ResponseValidityConstraint object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
[ "Unmarshall", "a", "DOMElement", "to", "its", "ResponseValidityConstraint", "data", "model", "representation", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/ResponseValidityConstraintMarshaller.php#L71-L120
oat-sa/qti-sdk
src/qtism/runtime/rules/SetValueProcessor.php
SetValueProcessor.process
public function process() { $state = $this->getState(); $rule = $this->getRule(); $identifier = $rule->getIdentifier(); $var = $state->getVariable($identifier); if (is_null($var) === true) { $msg = "No variable with identifier '${identifier}' to be set in the cur...
php
public function process() { $state = $this->getState(); $rule = $this->getRule(); $identifier = $rule->getIdentifier(); $var = $state->getVariable($identifier); if (is_null($var) === true) { $msg = "No variable with identifier '${identifier}' to be set in the cur...
[ "public", "function", "process", "(", ")", "{", "$", "state", "=", "$", "this", "->", "getState", "(", ")", ";", "$", "rule", "=", "$", "this", "->", "getRule", "(", ")", ";", "$", "identifier", "=", "$", "rule", "->", "getIdentifier", "(", ")", ...
Process the setOutcomeValue/setTemplateValue rule. A RuleProcessingException will be thrown if: * The variable does not exist. * The requested variable is not an OutcomeVariable/TemplateVariable. * The variable's baseType does not match the baseType of the affected value. * An error occurs while processing the relate...
[ "Process", "the", "setOutcomeValue", "/", "setTemplateValue", "rule", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rules/SetValueProcessor.php#L55-L106
oat-sa/qti-sdk
src/qtism/runtime/pci/json/Unmarshaller.php
Unmarshaller.unmarshall
public function unmarshall($json) { if (is_string($json) === true) { $tmpJson = @json_decode($json, true); if ($tmpJson === null) { // An error occured while decoding. $msg = "An error occured while decoding the following JSON data '" . mb_substr($jso...
php
public function unmarshall($json) { if (is_string($json) === true) { $tmpJson = @json_decode($json, true); if ($tmpJson === null) { // An error occured while decoding. $msg = "An error occured while decoding the following JSON data '" . mb_substr($jso...
[ "public", "function", "unmarshall", "(", "$", "json", ")", "{", "if", "(", "is_string", "(", "$", "json", ")", "===", "true", ")", "{", "$", "tmpJson", "=", "@", "json_decode", "(", "$", "json", ",", "true", ")", ";", "if", "(", "$", "tmpJson", "...
Transform a PCI JSON representation of QTI data into the QTISM runtime model. @param string|array $json The json data to be transformed. @throws \qtism\runtime\pci\json\UnmarshallingException If an error occurs while processing $json. @return null|qtism\common\datatypes\QtiDataType|array
[ "Transform", "a", "PCI", "JSON", "representation", "of", "QTI", "data", "into", "the", "QTISM", "runtime", "model", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/pci/json/Unmarshaller.php#L108-L213
oat-sa/qti-sdk
src/qtism/runtime/pci/json/Unmarshaller.php
Unmarshaller.unmarshallUnit
protected function unmarshallUnit(array $unit) { if (isset($unit['base'])) { // Primitive base type. try { $keys = array_keys($unit['base']); switch ($keys[0]) { case 'boolean': return $this->unmarshallBoole...
php
protected function unmarshallUnit(array $unit) { if (isset($unit['base'])) { // Primitive base type. try { $keys = array_keys($unit['base']); switch ($keys[0]) { case 'boolean': return $this->unmarshallBoole...
[ "protected", "function", "unmarshallUnit", "(", "array", "$", "unit", ")", "{", "if", "(", "isset", "(", "$", "unit", "[", "'base'", "]", ")", ")", "{", "// Primitive base type.", "try", "{", "$", "keys", "=", "array_keys", "(", "$", "unit", "[", "'bas...
Unmarshall a unit of data into QTISM runtime model. @param array $unit @throws \qtism\runtime\pci\json\UnmarshallingException @return null|qtism\common\datatypes\QtiDatatype
[ "Unmarshall", "a", "unit", "of", "data", "into", "QTISM", "runtime", "model", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/pci/json/Unmarshaller.php#L222-L289
oat-sa/qti-sdk
src/qtism/runtime/pci/json/Unmarshaller.php
Unmarshaller.unmarshallFloat
protected function unmarshallFloat(array $unit) { $val = $unit['base']['float']; if (is_int($val) === true) { $val = floatval($val); } return new QtiFloat($val); }
php
protected function unmarshallFloat(array $unit) { $val = $unit['base']['float']; if (is_int($val) === true) { $val = floatval($val); } return new QtiFloat($val); }
[ "protected", "function", "unmarshallFloat", "(", "array", "$", "unit", ")", "{", "$", "val", "=", "$", "unit", "[", "'base'", "]", "[", "'float'", "]", ";", "if", "(", "is_int", "(", "$", "val", ")", "===", "true", ")", "{", "$", "val", "=", "flo...
Unmarshall a float JSON PCI representation. @param array $unit @return \qtism\common\datatypes\Float
[ "Unmarshall", "a", "float", "JSON", "PCI", "representation", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/pci/json/Unmarshaller.php#L319-L328
oat-sa/qti-sdk
src/qtism/runtime/pci/json/Unmarshaller.php
Unmarshaller.unmarshallFile
protected function unmarshallFile(array $unit) { $filename = (empty($unit['base']['file']['name']) === true) ? '' : $unit['base']['file']['name']; return $this->getFileManager()->createFromData(base64_decode($unit['base']['file']['data']), $unit['base']['file']['mime'], $filename); }
php
protected function unmarshallFile(array $unit) { $filename = (empty($unit['base']['file']['name']) === true) ? '' : $unit['base']['file']['name']; return $this->getFileManager()->createFromData(base64_decode($unit['base']['file']['data']), $unit['base']['file']['mime'], $filename); }
[ "protected", "function", "unmarshallFile", "(", "array", "$", "unit", ")", "{", "$", "filename", "=", "(", "empty", "(", "$", "unit", "[", "'base'", "]", "[", "'file'", "]", "[", "'name'", "]", ")", "===", "true", ")", "?", "''", ":", "$", "unit", ...
Unmarshall a duration JSON PCI representation. @param array $unit @return \qtism\common\datatypes\File
[ "Unmarshall", "a", "duration", "JSON", "PCI", "representation", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/pci/json/Unmarshaller.php#L391-L396
oat-sa/qti-sdk
src/qtism/runtime/rendering/qtipl/expressions/operators/NotQtiPLRenderer.php
NotQtiPLRenderer.render
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); $orenderer = new OperatorQtiPLRenderer($this->getCRO()); $needsparenthesis0 = array_key_exists($something->getExpressions()[0]->getQtiClassName(), $orenderer->getSignAsOperatorMap()) ...
php
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); $orenderer = new OperatorQtiPLRenderer($this->getCRO()); $needsparenthesis0 = array_key_exists($something->getExpressions()[0]->getQtiClassName(), $orenderer->getSignAsOperatorMap()) ...
[ "public", "function", "render", "(", "$", "something", ")", "{", "$", "renderer", "=", "new", "QtiPLRenderer", "(", "$", "this", "->", "getCRO", "(", ")", ")", ";", "$", "orenderer", "=", "new", "OperatorQtiPLRenderer", "(", "$", "this", "->", "getCRO", ...
Render a QtiComponent object into another constitution. @param mixed $something Something to render into another consitution. @return mixed The rendered component into another constitution. @throws \qtism\runtime\rendering\RenderingException If something goes wrong while rendering the component.
[ "Render", "a", "QtiComponent", "object", "into", "another", "constitution", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/qtipl/expressions/operators/NotQtiPLRenderer.php#L48-L63
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/PatternMatchMarshaller.php
PatternMatchMarshaller.unmarshallChildrenKnown
protected function unmarshallChildrenKnown(DOMElement $element, QtiComponentCollection $children) { if (($pattern = $this->getDOMElementAttributeAs($element, 'pattern')) !== null) { $object = new PatternMatch($children, $pattern); return $object; } else { $msg =...
php
protected function unmarshallChildrenKnown(DOMElement $element, QtiComponentCollection $children) { if (($pattern = $this->getDOMElementAttributeAs($element, 'pattern')) !== null) { $object = new PatternMatch($children, $pattern); return $object; } else { $msg =...
[ "protected", "function", "unmarshallChildrenKnown", "(", "DOMElement", "$", "element", ",", "QtiComponentCollection", "$", "children", ")", "{", "if", "(", "(", "$", "pattern", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'patte...
Unmarshall a QTI patternMatch operator element into an PatternMatch object. @param \DOMElement The patternMatch element to unmarshall. @param \qtism\data\QtiComponentCollection A collection containing the child Expression objects composing the Operator. @return \qtism\data\QtiComponent A PatternMatch object. @throws \...
[ "Unmarshall", "a", "QTI", "patternMatch", "operator", "element", "into", "an", "PatternMatch", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/PatternMatchMarshaller.php#L66-L77
oat-sa/qti-sdk
src/qtism/data/content/xhtml/ObjectElement.php
ObjectElement.setData
public function setData($data) { if ((is_string($data) === true && $data === '') || Format::isUri($data) === true) { $this->data = $data; } else { $msg = "The 'data' argument must be a URI or an empty string, '" . gettype($data) . "' given."; throw new InvalidArgu...
php
public function setData($data) { if ((is_string($data) === true && $data === '') || Format::isUri($data) === true) { $this->data = $data; } else { $msg = "The 'data' argument must be a URI or an empty string, '" . gettype($data) . "' given."; throw new InvalidArgu...
[ "public", "function", "setData", "(", "$", "data", ")", "{", "if", "(", "(", "is_string", "(", "$", "data", ")", "===", "true", "&&", "$", "data", "===", "''", ")", "||", "Format", "::", "isUri", "(", "$", "data", ")", "===", "true", ")", "{", ...
Set the URI for locating the data of the object. @param string $data The URI for locating the data of the object. @throws \InvalidArgumentException If $data is not a URI.
[ "Set", "the", "URI", "for", "locating", "the", "data", "of", "the", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/xhtml/ObjectElement.php#L114-L122
oat-sa/qti-sdk
src/qtism/data/content/xhtml/ObjectElement.php
ObjectElement.setWidth
public function setWidth($width) { if (is_int($width) === true) { $this->width = $width; } else { $msg = "The 'width' argument must be an integer, '" . gettype($width) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setWidth($width) { if (is_int($width) === true) { $this->width = $width; } else { $msg = "The 'width' argument must be an integer, '" . gettype($width) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setWidth", "(", "$", "width", ")", "{", "if", "(", "is_int", "(", "$", "width", ")", "===", "true", ")", "{", "$", "this", "->", "width", "=", "$", "width", ";", "}", "else", "{", "$", "msg", "=", "\"The 'width' argument must b...
Set the width of the object. A negative value describes that no width is provided. @param integer $width A width. @throws \InvalidArgumentException
[ "Set", "the", "width", "of", "the", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/xhtml/ObjectElement.php#L168-L176
oat-sa/qti-sdk
src/qtism/data/content/xhtml/ObjectElement.php
ObjectElement.setHeight
public function setHeight($height) { if (is_int($height) === true) { $this->height = $height; } else { $msg = "The 'height' argument must be an integer, '" . gettype($height) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setHeight($height) { if (is_int($height) === true) { $this->height = $height; } else { $msg = "The 'height' argument must be an integer, '" . gettype($height) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setHeight", "(", "$", "height", ")", "{", "if", "(", "is_int", "(", "$", "height", ")", "===", "true", ")", "{", "$", "this", "->", "height", "=", "$", "height", ";", "}", "else", "{", "$", "msg", "=", "\"The 'height' argument ...
Set the height of the object. A negative value describes that no height is provided. @param integer $height A height. @throws \InvalidArgumentException If $height is not an integer value.
[ "Set", "the", "height", "of", "the", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/xhtml/ObjectElement.php#L208-L216
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/ModalFeedbackRuleMarshaller.php
ModalFeedbackRuleMarshaller.marshall
public function marshall(QtiComponent $component) { $element = self::getDOMCradle()->createElement('modalFeedbackRule'); $this->setDOMElementAttribute($element, 'outcomeIdentifier', $component->getOutcomeIdentifier()); $this->setDOMElementAttribute($element, 'showHide', ShowHide::getNameByCo...
php
public function marshall(QtiComponent $component) { $element = self::getDOMCradle()->createElement('modalFeedbackRule'); $this->setDOMElementAttribute($element, 'outcomeIdentifier', $component->getOutcomeIdentifier()); $this->setDOMElementAttribute($element, 'showHide', ShowHide::getNameByCo...
[ "public", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "self", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "'modalFeedbackRule'", ")", ";", "$", "this", "->", "setDOMElementAttribute", "(", "$", ...
Marshall a ModalFeedbackRule object to its XML counterpart. @param \qtism\data\QtiComponent $component @return \DOMElement
[ "Marshall", "a", "ModalFeedbackRule", "object", "to", "its", "XML", "counterpart", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/ModalFeedbackRuleMarshaller.php#L44-L56
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/ModalFeedbackRuleMarshaller.php
ModalFeedbackRuleMarshaller.unmarshall
public function unmarshall(DOMElement $element) { if (($identifier = $this->getDOMElementAttributeAs($element, 'identifier')) !== null) { if (($outcomeIdentifier = $this->getDOMElementAttributeAs($element, 'outcomeIdentifier')) !== null) { if (($showHide = $this...
php
public function unmarshall(DOMElement $element) { if (($identifier = $this->getDOMElementAttributeAs($element, 'identifier')) !== null) { if (($outcomeIdentifier = $this->getDOMElementAttributeAs($element, 'outcomeIdentifier')) !== null) { if (($showHide = $this...
[ "public", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "if", "(", "(", "$", "identifier", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'identifier'", ")", ")", "!==", "null", ")", "{", "if", "("...
Unmarshall a DOMElement to its ModalFeedbackRule data model representation. @param \DOMElement $element @return \qtism\data\QtiComponent A ModalFeedbackRule object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException If the 'identifier', 'outcomeIdentifier', 'showHide', or attribute is missing from the ...
[ "Unmarshall", "a", "DOMElement", "to", "its", "ModalFeedbackRule", "data", "model", "representation", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/ModalFeedbackRuleMarshaller.php#L65-L96
oat-sa/qti-sdk
src/qtism/data/state/MapEntry.php
MapEntry.setMappedValue
public function setMappedValue($mappedValue) { if (is_float($mappedValue) || is_double($mappedValue)) { $this->mappedValue = $mappedValue; } else { $msg = "The attribute 'mappedValue' must be a float value, '" . gettype($mappedValue) . "' given."; throw new Invali...
php
public function setMappedValue($mappedValue) { if (is_float($mappedValue) || is_double($mappedValue)) { $this->mappedValue = $mappedValue; } else { $msg = "The attribute 'mappedValue' must be a float value, '" . gettype($mappedValue) . "' given."; throw new Invali...
[ "public", "function", "setMappedValue", "(", "$", "mappedValue", ")", "{", "if", "(", "is_float", "(", "$", "mappedValue", ")", "||", "is_double", "(", "$", "mappedValue", ")", ")", "{", "$", "this", "->", "mappedValue", "=", "$", "mappedValue", ";", "}"...
Set the mapped value. @param float $mappedValue A mapped value. @throws \InvalidArgumentException If $mappedValue is not a float value.
[ "Set", "the", "mapped", "value", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/MapEntry.php#L114-L122
oat-sa/qti-sdk
src/qtism/data/state/MapEntry.php
MapEntry.setCaseSensitive
public function setCaseSensitive($caseSensitive) { if (is_bool($caseSensitive)) { $this->caseSensitive = $caseSensitive; } else { $msg = "The attribute 'caseSensitive' must be a boolean value, '" . gettype($caseSensitive) . "'."; throw new InvalidArgumentException...
php
public function setCaseSensitive($caseSensitive) { if (is_bool($caseSensitive)) { $this->caseSensitive = $caseSensitive; } else { $msg = "The attribute 'caseSensitive' must be a boolean value, '" . gettype($caseSensitive) . "'."; throw new InvalidArgumentException...
[ "public", "function", "setCaseSensitive", "(", "$", "caseSensitive", ")", "{", "if", "(", "is_bool", "(", "$", "caseSensitive", ")", ")", "{", "$", "this", "->", "caseSensitive", "=", "$", "caseSensitive", ";", "}", "else", "{", "$", "msg", "=", "\"The a...
Set whether the mapEntry string is matched case sensitively. @param boolean $caseSensitive @throws \InvalidArgumentException If $caseSensitive is not a boolean value.
[ "Set", "whether", "the", "mapEntry", "string", "is", "matched", "case", "sensitively", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/MapEntry.php#L140-L148
oat-sa/qti-sdk
src/qtism/data/content/interactions/SelectPointInteraction.php
SelectPointInteraction.setMaxChoices
public function setMaxChoices($maxChoices) { if (is_int($maxChoices) === true && $maxChoices >= 0) { $this->maxChoices = $maxChoices; } else { $msg = "The 'maxChoices' argument must be a positive (>= 0) integer, '" . gettype($maxChoices) . "' given."; throw new In...
php
public function setMaxChoices($maxChoices) { if (is_int($maxChoices) === true && $maxChoices >= 0) { $this->maxChoices = $maxChoices; } else { $msg = "The 'maxChoices' argument must be a positive (>= 0) integer, '" . gettype($maxChoices) . "' given."; throw new In...
[ "public", "function", "setMaxChoices", "(", "$", "maxChoices", ")", "{", "if", "(", "is_int", "(", "$", "maxChoices", ")", "===", "true", "&&", "$", "maxChoices", ">=", "0", ")", "{", "$", "this", "->", "maxChoices", "=", "$", "maxChoices", ";", "}", ...
Set the maximum number of points that the candidate is allowed to select. @param integer $maxChoices A positive (>= 0) integer. @throws \InvalidArgumentException If $maxChoices is not a positive integer.
[ "Set", "the", "maximum", "number", "of", "points", "that", "the", "candidate", "is", "allowed", "to", "select", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/interactions/SelectPointInteraction.php#L108-L116
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/TemplateProcessingMarshaller.php
TemplateProcessingMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = self::getDOMCradle()->createElement('templateProcessing'); foreach ($component->getTemplateRules() as $templateRule) { $element->appendChild($this->getMarshallerFactory()->createMarshaller($templateRule)->marshall($templa...
php
protected function marshall(QtiComponent $component) { $element = self::getDOMCradle()->createElement('templateProcessing'); foreach ($component->getTemplateRules() as $templateRule) { $element->appendChild($this->getMarshallerFactory()->createMarshaller($templateRule)->marshall($templa...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "self", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "'templateProcessing'", ")", ";", "foreach", "(", "$", "component", "->", "getTemplat...
Marshall a TemplateProcessing object into a DOMElement object. @param \qtism\data\QtiComponent $component A TemplateProcessing object. @return \DOMElement The according DOMElement object. @throws \qtism\data\storage\xml\marshalling\MarshallingException
[ "Marshall", "a", "TemplateProcessing", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/TemplateProcessingMarshaller.php#L46-L55
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/TemplateProcessingMarshaller.php
TemplateProcessingMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { $childrenTagNames = array('exitTemplate', 'setCorrectResponse', 'setDefaultValue', 'setTemplateValue', 'templateCondition', 'templateConstraint'); $templateRuleElts = $this->getChildElementsByTagName($element, $childrenTagNames); $template...
php
protected function unmarshall(DOMElement $element) { $childrenTagNames = array('exitTemplate', 'setCorrectResponse', 'setDefaultValue', 'setTemplateValue', 'templateCondition', 'templateConstraint'); $templateRuleElts = $this->getChildElementsByTagName($element, $childrenTagNames); $template...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "$", "childrenTagNames", "=", "array", "(", "'exitTemplate'", ",", "'setCorrectResponse'", ",", "'setDefaultValue'", ",", "'setTemplateValue'", ",", "'templateCondition'", ",", "'templ...
Unmarshall a DOMElement object corresponding to a QTI templateProcessing element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A TemplateProcessing object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "templateProcessing", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/TemplateProcessingMarshaller.php#L64-L80
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/ContainerSizeProcessor.php
ContainerSizeProcessor.process
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return new QtiInteger(0); } if ($operands->exclusivelyMultipleOrOrdered() === false) { $msg = "The ContainerSize operator only accepts operands with a mul...
php
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return new QtiInteger(0); } if ($operands->exclusivelyMultipleOrOrdered() === false) { $msg = "The ContainerSize operator only accepts operands with a mul...
[ "public", "function", "process", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "if", "(", "$", "operands", "->", "containsNull", "(", ")", "===", "true", ")", "{", "return", "new", "QtiInteger", "(", "0", ")", ...
Process the current expression. @return integer|null The size of the container or null if it contains NULL. @throws \qtism\runtime\expressions\operators\OperatorProcessingException
[ "Process", "the", "current", "expression", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/ContainerSizeProcessor.php#L51-L65
oat-sa/qti-sdk
src/qtism/data/expressions/operators/MathOperator.php
MathOperator.setName
public function setName($name) { if (in_array($name, MathFunctions::asArray())) { $this->name = $name; } else { $msg = "The name attribute must be a value from the MathFunctions enumeration, '" . $name . "' given."; throw new InvalidArgumentException($msg); ...
php
public function setName($name) { if (in_array($name, MathFunctions::asArray())) { $this->name = $name; } else { $msg = "The name attribute must be a value from the MathFunctions enumeration, '" . $name . "' given."; throw new InvalidArgumentException($msg); ...
[ "public", "function", "setName", "(", "$", "name", ")", "{", "if", "(", "in_array", "(", "$", "name", ",", "MathFunctions", "::", "asArray", "(", ")", ")", ")", "{", "$", "this", "->", "name", "=", "$", "name", ";", "}", "else", "{", "$", "msg", ...
Set the name of the math function to use. @param integer $name A value from the MathFunctions enumeration. @throws \InvalidArgumentException If $name is not a value from the MathFunctions enumeration.
[ "Set", "the", "name", "of", "the", "math", "function", "to", "use", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/expressions/operators/MathOperator.php#L113-L121
oat-sa/qti-sdk
src/qtism/data/QtiDocument.php
QtiDocument.setVersion
public function setVersion($version) { if (Version::isKnown($version) === true) { $this->version = Version::appendPatchVersion($version); } else { $msg = "Version '{$version}' is not a known QTI version. Known versions are '" . implode(', ', Version::knownVersions()) . "'"; ...
php
public function setVersion($version) { if (Version::isKnown($version) === true) { $this->version = Version::appendPatchVersion($version); } else { $msg = "Version '{$version}' is not a known QTI version. Known versions are '" . implode(', ', Version::knownVersions()) . "'"; ...
[ "public", "function", "setVersion", "(", "$", "version", ")", "{", "if", "(", "Version", "::", "isKnown", "(", "$", "version", ")", "===", "true", ")", "{", "$", "this", "->", "version", "=", "Version", "::", "appendPatchVersion", "(", "$", "version", ...
Set the QTI $version in use for this document. @param string $version A QTI version number e.g. '2.1.1'. @throws \InvalidArgumentException If $version is unknown regarding existing QTI versions.
[ "Set", "the", "QTI", "$version", "in", "use", "for", "this", "document", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/QtiDocument.php#L63-L71
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/ContentMarshaller.php
ContentMarshaller.lookupClass
protected function lookupClass(DOMElement $element) { $localName = $element->localName; if ($this->isWebComponentFriendly() === true && preg_match('/^qti-/', $localName) === 1) { $localName = XmlUtils::qtiFriendlyName($localName); } $lookup = $this->getLookupClas...
php
protected function lookupClass(DOMElement $element) { $localName = $element->localName; if ($this->isWebComponentFriendly() === true && preg_match('/^qti-/', $localName) === 1) { $localName = XmlUtils::qtiFriendlyName($localName); } $lookup = $this->getLookupClas...
[ "protected", "function", "lookupClass", "(", "DOMElement", "$", "element", ")", "{", "$", "localName", "=", "$", "element", "->", "localName", ";", "if", "(", "$", "this", "->", "isWebComponentFriendly", "(", ")", "===", "true", "&&", "preg_match", "(", "'...
Get the related PHP class name of a given $element. @param \DOMElement $element The element you want to know the data model PHP class. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException If no class can be found for $element. @return string A fully qualified class name.
[ "Get", "the", "related", "PHP", "class", "name", "of", "a", "given", "$element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/ContentMarshaller.php#L305-L330