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/HottextInteraction.php
HottextInteraction.setContent
public function setContent(BlockStaticCollection $content) { if (count($content) > 0) { $this->content = $content; } else { $msg = "A HottextInteraction object must be composed of at least one BlockStatic object, none given."; throw new InvalidArgumentException($m...
php
public function setContent(BlockStaticCollection $content) { if (count($content) > 0) { $this->content = $content; } else { $msg = "A HottextInteraction object must be composed of at least one BlockStatic object, none given."; throw new InvalidArgumentException($m...
[ "public", "function", "setContent", "(", "BlockStaticCollection", "$", "content", ")", "{", "if", "(", "count", "(", "$", "content", ")", ">", "0", ")", "{", "$", "this", "->", "content", "=", "$", "content", ";", "}", "else", "{", "$", "msg", "=", ...
Set the content of the interaction, containing the hottext areas. @param \qtism\data\content\BlockStaticCollection $content A collection of at least one BlockStatic object. @throws \InvalidArgumentException If $content is empty.
[ "Set", "the", "content", "of", "the", "interaction", "containing", "the", "hottext", "areas", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/interactions/HottextInteraction.php#L171-L179
oat-sa/qti-sdk
src/qtism/data/content/interactions/Interaction.php
Interaction.setResponseIdentifier
public function setResponseIdentifier($responseIdentifier) { if (Format::isIdentifier($responseIdentifier, false) === true) { $this->responseIdentifier = $responseIdentifier; } else { $msg = "The 'responseIdentifier' argument must be a valid QTI identifier."; thro...
php
public function setResponseIdentifier($responseIdentifier) { if (Format::isIdentifier($responseIdentifier, false) === true) { $this->responseIdentifier = $responseIdentifier; } else { $msg = "The 'responseIdentifier' argument must be a valid QTI identifier."; thro...
[ "public", "function", "setResponseIdentifier", "(", "$", "responseIdentifier", ")", "{", "if", "(", "Format", "::", "isIdentifier", "(", "$", "responseIdentifier", ",", "false", ")", "===", "true", ")", "{", "$", "this", "->", "responseIdentifier", "=", "$", ...
Set the response variable associated with the interaction. @param string $responseIdentifier A QTI identifier. @throws \InvalidArgumentException If $responseIdentifier is not a valid QTI identifier.
[ "Set", "the", "response", "variable", "associated", "with", "the", "interaction", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/interactions/Interaction.php#L93-L101
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/ContainsProcessor.php
ContainsProcessor.process
public function process() { $operands = $this->getOperands(); if ($operands->containsNull()) { return null; } if ($operands->exclusivelyMultipleOrOrdered() === false) { $msg = "The Contains Expression only accept operands with multiple or ordered cardinality...
php
public function process() { $operands = $this->getOperands(); if ($operands->containsNull()) { return null; } if ($operands->exclusivelyMultipleOrOrdered() === false) { $msg = "The Contains Expression only accept operands with multiple or ordered cardinality...
[ "public", "function", "process", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "if", "(", "$", "operands", "->", "containsNull", "(", ")", ")", "{", "return", "null", ";", "}", "if", "(", "$", "operands", "->...
Returns the logical negation of the sub-expressions. @return boolean @throws \qtism\runtime\expressions\operators\OperatorProcessingException
[ "Returns", "the", "logical", "negation", "of", "the", "sub", "-", "expressions", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/ContainsProcessor.php#L54-L120
oat-sa/qti-sdk
src/qtism/data/storage/xml/Utils.php
Utils.getSchemaLocation
static public function getSchemaLocation($version = '2.1') { $version = Version::appendPatchVersion($version); if ($version === '2.1.0') { $filename = dirname(__FILE__) . '/schemes/qtiv2p1/imsqti_v2p1.xsd'; } elseif ($version === '2.1.1') { $filename = dirnam...
php
static public function getSchemaLocation($version = '2.1') { $version = Version::appendPatchVersion($version); if ($version === '2.1.0') { $filename = dirname(__FILE__) . '/schemes/qtiv2p1/imsqti_v2p1.xsd'; } elseif ($version === '2.1.1') { $filename = dirnam...
[ "static", "public", "function", "getSchemaLocation", "(", "$", "version", "=", "'2.1'", ")", "{", "$", "version", "=", "Version", "::", "appendPatchVersion", "(", "$", "version", ")", ";", "if", "(", "$", "version", "===", "'2.1.0'", ")", "{", "$", "file...
Get the XML schema to use for a given QTI version. @return string A filename pointing at an XML Schema file.
[ "Get", "the", "XML", "schema", "to", "use", "for", "a", "given", "QTI", "version", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/Utils.php#L43-L60
oat-sa/qti-sdk
src/qtism/data/storage/xml/Utils.php
Utils.inferVersion
static public function inferVersion(DOMDocument $document) { $root = $document->documentElement; $version = false; if (empty($root) === false) { $rootNs = $root->namespaceURI; if ($rootNs === 'http://www.imsglobal.org/xsd/imsqti_v2p0') { ...
php
static public function inferVersion(DOMDocument $document) { $root = $document->documentElement; $version = false; if (empty($root) === false) { $rootNs = $root->namespaceURI; if ($rootNs === 'http://www.imsglobal.org/xsd/imsqti_v2p0') { ...
[ "static", "public", "function", "inferVersion", "(", "DOMDocument", "$", "document", ")", "{", "$", "root", "=", "$", "document", "->", "documentElement", ";", "$", "version", "=", "false", ";", "if", "(", "empty", "(", "$", "root", ")", "===", "false", ...
Infer the QTI version from a given DOM $document in a Semantic Versioning format always containing a MAJOR, MINOR and PATCH version. @param \DOMDocument $document @return string|boolean A QTI version number if it could be infered, false otherwise.
[ "Infer", "the", "QTI", "version", "from", "a", "given", "DOM", "$document", "in", "a", "Semantic", "Versioning", "format", "always", "containing", "a", "MAJOR", "MINOR", "and", "PATCH", "version", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/Utils.php#L69-L109
oat-sa/qti-sdk
src/qtism/data/storage/xml/Utils.php
Utils.getXsdLocation
static public function getXsdLocation(DOMDocument $document, $namespaceUri) { $root = $document->documentElement; $location = false; if (empty($root) === false) { $schemaLocation = $root->getAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'schemaLocation'); ...
php
static public function getXsdLocation(DOMDocument $document, $namespaceUri) { $root = $document->documentElement; $location = false; if (empty($root) === false) { $schemaLocation = $root->getAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'schemaLocation'); ...
[ "static", "public", "function", "getXsdLocation", "(", "DOMDocument", "$", "document", ",", "$", "namespaceUri", ")", "{", "$", "root", "=", "$", "document", "->", "documentElement", ";", "$", "location", "=", "false", ";", "if", "(", "empty", "(", "$", ...
Get the location of an XML Schema Definition file from a given namespace. This utility method enables you to know what is the location of an XML Schema Definition file to be used to validate a $document for a given target namespace. @param DOMDocument $document A DOMDocument object. @param string $namespaceUri A Name...
[ "Get", "the", "location", "of", "an", "XML", "Schema", "Definition", "file", "from", "a", "given", "namespace", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/Utils.php#L121-L143
oat-sa/qti-sdk
src/qtism/data/storage/xml/Utils.php
Utils.changeElementName
static public function changeElementName(DOMElement $element, $name) { $newElement = $element->ownerDocument->createElement($name); foreach ($element->childNodes as $child) { $child = $element->ownerDocument->importNode($child, true); $newElement->appendChild($child); ...
php
static public function changeElementName(DOMElement $element, $name) { $newElement = $element->ownerDocument->createElement($name); foreach ($element->childNodes as $child) { $child = $element->ownerDocument->importNode($child, true); $newElement->appendChild($child); ...
[ "static", "public", "function", "changeElementName", "(", "DOMElement", "$", "element", ",", "$", "name", ")", "{", "$", "newElement", "=", "$", "element", "->", "ownerDocument", "->", "createElement", "(", "$", "name", ")", ";", "foreach", "(", "$", "elem...
Change the name of $element into $name. @param \DOMElement $element A DOMElement object you want to change the name. @param string $name The new name of $element. @return \DOMElement
[ "Change", "the", "name", "of", "$element", "into", "$name", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/Utils.php#L153-L174
oat-sa/qti-sdk
src/qtism/data/storage/xml/Utils.php
Utils.anonimizeElement
static public function anonimizeElement(DOMElement $element) { $stack = new SplStack(); $traversed = array(); $children = array(); $stack->push($element); while ($stack->count() > 0) { $node = $stack->pop(); if ($node->nodeType === XML_ELEMENT_NODE ...
php
static public function anonimizeElement(DOMElement $element) { $stack = new SplStack(); $traversed = array(); $children = array(); $stack->push($element); while ($stack->count() > 0) { $node = $stack->pop(); if ($node->nodeType === XML_ELEMENT_NODE ...
[ "static", "public", "function", "anonimizeElement", "(", "DOMElement", "$", "element", ")", "{", "$", "stack", "=", "new", "SplStack", "(", ")", ";", "$", "traversed", "=", "array", "(", ")", ";", "$", "children", "=", "array", "(", ")", ";", "$", "s...
Anonimize a given DOMElement. By 'anonimize', we mean remove all namespace membership of an element and its child nodes. For instance, <m:math display="inline"><m:mi>x</m:mi></m:math> becomes <math display="inline"><mi>x</mi></math>. @param \DOMElement $element The DOMElement to be anonimized. @return \DOMElement The...
[ "Anonimize", "a", "given", "DOMElement", ".", "By", "anonimize", "we", "mean", "remove", "all", "namespace", "membership", "of", "an", "element", "and", "its", "child", "nodes", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/Utils.php#L186-L225
oat-sa/qti-sdk
src/qtism/data/storage/xml/Utils.php
Utils.importChildNodes
static public function importChildNodes(DOMElement $from, DOMElement $into, $deep = true) { for ($i = 0; $i < $from->childNodes->length; $i++) { $node = $into->ownerDocument->importNode($from->childNodes->item($i), $deep); $into->appendChild($node); } }
php
static public function importChildNodes(DOMElement $from, DOMElement $into, $deep = true) { for ($i = 0; $i < $from->childNodes->length; $i++) { $node = $into->ownerDocument->importNode($from->childNodes->item($i), $deep); $into->appendChild($node); } }
[ "static", "public", "function", "importChildNodes", "(", "DOMElement", "$", "from", ",", "DOMElement", "$", "into", ",", "$", "deep", "=", "true", ")", "{", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "$", "from", "->", "childNodes", "->", ...
Import all the child nodes of DOMElement $from to DOMElement $into. @param \DOMElement $from The source DOMElement. @param \DOMElement $into The target DOMElement. @param boolean $deep Whether or not to import the whole node hierarchy.
[ "Import", "all", "the", "child", "nodes", "of", "DOMElement", "$from", "to", "DOMElement", "$into", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/Utils.php#L234-L240
oat-sa/qti-sdk
src/qtism/data/storage/xml/Utils.php
Utils.importAttributes
static public function importAttributes(DOMElement $from, DOMElement $into) { for ($i = 0; $i < $from->attributes->length; $i++) { $attr = $from->attributes->item($i); if ($attr->localName !== 'schemaLocation') { if (empty($attr->namespaceURI) === false) { ...
php
static public function importAttributes(DOMElement $from, DOMElement $into) { for ($i = 0; $i < $from->attributes->length; $i++) { $attr = $from->attributes->item($i); if ($attr->localName !== 'schemaLocation') { if (empty($attr->namespaceURI) === false) { ...
[ "static", "public", "function", "importAttributes", "(", "DOMElement", "$", "from", ",", "DOMElement", "$", "into", ")", "{", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "$", "from", "->", "attributes", "->", "length", ";", "$", "i", "++", ...
Import (gracefully i.e. by respecting namespaces) the attributes of DOMElement $from to DOMElement $into. @param \DOMElement $from The source DOMElement. @param \DOMElement $into The target DOMElement.
[ "Import", "(", "gracefully", "i", ".", "e", ".", "by", "respecting", "namespaces", ")", "the", "attributes", "of", "DOMElement", "$from", "to", "DOMElement", "$into", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/Utils.php#L249-L263
oat-sa/qti-sdk
src/qtism/data/storage/xml/Utils.php
Utils.escapeXmlSpecialChars
static public function escapeXmlSpecialChars($string, $isAttribute = false) { if ($isAttribute === false) { $fullSearch = array('"', "'", '<', '>'); $fullReplace = array('&quot;', '&apos;', '&lt;', '&gt;'); $string = str_replace('&', '&amp;', $string); $string...
php
static public function escapeXmlSpecialChars($string, $isAttribute = false) { if ($isAttribute === false) { $fullSearch = array('"', "'", '<', '>'); $fullReplace = array('&quot;', '&apos;', '&lt;', '&gt;'); $string = str_replace('&', '&amp;', $string); $string...
[ "static", "public", "function", "escapeXmlSpecialChars", "(", "$", "string", ",", "$", "isAttribute", "=", "false", ")", "{", "if", "(", "$", "isAttribute", "===", "false", ")", "{", "$", "fullSearch", "=", "array", "(", "'\"'", ",", "\"'\"", ",", "'<'",...
Escape XML Special characters from a given string. The list below describe each escaped character and its replacement. * " --> &quot; * ' --> &apos; * < --> &lt; * > --> $gt; * & --> &amp; @param string $string An input string. @param boolean $isAttribute Whether or not to escape ', >, < which do not have to be esca...
[ "Escape", "XML", "Special", "characters", "from", "a", "given", "string", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/Utils.php#L280-L293
oat-sa/qti-sdk
src/qtism/data/storage/xml/Utils.php
Utils.qtiFriendlyName
static public function qtiFriendlyName($wcName) { $qtiName = strtolower($wcName); $qtiName = preg_replace('/^qti-/', '', $qtiName); return lcfirst(str_replace('-', '', ucwords($qtiName, '-'))); }
php
static public function qtiFriendlyName($wcName) { $qtiName = strtolower($wcName); $qtiName = preg_replace('/^qti-/', '', $qtiName); return lcfirst(str_replace('-', '', ucwords($qtiName, '-'))); }
[ "static", "public", "function", "qtiFriendlyName", "(", "$", "wcName", ")", "{", "$", "qtiName", "=", "strtolower", "(", "$", "wcName", ")", ";", "$", "qtiName", "=", "preg_replace", "(", "'/^qti-/'", ",", "''", ",", "$", "qtiName", ")", ";", "return", ...
QTI friendly name of a Web Component friendly name. This method returns the QTI friendly name of a Web Component friendly name. Example: "qti-choice-interaction" becomes "choiceInteraction". @param string $wcName @return string
[ "QTI", "friendly", "name", "of", "a", "Web", "Component", "friendly", "name", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/Utils.php#L335-L341
oat-sa/qti-sdk
src/qtism/data/storage/xml/Utils.php
Utils.getDOMElementAttributeAs
public static function getDOMElementAttributeAs(DOMElement $element, $attribute, $datatype = 'string') { $attr = $element->getAttribute($attribute); if ($attr !== '') { switch ($datatype) { case 'string': return $attr; break; ...
php
public static function getDOMElementAttributeAs(DOMElement $element, $attribute, $datatype = 'string') { $attr = $element->getAttribute($attribute); if ($attr !== '') { switch ($datatype) { case 'string': return $attr; break; ...
[ "public", "static", "function", "getDOMElementAttributeAs", "(", "DOMElement", "$", "element", ",", "$", "attribute", ",", "$", "datatype", "=", "'string'", ")", "{", "$", "attr", "=", "$", "element", "->", "getAttribute", "(", "$", "attribute", ")", ";", ...
Get the attribute value of a given DOMElement object, cast in a given datatype. @param DOMElement $element The element the attribute you want to retrieve the value is bound to. @param string $attribute The attribute name. @param string $datatype The returned datatype. Accepted values are 'string', 'integer', 'float', ...
[ "Get", "the", "attribute", "value", "of", "a", "given", "DOMElement", "object", "cast", "in", "a", "given", "datatype", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/Utils.php#L352-L385
oat-sa/qti-sdk
src/qtism/data/storage/xml/Utils.php
Utils.setDOMElementAttribute
public static function setDOMElementAttribute(DOMElement $element, $attribute, $value) { switch (gettype($value)) { case 'boolean': $element->setAttribute($attribute, ($value === true) ? 'true' : 'false'); break; default: $...
php
public static function setDOMElementAttribute(DOMElement $element, $attribute, $value) { switch (gettype($value)) { case 'boolean': $element->setAttribute($attribute, ($value === true) ? 'true' : 'false'); break; default: $...
[ "public", "static", "function", "setDOMElementAttribute", "(", "DOMElement", "$", "element", ",", "$", "attribute", ",", "$", "value", ")", "{", "switch", "(", "gettype", "(", "$", "value", ")", ")", "{", "case", "'boolean'", ":", "$", "element", "->", "...
Set the attribute value of a given DOMElement object. Boolean values will be transformed @param DOMElement $element A DOMElement object. @param string $attribute An XML attribute name. @param mixed $value A given value.
[ "Set", "the", "attribute", "value", "of", "a", "given", "DOMElement", "object", ".", "Boolean", "values", "will", "be", "transformed" ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/Utils.php#L394-L405
oat-sa/qti-sdk
src/qtism/data/storage/xml/Utils.php
Utils.getChildElementsByTagName
public static function getChildElementsByTagName($element, $tagName, $exclude = false, $withText = false) { if (!is_array($tagName)) { $tagName = array($tagName); } $rawElts = self::getChildElements($element, $withText); $returnValue = array(); f...
php
public static function getChildElementsByTagName($element, $tagName, $exclude = false, $withText = false) { if (!is_array($tagName)) { $tagName = array($tagName); } $rawElts = self::getChildElements($element, $withText); $returnValue = array(); f...
[ "public", "static", "function", "getChildElementsByTagName", "(", "$", "element", ",", "$", "tagName", ",", "$", "exclude", "=", "false", ",", "$", "withText", "=", "false", ")", "{", "if", "(", "!", "is_array", "(", "$", "tagName", ")", ")", "{", "$",...
Get the child elements of a given element by tag name. This method does not behave like DOMElement::getElementsByTagName. It only returns the direct child elements that matches $tagName but does not go recursive. @param DOMElement $element A DOMElement object. @param mixed $tagName The name of the tags you would like ...
[ "Get", "the", "child", "elements", "of", "a", "given", "element", "by", "tag", "name", ".", "This", "method", "does", "not", "behave", "like", "DOMElement", "::", "getElementsByTagName", ".", "It", "only", "returns", "the", "direct", "child", "elements", "th...
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/Utils.php#L418-L434
oat-sa/qti-sdk
src/qtism/data/storage/xml/Utils.php
Utils.getChildElements
public static function getChildElements($element, $withText = false) { $children = $element->childNodes; $returnValue = array(); for ($i = 0; $i < $children->length; $i++) { if ($children->item($i)->nodeType === XML_ELEMENT_NODE || ($withText === true && ($children->item...
php
public static function getChildElements($element, $withText = false) { $children = $element->childNodes; $returnValue = array(); for ($i = 0; $i < $children->length; $i++) { if ($children->item($i)->nodeType === XML_ELEMENT_NODE || ($withText === true && ($children->item...
[ "public", "static", "function", "getChildElements", "(", "$", "element", ",", "$", "withText", "=", "false", ")", "{", "$", "children", "=", "$", "element", "->", "childNodes", ";", "$", "returnValue", "=", "array", "(", ")", ";", "for", "(", "$", "i",...
Get the children DOM Nodes with nodeType attribute equals to XML_ELEMENT_NODE. @param DOMElement $element A DOMElement object. @param boolean $withText Wether text nodes must be returned or not. @return array An array of DOMNode objects.
[ "Get", "the", "children", "DOM", "Nodes", "with", "nodeType", "attribute", "equals", "to", "XML_ELEMENT_NODE", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/Utils.php#L443-L455
oat-sa/qti-sdk
src/qtism/data/content/xhtml/tables/Tbody.php
Tbody.setContent
public function setContent(TrCollection $content) { if (count($content) > 0) { $this->content = $content; } else { $msg = "A Tbody object must be composed of at least 1 Tr object, none given."; throw new InvalidArgumentException($msg); } }
php
public function setContent(TrCollection $content) { if (count($content) > 0) { $this->content = $content; } else { $msg = "A Tbody object must be composed of at least 1 Tr object, none given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setContent", "(", "TrCollection", "$", "content", ")", "{", "if", "(", "count", "(", "$", "content", ")", ">", "0", ")", "{", "$", "this", "->", "content", "=", "$", "content", ";", "}", "else", "{", "$", "msg", "=", "\"A Tbo...
Set the collection of Tr objects composing the Tbody. @param \qtism\data\content\xhtml\tables\TrCollection $content A non-empty TrCollection object. @throws \InvalidArgumentException If $components is empty.
[ "Set", "the", "collection", "of", "Tr", "objects", "composing", "the", "Tbody", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/xhtml/tables/Tbody.php#L66-L74
oat-sa/qti-sdk
src/qtism/data/storage/php/marshalling/PhpScalarMarshaller.php
PhpScalarMarshaller.marshall
public function marshall() { $ctx = $this->getContext(); $streamAccess = $ctx->getStreamAccess(); try { $scalar = $this->getToMarshall(); $varName = $this->getContext()->generateVariableName($scalar); $streamAccess->writeVariable($varName); $...
php
public function marshall() { $ctx = $this->getContext(); $streamAccess = $ctx->getStreamAccess(); try { $scalar = $this->getToMarshall(); $varName = $this->getContext()->generateVariableName($scalar); $streamAccess->writeVariable($varName); $...
[ "public", "function", "marshall", "(", ")", "{", "$", "ctx", "=", "$", "this", "->", "getContext", "(", ")", ";", "$", "streamAccess", "=", "$", "ctx", "->", "getStreamAccess", "(", ")", ";", "try", "{", "$", "scalar", "=", "$", "this", "->", "getT...
Marshall the PHP scalar value to be marshalled into PHP source code. @throws \qtism\data\storage\php\marshalling\PhpMarshallingException If an error occurs while marshalling.
[ "Marshall", "the", "PHP", "scalar", "value", "to", "be", "marshalled", "into", "PHP", "source", "code", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/php/marshalling/PhpScalarMarshaller.php#L63-L82
oat-sa/qti-sdk
src/qtism/runtime/common/AbstractEngine.php
AbstractEngine.trace
protected function trace($message) { $item = new StackTraceItem($this->getComponent(), $message); $this->stackTrace->push($item); }
php
protected function trace($message) { $item = new StackTraceItem($this->getComponent(), $message); $this->stackTrace->push($item); }
[ "protected", "function", "trace", "(", "$", "message", ")", "{", "$", "item", "=", "new", "StackTraceItem", "(", "$", "this", "->", "getComponent", "(", ")", ",", "$", "message", ")", ";", "$", "this", "->", "stackTrace", "->", "push", "(", "$", "ite...
Add an entry in the stack trace about the QtiComponent being processed. @param string $message A trace message.
[ "Add", "an", "entry", "in", "the", "stack", "trace", "about", "the", "QtiComponent", "being", "processed", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/common/AbstractEngine.php#L140-L144
oat-sa/qti-sdk
src/qtism/runtime/common/ResponseVariable.php
ResponseVariable.setCorrectResponse
public function setCorrectResponse(QtiDatatype $correctResponse = null) { if ($correctResponse === null) { $this->correctResponse = null; } elseif (Utils::isBaseTypeCompliant($this->getBaseType(), $correctResponse) === true && Utils::isCardinalityCompliant($this->getCardinality(), $corre...
php
public function setCorrectResponse(QtiDatatype $correctResponse = null) { if ($correctResponse === null) { $this->correctResponse = null; } elseif (Utils::isBaseTypeCompliant($this->getBaseType(), $correctResponse) === true && Utils::isCardinalityCompliant($this->getCardinality(), $corre...
[ "public", "function", "setCorrectResponse", "(", "QtiDatatype", "$", "correctResponse", "=", "null", ")", "{", "if", "(", "$", "correctResponse", "===", "null", ")", "{", "$", "this", "->", "correctResponse", "=", "null", ";", "}", "elseif", "(", "Utils", ...
Set the correct response. @param \qtism\common\datatypes\QtiDatatype|null $correctResponse A QtiDatatype object or null. @throws \InvalidArgumentException If $correctResponse does not match baseType and/or cardinality of the variable.
[ "Set", "the", "correct", "response", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/common/ResponseVariable.php#L97-L107
oat-sa/qti-sdk
src/qtism/runtime/common/ResponseVariable.php
ResponseVariable.isCorrect
public function isCorrect() { if ($this->hasCorrectResponse() === true) { $correctResponse = $this->getCorrectResponse(); if ($correctResponse instanceof Comparable) { return $correctResponse->equals($this->getValue()); } else { return $co...
php
public function isCorrect() { if ($this->hasCorrectResponse() === true) { $correctResponse = $this->getCorrectResponse(); if ($correctResponse instanceof Comparable) { return $correctResponse->equals($this->getValue()); } else { return $co...
[ "public", "function", "isCorrect", "(", ")", "{", "if", "(", "$", "this", "->", "hasCorrectResponse", "(", ")", "===", "true", ")", "{", "$", "correctResponse", "=", "$", "this", "->", "getCorrectResponse", "(", ")", ";", "if", "(", "$", "correctResponse...
Whether the value of the ResponseVariable matches its correct response. @return boolean
[ "Whether", "the", "value", "of", "the", "ResponseVariable", "matches", "its", "correct", "response", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/common/ResponseVariable.php#L175-L188
oat-sa/qti-sdk
src/qtism/runtime/common/ResponseVariable.php
ResponseVariable.createFromDataModel
public static function createFromDataModel(VariableDeclaration $variableDeclaration) { $variable = parent::createFromDataModel($variableDeclaration); if ($variableDeclaration instanceof ResponseDeclaration) { $variable->setMapping($variableDeclaration->getMapping()); $varia...
php
public static function createFromDataModel(VariableDeclaration $variableDeclaration) { $variable = parent::createFromDataModel($variableDeclaration); if ($variableDeclaration instanceof ResponseDeclaration) { $variable->setMapping($variableDeclaration->getMapping()); $varia...
[ "public", "static", "function", "createFromDataModel", "(", "VariableDeclaration", "$", "variableDeclaration", ")", "{", "$", "variable", "=", "parent", "::", "createFromDataModel", "(", "$", "variableDeclaration", ")", ";", "if", "(", "$", "variableDeclaration", "i...
Create a ResponseVariable object from its data model representation. @param \qtism\data\state\VariableDeclaration $variableDeclaration @throws \InvalidArgumentException @return \qtism\runtime\common\ResponseVariable
[ "Create", "a", "ResponseVariable", "object", "from", "its", "data", "model", "representation", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/common/ResponseVariable.php#L197-L221
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/MathOperatorProcessor.php
MathOperatorProcessor.process
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->exclusivelySingle() === false) { $msg = "The MathOperator operator only accepts operands with a single cardinality."; ...
php
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->exclusivelySingle() === false) { $msg = "The MathOperator operator only accepts operands with a single cardinality."; ...
[ "public", "function", "process", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "if", "(", "$", "operands", "->", "containsNull", "(", ")", "===", "true", ")", "{", "return", "null", ";", "}", "if", "(", "$", ...
Process the MathOperator operator. @return float|integer|null The result of the MathOperator call or NULL if any of the sub-expressions is NULL. See the class documentation for special cases.
[ "Process", "the", "MathOperator", "operator", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/MathOperatorProcessor.php#L85-L113
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/MathOperatorProcessor.php
MathOperatorProcessor.processSignum
protected function processSignum() { $operands = $this->getOperands(); $operand = $operands[0]; if (is_nan($operand->getValue())) { return null; } elseif ($operand->getValue() < 0) { return new QtiInteger(-1); } elseif ($operand->getValue() > 0) { ...
php
protected function processSignum() { $operands = $this->getOperands(); $operand = $operands[0]; if (is_nan($operand->getValue())) { return null; } elseif ($operand->getValue() < 0) { return new QtiInteger(-1); } elseif ($operand->getValue() > 0) { ...
[ "protected", "function", "processSignum", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "$", "operand", "=", "$", "operands", "[", "0", "]", ";", "if", "(", "is_nan", "(", "$", "operand", "->", "getValue", "(",...
Process the signum (a.k.a. sign) function. @link https://en.wikipedia.org/wiki/Sign_function
[ "Process", "the", "signum", "(", "a", ".", "k", ".", "a", ".", "sign", ")", "function", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/MathOperatorProcessor.php#L445-L459
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/MathConstantMarshaller.php
MathConstantMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'name', MathEnumeration::getNameByConstant($component->getName())); return $element; }
php
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'name', MathEnumeration::getNameByConstant($component->getName())); return $element; }
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "static", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "$", "component", "->", "getQtiClassName", "(", ")", ")", ";", "$", "this", "->...
Marshall a MathConstant object into a DOMElement object. @param \qtism\data\QtiComponent $component A MathConstant object. @return \DOMElement The according DOMElement object.
[ "Marshall", "a", "MathConstant", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/MathConstantMarshaller.php#L44-L51
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/MathConstantMarshaller.php
MathConstantMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { if (($name = $this->getDOMElementAttributeAs($element, 'name')) !== null) { if (($cst = MathEnumeration::getConstantByName($name)) !== false) { $object = new MathConstant($cst); return $object; } el...
php
protected function unmarshall(DOMElement $element) { if (($name = $this->getDOMElementAttributeAs($element, 'name')) !== null) { if (($cst = MathEnumeration::getConstantByName($name)) !== false) { $object = new MathConstant($cst); return $object; } el...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "if", "(", "(", "$", "name", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'name'", ")", ")", "!==", "null", ")", "{", "if", "(", "(", ...
Unmarshall a DOMElement object corresponding to a QTI mathConstant element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A MathConstant object. @throws \UnmarshallingException If the mandatory attribute 'name' is missing.
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "mathConstant", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/MathConstantMarshaller.php#L60-L75
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/RoundToProcessor.php
RoundToProcessor.process
public function process() { $operands = $this->getOperands(); $state = $this->getState(); $operand = $operands[0]; // If the value is null, return null. if ($operands->containsNull()) { return null; } if (!$operands->exclusivelySingle()) { ...
php
public function process() { $operands = $this->getOperands(); $state = $this->getState(); $operand = $operands[0]; // If the value is null, return null. if ($operands->containsNull()) { return null; } if (!$operands->exclusivelySingle()) { ...
[ "public", "function", "process", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "$", "state", "=", "$", "this", "->", "getState", "(", ")", ";", "$", "operand", "=", "$", "operands", "[", "0", "]", ";", "// ...
Process the RoundTo operator. An OperatorProcessingException will be thrown if: * The given operand is not a numeric value. * The cardinality of the operand is not single. * The value of the 'figures' attribute comes from a templateVariable which does not exist or is not numeric or null. @return null|float A single ...
[ "Process", "the", "RoundTo", "operator", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/RoundToProcessor.php#L75-L151
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/WeightMarshaller.php
WeightMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { // identifier is a mandatory value. if (($identifier = $this->getDOMElementAttributeAs($element, 'identifier', 'string')) !== null) { if (($value = $this->getDOMElementAttributeAs($element, 'value', 'string')) !== null) { ...
php
protected function unmarshall(DOMElement $element) { // identifier is a mandatory value. if (($identifier = $this->getDOMElementAttributeAs($element, 'identifier', 'string')) !== null) { if (($value = $this->getDOMElementAttributeAs($element, 'value', 'string')) !== null) { ...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "// identifier is a mandatory value.", "if", "(", "(", "$", "identifier", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'identifier'", ",", "'strin...
Unmarshall a DOMElement object corresponding to a QTI weight element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A Weight object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException If the mandatory attributes 'identifier' or 'value' are missing from $element but a...
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "weight", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/WeightMarshaller.php#L62-L88
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/TimeLimitsMarshaller.php
TimeLimitsMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); if ($component->hasMinTime() === true) { $this->setDOMElementAttribute($element, 'minTime', $component->getMinTime()->getSeconds(true)); } ...
php
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); if ($component->hasMinTime() === true) { $this->setDOMElementAttribute($element, 'minTime', $component->getMinTime()->getSeconds(true)); } ...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "static", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "$", "component", "->", "getQtiClassName", "(", ")", ")", ";", "if", "(", "$", ...
Marshall a TimeLimits object into a DOMElement object. @param \qtism\data\QtiComponent $component A TimeLimits object. @return \DOMElement The according DOMElement object.
[ "Marshall", "a", "TimeLimits", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/TimeLimitsMarshaller.php#L45-L60
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/TimeLimitsMarshaller.php
TimeLimitsMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { $object = new TimeLimits(); if (($value = $this->getDOMElementAttributeAs($element, 'minTime', 'string')) !== null) { $object->setMinTime(StorageUtils::stringToDatatype("PT${value}S", BaseType::DURATION)); } if (($val...
php
protected function unmarshall(DOMElement $element) { $object = new TimeLimits(); if (($value = $this->getDOMElementAttributeAs($element, 'minTime', 'string')) !== null) { $object->setMinTime(StorageUtils::stringToDatatype("PT${value}S", BaseType::DURATION)); } if (($val...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "$", "object", "=", "new", "TimeLimits", "(", ")", ";", "if", "(", "(", "$", "value", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'minT...
Unmarshall a DOMElement object corresponding to a QTI timeLimits element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A TimeLimits object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException If the attribute 'allowLateSubmission' is not a valid boolean value.
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "timeLimits", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/TimeLimitsMarshaller.php#L69-L86
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/OperandsCollection.php
OperandsCollection.checkType
protected function checkType($value) { if (RuntimeUtils::isQtiScalarDatatypeCompliant($value)) { return; } else { $value = (gettype($value) === 'object') ? get_class($value) : $value; $msg = "The OperandsCollection only accepts QTI Runtime compliant values, '" . $...
php
protected function checkType($value) { if (RuntimeUtils::isQtiScalarDatatypeCompliant($value)) { return; } else { $value = (gettype($value) === 'object') ? get_class($value) : $value; $msg = "The OperandsCollection only accepts QTI Runtime compliant values, '" . $...
[ "protected", "function", "checkType", "(", "$", "value", ")", "{", "if", "(", "RuntimeUtils", "::", "isQtiScalarDatatypeCompliant", "(", "$", "value", ")", ")", "{", "return", ";", "}", "else", "{", "$", "value", "=", "(", "gettype", "(", "$", "value", ...
Check if $value is a QTI Runtime compliant value. @throws \InvalidArgumentException If $value is not a QTI Runtime compliant value.
[ "Check", "if", "$value", "is", "a", "QTI", "Runtime", "compliant", "value", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/OperandsCollection.php#L55-L64
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/OperandsCollection.php
OperandsCollection.containsNull
public function containsNull() { foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if ($v instanceof Container && $v->isNull()) { return true; } elseif (($v instanceof QtiString && $v->getValue() === '') || is_null($v)) { ...
php
public function containsNull() { foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if ($v instanceof Container && $v->isNull()) { return true; } elseif (($v instanceof QtiString && $v->getValue() === '') || is_null($v)) { ...
[ "public", "function", "containsNull", "(", ")", "{", "foreach", "(", "array_keys", "(", "$", "this", "->", "getDataPlaceHolder", "(", ")", ")", "as", "$", "key", ")", "{", "$", "v", "=", "$", "this", "[", "$", "key", "]", ";", "if", "(", "$", "v"...
Wether the collection contains a QTI Runtime compliant value which is considered to be NULL. * If the collection of operands is empty, true is returned. * If the collection of operands contains null, an empty container, or an empty string, true is returned. * In any other case, false is returned. @return boolean
[ "Wether", "the", "collection", "contains", "a", "QTI", "Runtime", "compliant", "value", "which", "is", "considered", "to", "be", "NULL", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/OperandsCollection.php#L76-L88
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/OperandsCollection.php
OperandsCollection.exclusivelyBoolean
public function exclusivelyBoolean() { if (count($this) === 0) { return false; } foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if (($v instanceof MultipleContainer || $v instanceof OrderedContainer) && ($v->isNull() || $v->...
php
public function exclusivelyBoolean() { if (count($this) === 0) { return false; } foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if (($v instanceof MultipleContainer || $v instanceof OrderedContainer) && ($v->isNull() || $v->...
[ "public", "function", "exclusivelyBoolean", "(", ")", "{", "if", "(", "count", "(", "$", "this", ")", "===", "0", ")", "{", "return", "false", ";", "}", "foreach", "(", "array_keys", "(", "$", "this", "->", "getDataPlaceHolder", "(", ")", ")", "as", ...
Wether the collection contains exclusively boolean values or containers. * If the collection of operands is empty, false is returned. * If the collection of operands contains a NULL value or a NULL container, false is returned. * If the collection of operands contains a value or container which is not boolean, false i...
[ "Wether", "the", "collection", "contains", "exclusively", "boolean", "values", "or", "containers", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/OperandsCollection.php#L130-L146
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/OperandsCollection.php
OperandsCollection.exclusivelySingle
public function exclusivelySingle() { if (count($this) === 0) { return false; } foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if (is_null($v) || $v instanceof Container) { return false; } ...
php
public function exclusivelySingle() { if (count($this) === 0) { return false; } foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if (is_null($v) || $v instanceof Container) { return false; } ...
[ "public", "function", "exclusivelySingle", "(", ")", "{", "if", "(", "count", "(", "$", "this", ")", "===", "0", ")", "{", "return", "false", ";", "}", "foreach", "(", "array_keys", "(", "$", "this", "->", "getDataPlaceHolder", "(", ")", ")", "as", "...
Wether the collection contains exclusively single cardinality values. If the container is empty or contains a null value, false is returned. @return boolean
[ "Wether", "the", "collection", "contains", "exclusively", "single", "cardinality", "values", ".", "If", "the", "container", "is", "empty", "or", "contains", "a", "null", "value", "false", "is", "returned", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/OperandsCollection.php#L154-L168
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/OperandsCollection.php
OperandsCollection.exclusivelyString
public function exclusivelyString() { if (count($this) === 0) { return false; } foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if (($v instanceof MultipleContainer || $v instanceof OrderedContainer) && ($v->isNull() || $v->g...
php
public function exclusivelyString() { if (count($this) === 0) { return false; } foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if (($v instanceof MultipleContainer || $v instanceof OrderedContainer) && ($v->isNull() || $v->g...
[ "public", "function", "exclusivelyString", "(", ")", "{", "if", "(", "count", "(", "$", "this", ")", "===", "0", ")", "{", "return", "false", ";", "}", "foreach", "(", "array_keys", "(", "$", "this", "->", "getDataPlaceHolder", "(", ")", ")", "as", "...
Whether the collection is exclusively composed of string values: primitive or Containers. Please note that: * A primitive with the NULL value is not considered as a string. * An empty string is considered to be NULL and then not considered a valid string as per QTI 2.1 specification. * An empty Multiple/OrderedContain...
[ "Whether", "the", "collection", "is", "exclusively", "composed", "of", "string", "values", ":", "primitive", "or", "Containers", ".", "Please", "note", "that", ":" ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/OperandsCollection.php#L182-L198
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/OperandsCollection.php
OperandsCollection.exclusivelyMultipleOrOrdered
public function exclusivelyMultipleOrOrdered() { if (count($this) === 0) { return false; } foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if (!$v instanceof MultipleContainer && !$v instanceof OrderedContainer) { ...
php
public function exclusivelyMultipleOrOrdered() { if (count($this) === 0) { return false; } foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if (!$v instanceof MultipleContainer && !$v instanceof OrderedContainer) { ...
[ "public", "function", "exclusivelyMultipleOrOrdered", "(", ")", "{", "if", "(", "count", "(", "$", "this", ")", "===", "0", ")", "{", "return", "false", ";", "}", "foreach", "(", "array_keys", "(", "$", "this", "->", "getDataPlaceHolder", "(", ")", ")", ...
Whether the collection contains only MultipleContainer OR OrderedContainer. @return boolean
[ "Whether", "the", "collection", "contains", "only", "MultipleContainer", "OR", "OrderedContainer", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/OperandsCollection.php#L205-L219
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/OperandsCollection.php
OperandsCollection.exclusivelyInteger
public function exclusivelyInteger() { if (count($this) === 0) { return false; } foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if (($v instanceof MultipleContainer || $v instanceof OrderedContainer) && ($v->isNull() || $v->...
php
public function exclusivelyInteger() { if (count($this) === 0) { return false; } foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if (($v instanceof MultipleContainer || $v instanceof OrderedContainer) && ($v->isNull() || $v->...
[ "public", "function", "exclusivelyInteger", "(", ")", "{", "if", "(", "count", "(", "$", "this", ")", "===", "0", ")", "{", "return", "false", ";", "}", "foreach", "(", "array_keys", "(", "$", "this", "->", "getDataPlaceHolder", "(", ")", ")", "as", ...
Whether the collection is exclusively composed of integer values: primitive or Containers. Please note that: * A primitive with the NULL value is not considered as an integer. * Only integer primitives and non-NULL Multiple/OrderedContainer objects are considered valid integers. * If the the current OperandsCollection...
[ "Whether", "the", "collection", "is", "exclusively", "composed", "of", "integer", "values", ":", "primitive", "or", "Containers", ".", "Please", "note", "that", ":" ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/OperandsCollection.php#L231-L247
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/OperandsCollection.php
OperandsCollection.exclusivelySingleOrMultiple
public function exclusivelySingleOrMultiple() { if (count($this) === 0) { return false; } foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if ($v instanceof RecordContainer || $v instanceof OrderedContainer) { ...
php
public function exclusivelySingleOrMultiple() { if (count($this) === 0) { return false; } foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if ($v instanceof RecordContainer || $v instanceof OrderedContainer) { ...
[ "public", "function", "exclusivelySingleOrMultiple", "(", ")", "{", "if", "(", "count", "(", "$", "this", ")", "===", "0", ")", "{", "return", "false", ";", "}", "foreach", "(", "array_keys", "(", "$", "this", "->", "getDataPlaceHolder", "(", ")", ")", ...
Wether the collection contains only Single primitive values or MultipleContainer objects. * If the collection of operands is empty, false is returned. * If the collection of operands contains a RecordContainer object, false is returned. * If the collection of operands contains an OrderedContainer object, false is retu...
[ "Wether", "the", "collection", "contains", "only", "Single", "primitive", "values", "or", "MultipleContainer", "objects", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/OperandsCollection.php#L259-L274
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/OperandsCollection.php
OperandsCollection.exclusivelySingleOrOrdered
public function exclusivelySingleOrOrdered() { if (count($this) === 0) { return false; } foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if ($v instanceof RecordContainer || ($v instanceof MultipleContainer && $v->getCardina...
php
public function exclusivelySingleOrOrdered() { if (count($this) === 0) { return false; } foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if ($v instanceof RecordContainer || ($v instanceof MultipleContainer && $v->getCardina...
[ "public", "function", "exclusivelySingleOrOrdered", "(", ")", "{", "if", "(", "count", "(", "$", "this", ")", "===", "0", ")", "{", "return", "false", ";", "}", "foreach", "(", "array_keys", "(", "$", "this", "->", "getDataPlaceHolder", "(", ")", ")", ...
Wether the collection contains only Single primitive values or OrderedContainer objects. * If the collection of operands is empty, false is returned. * If the collection of operands contains a RecordContainer object, false is returned. * If the collection of operands contains a MultipleContainer object, false is retur...
[ "Wether", "the", "collection", "contains", "only", "Single", "primitive", "values", "or", "OrderedContainer", "objects", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/OperandsCollection.php#L286-L301
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/OperandsCollection.php
OperandsCollection.exclusivelyRecord
public function exclusivelyRecord() { if (count($this) === 0) { return false; } foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if (!$v instanceof RecordContainer) { return false; } } ...
php
public function exclusivelyRecord() { if (count($this) === 0) { return false; } foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if (!$v instanceof RecordContainer) { return false; } } ...
[ "public", "function", "exclusivelyRecord", "(", ")", "{", "if", "(", "count", "(", "$", "this", ")", "===", "0", ")", "{", "return", "false", ";", "}", "foreach", "(", "array_keys", "(", "$", "this", "->", "getDataPlaceHolder", "(", ")", ")", "as", "...
Whether the collection contains exclusively RecordContainer objects. * Returns false if the collection of operands is empty. * Returns false if any of the value contained in the collection of operands is not a RecordContainer object. * In any other case, returns true; @return boolean
[ "Whether", "the", "collection", "contains", "exclusively", "RecordContainer", "objects", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/OperandsCollection.php#L312-L326
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/OperandsCollection.php
OperandsCollection.exclusivelyOrdered
public function exclusivelyOrdered() { if (count($this) === 0) { return false; } foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if (!$v instanceof OrderedContainer) { return false; } } ...
php
public function exclusivelyOrdered() { if (count($this) === 0) { return false; } foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if (!$v instanceof OrderedContainer) { return false; } } ...
[ "public", "function", "exclusivelyOrdered", "(", ")", "{", "if", "(", "count", "(", "$", "this", ")", "===", "0", ")", "{", "return", "false", ";", "}", "foreach", "(", "array_keys", "(", "$", "this", "->", "getDataPlaceHolder", "(", ")", ")", "as", ...
Wether the collection contains exclusively OrderedContainer objects. * Returns false if the collection of operands is empty. * Returns false if any of the value contained in the collection of operands is not an OrderedContainer object. * Returns true in any other case. @return boolean
[ "Wether", "the", "collection", "contains", "exclusively", "OrderedContainer", "objects", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/OperandsCollection.php#L337-L351
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/OperandsCollection.php
OperandsCollection.anythingButRecord
public function anythingButRecord() { foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if ($v instanceof RecordContainer) { return false; } } return true; }
php
public function anythingButRecord() { foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if ($v instanceof RecordContainer) { return false; } } return true; }
[ "public", "function", "anythingButRecord", "(", ")", "{", "foreach", "(", "array_keys", "(", "$", "this", "->", "getDataPlaceHolder", "(", ")", ")", "as", "$", "key", ")", "{", "$", "v", "=", "$", "this", "[", "$", "key", "]", ";", "if", "(", "$", ...
Whether the collection contains anything but a RecordContainer object. @return boolean
[ "Whether", "the", "collection", "contains", "anything", "but", "a", "RecordContainer", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/OperandsCollection.php#L358-L368
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/OperandsCollection.php
OperandsCollection.sameBaseType
public function sameBaseType() { $operandsCount = count($this); if ($operandsCount > 0 && !$this->containsNull()) { // take the first value of the collection as a referer. $refValue = $this[0]; $refType = RuntimeUtils::inferBaseType($refValue); for (...
php
public function sameBaseType() { $operandsCount = count($this); if ($operandsCount > 0 && !$this->containsNull()) { // take the first value of the collection as a referer. $refValue = $this[0]; $refType = RuntimeUtils::inferBaseType($refValue); for (...
[ "public", "function", "sameBaseType", "(", ")", "{", "$", "operandsCount", "=", "count", "(", "$", "this", ")", ";", "if", "(", "$", "operandsCount", ">", "0", "&&", "!", "$", "this", "->", "containsNull", "(", ")", ")", "{", "// take the first value of ...
Whether the collection is composed of values with the same baseType. * If any of the values has not the same baseType than other values in the collection, false is returned. * If the OperandsCollection is an empty collection, false is returned. * If the OperandsCollection contains a value considered to be null, false ...
[ "Whether", "the", "collection", "is", "composed", "of", "values", "with", "the", "same", "baseType", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/OperandsCollection.php#L380-L403
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/OperandsCollection.php
OperandsCollection.sameCardinality
public function sameCardinality() { $operandsCount = count($this); if ($operandsCount > 0 && !$this->containsNull()) { $refType = RuntimeUtils::inferCardinality($this[0]); for ($i = 1; $i < $operandsCount; $i++) { if ($refType !== RuntimeUtils::inferCardinali...
php
public function sameCardinality() { $operandsCount = count($this); if ($operandsCount > 0 && !$this->containsNull()) { $refType = RuntimeUtils::inferCardinality($this[0]); for ($i = 1; $i < $operandsCount; $i++) { if ($refType !== RuntimeUtils::inferCardinali...
[ "public", "function", "sameCardinality", "(", ")", "{", "$", "operandsCount", "=", "count", "(", "$", "this", ")", ";", "if", "(", "$", "operandsCount", ">", "0", "&&", "!", "$", "this", "->", "containsNull", "(", ")", ")", "{", "$", "refType", "=", ...
Wether the collection is composed of values with the same cardinality. Please note that: * If the OperandsCollection is empty, false is returned. * If the OperandsCollection contains a NULL value or a NULL container (empty), false is returned @return boolean
[ "Wether", "the", "collection", "is", "composed", "of", "values", "with", "the", "same", "cardinality", ".", "Please", "note", "that", ":" ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/OperandsCollection.php#L414-L430
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/OperandsCollection.php
OperandsCollection.exclusivelyPoint
public function exclusivelyPoint() { if (count($this) === 0) { return false; } foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if (($v instanceof MultipleContainer || $v instanceof OrderedContainer) && ($v->isNull() || $v->ge...
php
public function exclusivelyPoint() { if (count($this) === 0) { return false; } foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if (($v instanceof MultipleContainer || $v instanceof OrderedContainer) && ($v->isNull() || $v->ge...
[ "public", "function", "exclusivelyPoint", "(", ")", "{", "if", "(", "count", "(", "$", "this", ")", "===", "0", ")", "{", "return", "false", ";", "}", "foreach", "(", "array_keys", "(", "$", "this", "->", "getDataPlaceHolder", "(", ")", ")", "as", "$...
Wheter the collection of operands is composed exclusively of Point objects or Container objects with a point baseType. If the collection of operands contains something other than a Point object or a null Container object with baseType point, false is returned. @return boolean
[ "Wheter", "the", "collection", "of", "operands", "is", "composed", "exclusively", "of", "Point", "objects", "or", "Container", "objects", "with", "a", "point", "baseType", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/OperandsCollection.php#L441-L457
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/OperandsCollection.php
OperandsCollection.exclusivelyDuration
public function exclusivelyDuration() { if (count($this) === 0) { return false; } foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if (($v instanceof MultipleContainer || $v instanceof OrderedContainer) && ($v->isNull() || $v-...
php
public function exclusivelyDuration() { if (count($this) === 0) { return false; } foreach (array_keys($this->getDataPlaceHolder()) as $key) { $v = $this[$key]; if (($v instanceof MultipleContainer || $v instanceof OrderedContainer) && ($v->isNull() || $v-...
[ "public", "function", "exclusivelyDuration", "(", ")", "{", "if", "(", "count", "(", "$", "this", ")", "===", "0", ")", "{", "return", "false", ";", "}", "foreach", "(", "array_keys", "(", "$", "this", "->", "getDataPlaceHolder", "(", ")", ")", "as", ...
Wheter the collection of operands is composed exclusively of Duration objects or Container objects with a duration baseType. If the collection of operands contains something other than a Duration object or a null Container object with baseType duration, false is returned. @return boolean
[ "Wheter", "the", "collection", "of", "operands", "is", "composed", "exclusively", "of", "Duration", "objects", "or", "Container", "objects", "with", "a", "duration", "baseType", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/OperandsCollection.php#L468-L484
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/FieldValueProcessor.php
FieldValueProcessor.process
public function process() { $operands = $this->getOperands(); if ($operands->exclusivelyRecord() === false) { $msg = "The FieldValue operator only accepts operands with a cardinality of record."; throw new OperatorProcessingException($msg, $this, OperatorProcessingException:...
php
public function process() { $operands = $this->getOperands(); if ($operands->exclusivelyRecord() === false) { $msg = "The FieldValue operator only accepts operands with a cardinality of record."; throw new OperatorProcessingException($msg, $this, OperatorProcessingException:...
[ "public", "function", "process", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "if", "(", "$", "operands", "->", "exclusivelyRecord", "(", ")", "===", "false", ")", "{", "$", "msg", "=", "\"The FieldValue operator ...
Process the FieldValue object. @return mixed|null A QTI Runtime compliant value or null if there is no field with that identifier. @throws \qtism\runtime\expressions\operators\OperatorProcessingException
[ "Process", "the", "FieldValue", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/FieldValueProcessor.php#L49-L61
oat-sa/qti-sdk
src/qtism/runtime/expressions/NumberSelectedProcessor.php
NumberSelectedProcessor.process
public function process() { $testSession = $this->getState(); $itemSubset = $this->getItemSubset(); $numberSelected = 0; foreach ($itemSubset as $item) { $itemSessions = $testSession->getAssessmentItemSessions($item->getIdentifier()); if ($itemSe...
php
public function process() { $testSession = $this->getState(); $itemSubset = $this->getItemSubset(); $numberSelected = 0; foreach ($itemSubset as $item) { $itemSessions = $testSession->getAssessmentItemSessions($item->getIdentifier()); if ($itemSe...
[ "public", "function", "process", "(", ")", "{", "$", "testSession", "=", "$", "this", "->", "getState", "(", ")", ";", "$", "itemSubset", "=", "$", "this", "->", "getItemSubset", "(", ")", ";", "$", "numberSelected", "=", "0", ";", "foreach", "(", "$...
Process the related NumberSelected expression. @return integer The number of items in the given sub-set that have been selected for presentation to the candidate. @throws \qtism\runtime\expressions\ExpressionProcessingException
[ "Process", "the", "related", "NumberSelected", "expression", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/NumberSelectedProcessor.php#L52-L71
oat-sa/qti-sdk
src/qtism/data/expressions/ItemSubset.php
ItemSubset.setSectionIdentifier
public function setSectionIdentifier($sectionIdentifier) { if (Format::isIdentifier($sectionIdentifier) || empty($sectionIdentifier)) { $this->sectionIdentifier = $sectionIdentifier; } else { $msg = "'${sectionIndentifier}' is not a valid QTI Identifier."; throw n...
php
public function setSectionIdentifier($sectionIdentifier) { if (Format::isIdentifier($sectionIdentifier) || empty($sectionIdentifier)) { $this->sectionIdentifier = $sectionIdentifier; } else { $msg = "'${sectionIndentifier}' is not a valid QTI Identifier."; throw n...
[ "public", "function", "setSectionIdentifier", "(", "$", "sectionIdentifier", ")", "{", "if", "(", "Format", "::", "isIdentifier", "(", "$", "sectionIdentifier", ")", "||", "empty", "(", "$", "sectionIdentifier", ")", ")", "{", "$", "this", "->", "sectionIdenti...
Set the assessment section identifier to match. @param string $sectionIdentifier A QTI Identifier. @throws \InvalidArgumentException If $sectionIdentifier is not a valid QTI Identifier.
[ "Set", "the", "assessment", "section", "identifier", "to", "match", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/expressions/ItemSubset.php#L88-L96
oat-sa/qti-sdk
src/qtism/data/content/xhtml/tables/TableCell.php
TableCell.setScope
public function setScope($scope) { if (in_array($scope, TableCellScope::asArray(), true) === true || $scope === -1) { $this->scope = $scope; } else { $msg = "The 'scope' argument must be a value from the TableCellScope enumeration, '" . $scope . "' given."; throw ...
php
public function setScope($scope) { if (in_array($scope, TableCellScope::asArray(), true) === true || $scope === -1) { $this->scope = $scope; } else { $msg = "The 'scope' argument must be a value from the TableCellScope enumeration, '" . $scope . "' given."; throw ...
[ "public", "function", "setScope", "(", "$", "scope", ")", "{", "if", "(", "in_array", "(", "$", "scope", ",", "TableCellScope", "::", "asArray", "(", ")", ",", "true", ")", "===", "true", "||", "$", "scope", "===", "-", "1", ")", "{", "$", "this", ...
Set the scope attribute. @param integer $scope A value from the TableCellScope enumeration or -1 if no scope is defined. @throws \InvalidArgumentException If $scope is not a value from the TableCellScope enumeration nor -1.
[ "Set", "the", "scope", "attribute", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/xhtml/tables/TableCell.php#L154-L162
oat-sa/qti-sdk
src/qtism/data/content/xhtml/tables/TableCell.php
TableCell.setAbbr
public function setAbbr($abbr) { if (is_string($abbr) === true) { $this->abbr = $abbr; } else { $msg = "The 'abbr' attribute must be a string, '" . gettype($abbr) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setAbbr($abbr) { if (is_string($abbr) === true) { $this->abbr = $abbr; } else { $msg = "The 'abbr' attribute must be a string, '" . gettype($abbr) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setAbbr", "(", "$", "abbr", ")", "{", "if", "(", "is_string", "(", "$", "abbr", ")", "===", "true", ")", "{", "$", "this", "->", "abbr", "=", "$", "abbr", ";", "}", "else", "{", "$", "msg", "=", "\"The 'abbr' attribute must be ...
Set the value of the abbr attribute. @param string $attr A string or an empty string if no abbr is defined. @throws \InvalidArgumentException If $bbr is not a string.
[ "Set", "the", "value", "of", "the", "abbr", "attribute", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/xhtml/tables/TableCell.php#L190-L198
oat-sa/qti-sdk
src/qtism/data/content/xhtml/tables/TableCell.php
TableCell.setAxis
public function setAxis($axis) { if (is_string($axis) === true) { $this->axis = $axis; } else { $msg = "The 'axis' argument must be a string, '" . gettype($axis) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setAxis($axis) { if (is_string($axis) === true) { $this->axis = $axis; } else { $msg = "The 'axis' argument must be a string, '" . gettype($axis) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setAxis", "(", "$", "axis", ")", "{", "if", "(", "is_string", "(", "$", "axis", ")", "===", "true", ")", "{", "$", "this", "->", "axis", "=", "$", "axis", ";", "}", "else", "{", "$", "msg", "=", "\"The 'axis' argument must be a...
Set the value of the axis attribute. @param string $axis A string. Give an empty string if no axis is indicated. @throws \InvalidArgumentException If $axis is not a string.
[ "Set", "the", "value", "of", "the", "axis", "attribute", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/xhtml/tables/TableCell.php#L226-L234
oat-sa/qti-sdk
src/qtism/data/content/xhtml/tables/TableCell.php
TableCell.setRowspan
public function setRowspan($rowspan) { if (is_int($rowspan) === true) { $this->rowspan = $rowspan; } else { $msg = "The 'rowspan' argument must be an integer, '" . gettype($rowspan) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setRowspan($rowspan) { if (is_int($rowspan) === true) { $this->rowspan = $rowspan; } else { $msg = "The 'rowspan' argument must be an integer, '" . gettype($rowspan) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setRowspan", "(", "$", "rowspan", ")", "{", "if", "(", "is_int", "(", "$", "rowspan", ")", "===", "true", ")", "{", "$", "this", "->", "rowspan", "=", "$", "rowspan", ";", "}", "else", "{", "$", "msg", "=", "\"The 'rowspan' arg...
Set the value of the rowspan attribute. Give a negative value if no rowspan attribute is set. @param integer $rowspan @throws \InvalidArgumentException If $rowspan is not an integer.
[ "Set", "the", "value", "of", "the", "rowspan", "attribute", ".", "Give", "a", "negative", "value", "if", "no", "rowspan", "attribute", "is", "set", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/xhtml/tables/TableCell.php#L263-L271
oat-sa/qti-sdk
src/qtism/data/content/xhtml/tables/TableCell.php
TableCell.setColspan
public function setColspan($colspan) { if (is_int($colspan) === true) { $this->colspan = $colspan; } else { $msg = "The 'colspan' argument must be an integer, '" . gettype($colspan) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setColspan($colspan) { if (is_int($colspan) === true) { $this->colspan = $colspan; } else { $msg = "The 'colspan' argument must be an integer, '" . gettype($colspan) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setColspan", "(", "$", "colspan", ")", "{", "if", "(", "is_int", "(", "$", "colspan", ")", "===", "true", ")", "{", "$", "this", "->", "colspan", "=", "$", "colspan", ";", "}", "else", "{", "$", "msg", "=", "\"The 'colspan' arg...
Set the colspan attribute. Give a negative integer to indicate that no colspan is set. @param integer $colspan An integer. @throws \InvalidArgumentException If $colspan is not an integer.
[ "Set", "the", "colspan", "attribute", ".", "Give", "a", "negative", "integer", "to", "indicate", "that", "no", "colspan", "is", "set", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/xhtml/tables/TableCell.php#L301-L309
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/NumberPresentedMarshaller.php
NumberPresentedMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { $baseComponent = parent::unmarshall($element); $object = new NumberPresented(); $object->setSectionIdentifier($baseComponent->getSectionIdentifier()); $object->setIncludeCategories($baseComponent->getIncludeCategories()); $...
php
protected function unmarshall(DOMElement $element) { $baseComponent = parent::unmarshall($element); $object = new NumberPresented(); $object->setSectionIdentifier($baseComponent->getSectionIdentifier()); $object->setIncludeCategories($baseComponent->getIncludeCategories()); $...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "$", "baseComponent", "=", "parent", "::", "unmarshall", "(", "$", "element", ")", ";", "$", "object", "=", "new", "NumberPresented", "(", ")", ";", "$", "object", "->", ...
Marshall an numberPresented QTI element in its NumberPresented object equivalent. @param \DOMElement A DOMElement object. @return \qtism\data\QtiComponent The corresponding NumberPresented object.
[ "Marshall", "an", "numberPresented", "QTI", "element", "in", "its", "NumberPresented", "object", "equivalent", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/NumberPresentedMarshaller.php#L56-L65
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/PositionObjectStageMarshaller.php
PositionObjectStageMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = $this->createElement($component); $object = $component->getObject(); $element->appendChild($this->getMarshallerFactory()->createMarshaller($object)->marshall($object)); foreach ($component->getPositionObjectInteractio...
php
protected function marshall(QtiComponent $component) { $element = $this->createElement($component); $object = $component->getObject(); $element->appendChild($this->getMarshallerFactory()->createMarshaller($object)->marshall($object)); foreach ($component->getPositionObjectInteractio...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "$", "this", "->", "createElement", "(", "$", "component", ")", ";", "$", "object", "=", "$", "component", "->", "getObject", "(", ")", ";", "$", ...
Marshall an PositionObjectStage object into a DOMElement object. @param \qtism\data\QtiComponent $component A PositionObjectStage object. @return \DOMElement The according DOMElement object. @throws \qtism\data\storage\xml\marshalling\MarshallingException
[ "Marshall", "an", "PositionObjectStage", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/PositionObjectStageMarshaller.php#L45-L56
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/PositionObjectStageMarshaller.php
PositionObjectStageMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { $objectElts = $this->getChildElementsByTagName($element, 'object'); if (count($objectElts) > 0) { $object = $this->getMarshallerFactory()->createMarshaller($objectElts[0])->unmarshall($objectElts[0]); $positionObjectInter...
php
protected function unmarshall(DOMElement $element) { $objectElts = $this->getChildElementsByTagName($element, 'object'); if (count($objectElts) > 0) { $object = $this->getMarshallerFactory()->createMarshaller($objectElts[0])->unmarshall($objectElts[0]); $positionObjectInter...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "$", "objectElts", "=", "$", "this", "->", "getChildElementsByTagName", "(", "$", "element", ",", "'object'", ")", ";", "if", "(", "count", "(", "$", "objectElts", ")", ">"...
Unmarshall a DOMElement object corresponding to an positionObjectStage element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A PositionObjectStage object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "an", "positionObjectStage", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/PositionObjectStageMarshaller.php#L65-L90
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/RecursiveMarshaller.php
RecursiveMarshaller.emptyFinal
protected function emptyFinal($count) { $returnValue = array(); while ($count > 0) { $returnValue[] = array_pop($this->final); $count--; } return array_reverse($returnValue); }
php
protected function emptyFinal($count) { $returnValue = array(); while ($count > 0) { $returnValue[] = array_pop($this->final); $count--; } return array_reverse($returnValue); }
[ "protected", "function", "emptyFinal", "(", "$", "count", ")", "{", "$", "returnValue", "=", "array", "(", ")", ";", "while", "(", "$", "count", ">", "0", ")", "{", "$", "returnValue", "[", "]", "=", "array_pop", "(", "$", "this", "->", "final", ")...
Empty the final stack to get the objects inside. @return array The content of the final stack.
[ "Empty", "the", "final", "stack", "to", "get", "the", "objects", "inside", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/RecursiveMarshaller.php#L161-L171
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/RecursiveMarshaller.php
RecursiveMarshaller.marshall
protected function marshall(QtiComponent $component) { // Reset. $this->resetTrail(); $this->resetFinal(); $this->resetMark(); $this->resetProcessed(); $this->pushTrail($component); while ($this->countTrail() > 0) { $node = $this->popTrail(); ...
php
protected function marshall(QtiComponent $component) { // Reset. $this->resetTrail(); $this->resetFinal(); $this->resetMark(); $this->resetProcessed(); $this->pushTrail($component); while ($this->countTrail() > 0) { $node = $this->popTrail(); ...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "// Reset.", "$", "this", "->", "resetTrail", "(", ")", ";", "$", "this", "->", "resetFinal", "(", ")", ";", "$", "this", "->", "resetMark", "(", ")", ";", "$", "this...
Marshall a QtiComponent that might contain instances of the same class as itself. @param \qtism\data\QtiComponent $component The QtiComponent object to marshall. @return \DOMElement A DOMElement corresponding to the QtiComponent to marshall. @throws \qtism\data\storage\xml\marshalling\MarshallingException If an error ...
[ "Marshall", "a", "QtiComponent", "that", "might", "contain", "instances", "of", "the", "same", "class", "as", "itself", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/RecursiveMarshaller.php#L217-L265
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/RecursiveMarshaller.php
RecursiveMarshaller.unmarshall
protected function unmarshall(DOMElement $element, QtiComponent $rootComponent = null) { // Reset. $this->resetTrail(); $this->resetFinal(); $this->resetMark(); $this->resetProcessed(); $this->pushTrail($element); // Begin the traversing of the n-ary tree......
php
protected function unmarshall(DOMElement $element, QtiComponent $rootComponent = null) { // Reset. $this->resetTrail(); $this->resetFinal(); $this->resetMark(); $this->resetProcessed(); $this->pushTrail($element); // Begin the traversing of the n-ary tree......
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ",", "QtiComponent", "$", "rootComponent", "=", "null", ")", "{", "// Reset.", "$", "this", "->", "resetTrail", "(", ")", ";", "$", "this", "->", "resetFinal", "(", ")", ";", "$", ...
Unmarshall a DOMElement that might contain elements of the same QTI class as itself. @param \DOMElement $element The DOMElement object to unmarshall. @param \qtism\data\QtiComponent $rootComponent An optional already instantiated QtiComponent to use as the root component. @return \qtism\data\QtiComponent A QtiComponen...
[ "Unmarshall", "a", "DOMElement", "that", "might", "contain", "elements", "of", "the", "same", "QTI", "class", "as", "itself", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/RecursiveMarshaller.php#L274-L347
oat-sa/qti-sdk
src/qtism/runtime/rules/RuleEngine.php
RuleEngine.setComponent
public function setComponent(QtiComponent $rule) { if ($rule instanceof Rule) { parent::setComponent($rule); } else { $msg = "The RuleEngine class only accepts to execute Rule objects."; throw new InvalidArgumentException($msg); } }
php
public function setComponent(QtiComponent $rule) { if ($rule instanceof Rule) { parent::setComponent($rule); } else { $msg = "The RuleEngine class only accepts to execute Rule objects."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setComponent", "(", "QtiComponent", "$", "rule", ")", "{", "if", "(", "$", "rule", "instanceof", "Rule", ")", "{", "parent", "::", "setComponent", "(", "$", "rule", ")", ";", "}", "else", "{", "$", "msg", "=", "\"The RuleEngine cla...
Set the Rule object to be executed by the engine. @param \qtism\data\QtiComponent $rule A Rule object to be executed. @throws \InvalidArgumentException If $rule is not a Rule object.
[ "Set", "the", "Rule", "object", "to", "be", "executed", "by", "the", "engine", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rules/RuleEngine.php#L68-L76
oat-sa/qti-sdk
src/qtism/runtime/rules/RuleEngine.php
RuleEngine.process
public function process() { $rule = $this->getComponent(); $context = $this->getContext(); $processor = $this->getRuleProcessorFactory()->createProcessor($rule); $processor->setState($context); $processor->process(); $this->trace($rule->getQtiClassName()); }
php
public function process() { $rule = $this->getComponent(); $context = $this->getContext(); $processor = $this->getRuleProcessorFactory()->createProcessor($rule); $processor->setState($context); $processor->process(); $this->trace($rule->getQtiClassName()); }
[ "public", "function", "process", "(", ")", "{", "$", "rule", "=", "$", "this", "->", "getComponent", "(", ")", ";", "$", "context", "=", "$", "this", "->", "getContext", "(", ")", ";", "$", "processor", "=", "$", "this", "->", "getRuleProcessorFactory"...
Execute the current Rule object. @throws \qtism\runtime\rules\RuleProcessingException
[ "Execute", "the", "current", "Rule", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rules/RuleEngine.php#L103-L113
oat-sa/qti-sdk
src/qtism/data/content/BodyElement.php
BodyElement.setId
public function setId($id = '') { if (is_string($id) && (empty($id) === true || Format::isIdentifier($id, false) === true)) { $this->id = $id; } else { $msg = "The 'id' argument of a body element must be a valid identifier or an empty string"; throw new InvalidArg...
php
public function setId($id = '') { if (is_string($id) && (empty($id) === true || Format::isIdentifier($id, false) === true)) { $this->id = $id; } else { $msg = "The 'id' argument of a body element must be a valid identifier or an empty string"; throw new InvalidArg...
[ "public", "function", "setId", "(", "$", "id", "=", "''", ")", "{", "if", "(", "is_string", "(", "$", "id", ")", "&&", "(", "empty", "(", "$", "id", ")", "===", "true", "||", "Format", "::", "isIdentifier", "(", "$", "id", ",", "false", ")", "=...
Set the unique identifier of the body element. @param string $id A QTI Identifier. @throws \InvalidArgumentException If $id is not a valid QTI identifier.
[ "Set", "the", "unique", "identifier", "of", "the", "body", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/BodyElement.php#L129-L137
oat-sa/qti-sdk
src/qtism/data/content/BodyElement.php
BodyElement.setClass
public function setClass($class = '') { if (is_string($class) && (empty($class) === true || Format::isClass($class) === true)) { $class = trim($class); $this->class = $class; } else { $msg = "The 'class' argument must be a valid class name, '" . $class . "' given"...
php
public function setClass($class = '') { if (is_string($class) && (empty($class) === true || Format::isClass($class) === true)) { $class = trim($class); $this->class = $class; } else { $msg = "The 'class' argument must be a valid class name, '" . $class . "' given"...
[ "public", "function", "setClass", "(", "$", "class", "=", "''", ")", "{", "if", "(", "is_string", "(", "$", "class", ")", "&&", "(", "empty", "(", "$", "class", ")", "===", "true", "||", "Format", "::", "isClass", "(", "$", "class", ")", "===", "...
Set the classes assigned to the body element. @param string $class One or more class names separated by spaces. @throws \InvalidArgumentException If $class does not represent valid class name(s).
[ "Set", "the", "classes", "assigned", "to", "the", "body", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/BodyElement.php#L165-L174
oat-sa/qti-sdk
src/qtism/data/content/BodyElement.php
BodyElement.setDir
public function setDir($dir) { if (in_array($dir, Direction::asArray(), true) === true) { $this->dir = $dir; } else { $msg = "The 'dir' argument must be a value from the Direction enumeration."; throw new InvalidArgumentException($msg); } }
php
public function setDir($dir) { if (in_array($dir, Direction::asArray(), true) === true) { $this->dir = $dir; } else { $msg = "The 'dir' argument must be a value from the Direction enumeration."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setDir", "(", "$", "dir", ")", "{", "if", "(", "in_array", "(", "$", "dir", ",", "Direction", "::", "asArray", "(", ")", ",", "true", ")", "===", "true", ")", "{", "$", "this", "->", "dir", "=", "$", "dir", ";", "}", "els...
Set the direction in which body elements must be displayed. @param integer $dir A value from the Direction enumeration. @throws InvalidArgumentException If $dir is not a value from the Direction enumeration.
[ "Set", "the", "direction", "in", "which", "body", "elements", "must", "be", "displayed", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/BodyElement.php#L258-L266
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/OutcomeMinimumMarshaller.php
OutcomeMinimumMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { $baseComponent = parent::unmarshall($element); if (($outcomeIdentifier = $this->getDOMElementAttributeAs($element, 'outcomeIdentifier')) !== null) { $object = new OutcomeMinimum($outcomeIdentifier); $object->setSectionIden...
php
protected function unmarshall(DOMElement $element) { $baseComponent = parent::unmarshall($element); if (($outcomeIdentifier = $this->getDOMElementAttributeAs($element, 'outcomeIdentifier')) !== null) { $object = new OutcomeMinimum($outcomeIdentifier); $object->setSectionIden...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "$", "baseComponent", "=", "parent", "::", "unmarshall", "(", "$", "element", ")", ";", "if", "(", "(", "$", "outcomeIdentifier", "=", "$", "this", "->", "getDOMElementAttrib...
Marshall a outcomeMinimum QTI element in its OutcomeMinimum object equivalent. @param \DOMElement A DOMElement object. @return \qtism\data\QtiComponent The corresponding OutcomeMinimum object.
[ "Marshall", "a", "outcomeMinimum", "QTI", "element", "in", "its", "OutcomeMinimum", "object", "equivalent", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/OutcomeMinimumMarshaller.php#L62-L81
oat-sa/qti-sdk
src/qtism/data/state/Mapping.php
Mapping.setLowerBound
public function setLowerBound($lowerBound) { if (is_float($lowerBound) || is_double($lowerBound) || (is_bool($lowerBound) && $lowerBound === false)) { $this->lowerBound = $lowerBound; } else { $msg = "The 'lowerBound' attribute must be a float or false, '" . gettype($lowerBou...
php
public function setLowerBound($lowerBound) { if (is_float($lowerBound) || is_double($lowerBound) || (is_bool($lowerBound) && $lowerBound === false)) { $this->lowerBound = $lowerBound; } else { $msg = "The 'lowerBound' attribute must be a float or false, '" . gettype($lowerBou...
[ "public", "function", "setLowerBound", "(", "$", "lowerBound", ")", "{", "if", "(", "is_float", "(", "$", "lowerBound", ")", "||", "is_double", "(", "$", "lowerBound", ")", "||", "(", "is_bool", "(", "$", "lowerBound", ")", "&&", "$", "lowerBound", "==="...
Set the lower bound. @param boolean|float $lowerBound A float or false if not lower bound. @throws \InvalidArgumentException If $lowerBound is not a float nor false.
[ "Set", "the", "lower", "bound", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/Mapping.php#L111-L119
oat-sa/qti-sdk
src/qtism/data/state/Mapping.php
Mapping.setDefaultValue
public function setDefaultValue($defaultValue) { if (is_numeric($defaultValue)) { $this->defaultValue = $defaultValue; } else { $msg = "The 'defaultValue' argument must be a numeric value, '" . gettype($defaultValue) . "' given."; throw new InvalidArgumentExceptio...
php
public function setDefaultValue($defaultValue) { if (is_numeric($defaultValue)) { $this->defaultValue = $defaultValue; } else { $msg = "The 'defaultValue' argument must be a numeric value, '" . gettype($defaultValue) . "' given."; throw new InvalidArgumentExceptio...
[ "public", "function", "setDefaultValue", "(", "$", "defaultValue", ")", "{", "if", "(", "is_numeric", "(", "$", "defaultValue", ")", ")", "{", "$", "this", "->", "defaultValue", "=", "$", "defaultValue", ";", "}", "else", "{", "$", "msg", "=", "\"The 'de...
Set the default value of the Mapping. @param float $defaultValue A float value. @throws \InvalidArgumentException If $defaultValue is not a float value.
[ "Set", "the", "default", "value", "of", "the", "Mapping", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/Mapping.php#L183-L191
oat-sa/qti-sdk
src/qtism/data/state/Mapping.php
Mapping.setMapEntries
public function setMapEntries(MapEntryCollection $mapEntries) { if (count($mapEntries) > 0) { $this->mapEntries = $mapEntries; } else { $msg = "A Mapping object must contain at least one MapEntry object, none given."; throw new InvalidArgumentException($msg); ...
php
public function setMapEntries(MapEntryCollection $mapEntries) { if (count($mapEntries) > 0) { $this->mapEntries = $mapEntries; } else { $msg = "A Mapping object must contain at least one MapEntry object, none given."; throw new InvalidArgumentException($msg); ...
[ "public", "function", "setMapEntries", "(", "MapEntryCollection", "$", "mapEntries", ")", "{", "if", "(", "count", "(", "$", "mapEntries", ")", ">", "0", ")", "{", "$", "this", "->", "mapEntries", "=", "$", "mapEntries", ";", "}", "else", "{", "$", "ms...
Set the collection of MapEntry objects which compose the Mapping. @param \qtism\data\state\MapEntryCollection $mapEntries A collection of MapEntry objects with at least one item. @throws \InvalidArgumentException If $mapEnties is an empty collection.
[ "Set", "the", "collection", "of", "MapEntry", "objects", "which", "compose", "the", "Mapping", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/Mapping.php#L209-L217
oat-sa/qti-sdk
src/qtism/data/state/CorrectResponse.php
CorrectResponse.setValues
public function setValues(ValueCollection $values) { if (count($values) > 0) { $this->values = $values; } else { $msg = "Values must contain at lease one Value."; throw new InvalidArgumentException($msg); } }
php
public function setValues(ValueCollection $values) { if (count($values) > 0) { $this->values = $values; } else { $msg = "Values must contain at lease one Value."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setValues", "(", "ValueCollection", "$", "values", ")", "{", "if", "(", "count", "(", "$", "values", ")", ">", "0", ")", "{", "$", "this", "->", "values", "=", "$", "values", ";", "}", "else", "{", "$", "msg", "=", "\"Values ...
Set the intrinsic values of the CorrectResponse. @param \qtism\data\state\ValueCollection $values A collection of Value objects containing at least one Value object. @throws \InvalidArgumentException If $values does not contain at least one Value object.
[ "Set", "the", "intrinsic", "values", "of", "the", "CorrectResponse", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/CorrectResponse.php#L115-L123
oat-sa/qti-sdk
src/qtism/runtime/rules/SetCorrectResponseProcessor.php
SetCorrectResponseProcessor.process
public function process() { $rule = $this->getRule(); $state = $this->getState(); $variableIdentifier = $rule->getIdentifier(); $var = $state->getVariable($variableIdentifier); if (is_null($var) === true) { $msg = "No variable with identifier '${...
php
public function process() { $rule = $this->getRule(); $state = $this->getState(); $variableIdentifier = $rule->getIdentifier(); $var = $state->getVariable($variableIdentifier); if (is_null($var) === true) { $msg = "No variable with identifier '${...
[ "public", "function", "process", "(", ")", "{", "$", "rule", "=", "$", "this", "->", "getRule", "(", ")", ";", "$", "state", "=", "$", "this", "->", "getState", "(", ")", ";", "$", "variableIdentifier", "=", "$", "rule", "->", "getIdentifier", "(", ...
Apply the current SetCorrectResponse rule on the current state. A RuleProcessingException will be thrown if: * No variable corresponds to the given identifier in the current state. * The target variable is not a ResponseVariable. * The baseType and/or cardinality of the value to be set does not correspond to the base...
[ "Apply", "the", "current", "SetCorrectResponse", "rule", "on", "the", "current", "state", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rules/SetCorrectResponseProcessor.php#L55-L85
oat-sa/qti-sdk
src/qtism/runtime/processing/ResponseProcessingEngine.php
ResponseProcessingEngine.setComponent
public function setComponent(QtiComponent $responseProcessing) { if ($responseProcessing instanceof ResponseProcessing) { parent::setComponent($responseProcessing); } else { $msg = "The ResponseProcessingEngine class only accepts ResponseProcessing objects to be executed."; ...
php
public function setComponent(QtiComponent $responseProcessing) { if ($responseProcessing instanceof ResponseProcessing) { parent::setComponent($responseProcessing); } else { $msg = "The ResponseProcessingEngine class only accepts ResponseProcessing objects to be executed."; ...
[ "public", "function", "setComponent", "(", "QtiComponent", "$", "responseProcessing", ")", "{", "if", "(", "$", "responseProcessing", "instanceof", "ResponseProcessing", ")", "{", "parent", "::", "setComponent", "(", "$", "responseProcessing", ")", ";", "}", "else...
Set the ResponseProcessing object to be executed. @param \qtism\data\QtiComponent $responseProcessing A ResponseProcessing object. @throws \InvalidArgumentException If $responseProcessing is not a ResponseProcessing object.
[ "Set", "the", "ResponseProcessing", "object", "to", "be", "executed", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/processing/ResponseProcessingEngine.php#L81-L89
oat-sa/qti-sdk
src/qtism/runtime/processing/ResponseProcessingEngine.php
ResponseProcessingEngine.addTemplateMapping
public function addTemplateMapping($uri, $url) { if (gettype($uri) !== 'string') { $msg = "The uri argument must be a string, '" . gettype($uri) . "' given."; throw new InvalidArgumentException($msg); } if (gettype($url) !== 'string') { $msg = "The url ar...
php
public function addTemplateMapping($uri, $url) { if (gettype($uri) !== 'string') { $msg = "The uri argument must be a string, '" . gettype($uri) . "' given."; throw new InvalidArgumentException($msg); } if (gettype($url) !== 'string') { $msg = "The url ar...
[ "public", "function", "addTemplateMapping", "(", "$", "uri", ",", "$", "url", ")", "{", "if", "(", "gettype", "(", "$", "uri", ")", "!==", "'string'", ")", "{", "$", "msg", "=", "\"The uri argument must be a string, '\"", ".", "gettype", "(", "$", "uri", ...
Add a template mapping. @param string $uri The template URI (Uniform Resource Identifier). @param string $url The actual template URL, i.e. where to find the file containing the template markup. @throws \InvalidArgumentException If $uri or $url are not strings.
[ "Add", "a", "template", "mapping", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/processing/ResponseProcessingEngine.php#L98-L112
oat-sa/qti-sdk
src/qtism/runtime/processing/ResponseProcessingEngine.php
ResponseProcessingEngine.removeTemplateMapping
public function removeTemplateMapping($uri) { if (gettype($uri) !== 'string') { $msg = "The uri argument must be a string, '" . gettype($uri) . "' given."; throw new InvalidArgumentException($msg); } $templateMapping = &$this->getTemplateMapping(); if (isset...
php
public function removeTemplateMapping($uri) { if (gettype($uri) !== 'string') { $msg = "The uri argument must be a string, '" . gettype($uri) . "' given."; throw new InvalidArgumentException($msg); } $templateMapping = &$this->getTemplateMapping(); if (isset...
[ "public", "function", "removeTemplateMapping", "(", "$", "uri", ")", "{", "if", "(", "gettype", "(", "$", "uri", ")", "!==", "'string'", ")", "{", "$", "msg", "=", "\"The uri argument must be a string, '\"", ".", "gettype", "(", "$", "uri", ")", ".", "\"' ...
Remove a template mapping for a given $uri. If no template mapping is found for $uri, nothing happens. @param string $uri The $uri you want to remove the mapping. @throws \InvalidArgumentException If $uri is not a string.
[ "Remove", "a", "template", "mapping", "for", "a", "given", "$uri", ".", "If", "no", "template", "mapping", "is", "found", "for", "$uri", "nothing", "happens", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/processing/ResponseProcessingEngine.php#L121-L133
oat-sa/qti-sdk
src/qtism/runtime/processing/ResponseProcessingEngine.php
ResponseProcessingEngine.process
public function process() { // @todo Figure out how to provide a way to the ResponseProcessingEngine to know the folder where to seek for templateLocation, which is a relative URI. $responseProcessing = $this->getComponent(); $template = $responseProcessing->getTemplate(); $templateL...
php
public function process() { // @todo Figure out how to provide a way to the ResponseProcessingEngine to know the folder where to seek for templateLocation, which is a relative URI. $responseProcessing = $this->getComponent(); $template = $responseProcessing->getTemplate(); $templateL...
[ "public", "function", "process", "(", ")", "{", "// @todo Figure out how to provide a way to the ResponseProcessingEngine to know the folder where to seek for templateLocation, which is a relative URI.", "$", "responseProcessing", "=", "$", "this", "->", "getComponent", "(", ")", ";"...
Execute the ResponseProcessing according to the current context. The following sub-types of ProcessingException may be thrown: * RuleProcessingException: If a ResponseRule in the ResponseProcessing produces an error OR if the ExitResponse rule is invoked. In this last case, a specific exception code will be produced ...
[ "Execute", "the", "ResponseProcessing", "according", "to", "the", "current", "context", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/processing/ResponseProcessingEngine.php#L155-L210
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/MediaInteractionMarshaller.php
MediaInteractionMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = $this->createElement($component); $this->fillElement($element, $component); $this->setDOMElementAttribute($element, 'responseIdentifier', $component->getResponseIdentifier()); $this->setDOMElementAttribute($element, 'a...
php
protected function marshall(QtiComponent $component) { $element = $this->createElement($component); $this->fillElement($element, $component); $this->setDOMElementAttribute($element, 'responseIdentifier', $component->getResponseIdentifier()); $this->setDOMElementAttribute($element, 'a...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "$", "this", "->", "createElement", "(", "$", "component", ")", ";", "$", "this", "->", "fillElement", "(", "$", "element", ",", "$", "component", ...
Marshall a MediaInteraction object into a DOMElement object. @param \qtism\data\QtiComponent $component A MediaInteraction object. @return \DOMElement The according DOMElement object. @throws \qtism\data\storage\xml\marshalling\MarshallingException
[ "Marshall", "a", "MediaInteraction", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/MediaInteractionMarshaller.php#L44-L74
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/MediaInteractionMarshaller.php
MediaInteractionMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { if (($responseIdentifier = $this->getDOMElementAttributeAs($element, 'responseIdentifier')) !== null) { if (($autostart = $this->getDOMElementAttributeAs($element, 'autostart', 'boolean')) !== null) { $objectElts = $this->get...
php
protected function unmarshall(DOMElement $element) { if (($responseIdentifier = $this->getDOMElementAttributeAs($element, 'responseIdentifier')) !== null) { if (($autostart = $this->getDOMElementAttributeAs($element, 'autostart', 'boolean')) !== null) { $objectElts = $this->get...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "if", "(", "(", "$", "responseIdentifier", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'responseIdentifier'", ")", ")", "!==", "null", ")", ...
Unmarshall a DOMElement object corresponding to a MediaInteraction element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A MediaInteraction object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "MediaInteraction", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/MediaInteractionMarshaller.php#L83-L134
oat-sa/qti-sdk
src/qtism/data/content/interactions/HotspotInteraction.php
HotspotInteraction.setMinChoices
public function setMinChoices($minChoices) { if (is_int($minChoices) === true && $minChoices >= 0) { $this->minChoices = $minChoices; } else { $msg = "The 'minChoices' argument must be a positive integer, '" . gettype($minChoices) . "' given."; throw new InvalidAr...
php
public function setMinChoices($minChoices) { if (is_int($minChoices) === true && $minChoices >= 0) { $this->minChoices = $minChoices; } else { $msg = "The 'minChoices' argument must be a positive integer, '" . gettype($minChoices) . "' given."; throw new InvalidAr...
[ "public", "function", "setMinChoices", "(", "$", "minChoices", ")", "{", "if", "(", "is_int", "(", "$", "minChoices", ")", "===", "true", "&&", "$", "minChoices", ">=", "0", ")", "{", "$", "this", "->", "minChoices", "=", "$", "minChoices", ";", "}", ...
Set the minimum number of choices that the candidate is allowed to select. @param integer $minChoices A positive (>= 0) integer. @throws \InvalidArgumentException If $minChoices is not a positive integer.
[ "Set", "the", "minimum", "number", "of", "choices", "that", "the", "candidate", "is", "allowed", "to", "select", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/interactions/HotspotInteraction.php#L140-L148
oat-sa/qti-sdk
src/qtism/common/datatypes/QtiPoint.php
QtiPoint.setX
public function setX($x) { if (is_int($x)) { $this->x = $x; } else { $msg = "The X argument must be an integer value, '" . gettype($x) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setX($x) { if (is_int($x)) { $this->x = $x; } else { $msg = "The X argument must be an integer value, '" . gettype($x) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setX", "(", "$", "x", ")", "{", "if", "(", "is_int", "(", "$", "x", ")", ")", "{", "$", "this", "->", "x", "=", "$", "x", ";", "}", "else", "{", "$", "msg", "=", "\"The X argument must be an integer value, '\"", ".", "gettype",...
Set the position on the x-axis. @param int $x A position on the x-axis. @throws \InvalidArgumentException If $x is nto an integer value.
[ "Set", "the", "position", "on", "the", "x", "-", "axis", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/datatypes/QtiPoint.php#L76-L84
oat-sa/qti-sdk
src/qtism/common/datatypes/QtiPoint.php
QtiPoint.setY
public function setY($y) { if (is_int($y)) { $this->y = $y; } else { $msg = "The Y argument must be an integer value, '" . gettype($x) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setY($y) { if (is_int($y)) { $this->y = $y; } else { $msg = "The Y argument must be an integer value, '" . gettype($x) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setY", "(", "$", "y", ")", "{", "if", "(", "is_int", "(", "$", "y", ")", ")", "{", "$", "this", "->", "y", "=", "$", "y", ";", "}", "else", "{", "$", "msg", "=", "\"The Y argument must be an integer value, '\"", ".", "gettype",...
Set the position on y-axis. @param int $y A position on the y-axis. @throws \InvalidArgumentException If $y is not an integer value.
[ "Set", "the", "position", "on", "y", "-", "axis", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/datatypes/QtiPoint.php#L102-L110
oat-sa/qti-sdk
src/qtism/common/datatypes/QtiPoint.php
QtiPoint.equals
public function equals($obj) { return (gettype($obj) === 'object' && $obj instanceof self && $obj->getX() === $this->getX() && $obj->getY() === $this->getY()); }
php
public function equals($obj) { return (gettype($obj) === 'object' && $obj instanceof self && $obj->getX() === $this->getX() && $obj->getY() === $this->getY()); }
[ "public", "function", "equals", "(", "$", "obj", ")", "{", "return", "(", "gettype", "(", "$", "obj", ")", "===", "'object'", "&&", "$", "obj", "instanceof", "self", "&&", "$", "obj", "->", "getX", "(", ")", "===", "$", "this", "->", "getX", "(", ...
Wheter a given $obj is equal to $this Point object. Two Point objects are considered to be the same if they have the same coordinates. @param mixed $obj An object. @return boolean Whether or not the equality is established.
[ "Wheter", "a", "given", "$obj", "is", "equal", "to", "$this", "Point", "object", ".", "Two", "Point", "objects", "are", "considered", "to", "be", "the", "same", "if", "they", "have", "the", "same", "coordinates", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/datatypes/QtiPoint.php#L129-L135
oat-sa/qti-sdk
src/qtism/runtime/rendering/qtipl/expressions/operators/InsideQtiPLRenderer.php
InsideQtiPLRenderer.render
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); $attributes = []; $attributes['shape'] = "\"" . QtiShape::getNameByConstant($something->getShape()) . "\""; $attributes['coords'] = $something->getCoords(); return $something->getQtiClassNam...
php
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); $attributes = []; $attributes['shape'] = "\"" . QtiShape::getNameByConstant($something->getShape()) . "\""; $attributes['coords'] = $something->getCoords(); return $something->getQtiClassNam...
[ "public", "function", "render", "(", "$", "something", ")", "{", "$", "renderer", "=", "new", "QtiPLRenderer", "(", "$", "this", "->", "getCRO", "(", ")", ")", ";", "$", "attributes", "=", "[", "]", ";", "$", "attributes", "[", "'shape'", "]", "=", ...
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/InsideQtiPLRenderer.php#L47-L56
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/MapEntryMarshaller.php
MapEntryMarshaller.setBaseType
protected function setBaseType($baseType) { if (in_array($baseType, BaseType::asArray())) { $this->baseType = $baseType; } else { $msg = 'The baseType argument must be a valid QTI baseType value from the BaseType enumeration.'; throw new InvalidArgumentException($...
php
protected function setBaseType($baseType) { if (in_array($baseType, BaseType::asArray())) { $this->baseType = $baseType; } else { $msg = 'The baseType argument must be a valid QTI baseType value from the BaseType enumeration.'; throw new InvalidArgumentException($...
[ "protected", "function", "setBaseType", "(", "$", "baseType", ")", "{", "if", "(", "in_array", "(", "$", "baseType", ",", "BaseType", "::", "asArray", "(", ")", ")", ")", "{", "$", "this", "->", "baseType", "=", "$", "baseType", ";", "}", "else", "{"...
Set a baseType to this marshaller implementation in order to force the datatype used for the unserialization of the 'mapKey' attribute. @param int $baseType A baseType from the BaseType enumeration. @throws \InvalidArgumentException If $baseType is not a value from the BaseType enumeration.
[ "Set", "a", "baseType", "to", "this", "marshaller", "implementation", "in", "order", "to", "force", "the", "datatype", "used", "for", "the", "unserialization", "of", "the", "mapKey", "attribute", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/MapEntryMarshaller.php#L57-L65
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/MapEntryMarshaller.php
MapEntryMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'mapKey', $component->getMapKey()); $this->setDOMElementAttribute($element, 'mappedValue', $component->getMappedVal...
php
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'mapKey', $component->getMapKey()); $this->setDOMElementAttribute($element, 'mappedValue', $component->getMappedVal...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "static", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "$", "component", "->", "getQtiClassName", "(", ")", ")", ";", "$", "this", "->...
Marshall a MapEntry object into a DOMElement object. @param \qtism\data\QtiComponent $component A MapEntry object. @return \DOMElement The according DOMElement object.
[ "Marshall", "a", "MapEntry", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/MapEntryMarshaller.php#L97-L109
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/MapEntryMarshaller.php
MapEntryMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { try { $mapKey = $this->getDOMElementAttributeAs($element, 'mapKey'); $mapKey = Utils::stringToDatatype($mapKey, $this->getBaseType()); if (($mappedValue = $this->getDOMElementAttributeAs($element, 'mappedValue', 'float...
php
protected function unmarshall(DOMElement $element) { try { $mapKey = $this->getDOMElementAttributeAs($element, 'mapKey'); $mapKey = Utils::stringToDatatype($mapKey, $this->getBaseType()); if (($mappedValue = $this->getDOMElementAttributeAs($element, 'mappedValue', 'float...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "try", "{", "$", "mapKey", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'mapKey'", ")", ";", "$", "mapKey", "=", "Utils", "::", "stringToD...
Unmarshall a DOMElement object corresponding to a QTI mapEntry element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A MapEntry object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "mapEntry", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/MapEntryMarshaller.php#L118-L141
oat-sa/qti-sdk
src/qtism/data/state/InterpolationTableEntry.php
InterpolationTableEntry.setSourceValue
public function setSourceValue($sourceValue) { if (is_float($sourceValue)) { $this->sourceValue = $sourceValue; } else { $msg = "SourceValue must be a float value, '" . gettype($sourceValue) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setSourceValue($sourceValue) { if (is_float($sourceValue)) { $this->sourceValue = $sourceValue; } else { $msg = "SourceValue must be a float value, '" . gettype($sourceValue) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setSourceValue", "(", "$", "sourceValue", ")", "{", "if", "(", "is_float", "(", "$", "sourceValue", ")", ")", "{", "$", "this", "->", "sourceValue", "=", "$", "sourceValue", ";", "}", "else", "{", "$", "msg", "=", "\"SourceValue mu...
Set the lower bound for the source value to match this entry. @param float $sourceValue A float value. @throws \InvalidArgumentException If $sourceValue is not a float.
[ "Set", "the", "lower", "bound", "for", "the", "source", "value", "to", "match", "this", "entry", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/InterpolationTableEntry.php#L100-L108
oat-sa/qti-sdk
src/qtism/data/state/InterpolationTableEntry.php
InterpolationTableEntry.setIncludeBoundary
public function setIncludeBoundary($includeBoundary) { if (is_bool($includeBoundary)) { $this->includeBoundary = $includeBoundary; } else { $msg = "IncludeBoudary must be a boolean value, '" . gettype($includeBoundary) . "' given"; throw new InvalidArgumentExcepti...
php
public function setIncludeBoundary($includeBoundary) { if (is_bool($includeBoundary)) { $this->includeBoundary = $includeBoundary; } else { $msg = "IncludeBoudary must be a boolean value, '" . gettype($includeBoundary) . "' given"; throw new InvalidArgumentExcepti...
[ "public", "function", "setIncludeBoundary", "(", "$", "includeBoundary", ")", "{", "if", "(", "is_bool", "(", "$", "includeBoundary", ")", ")", "{", "$", "this", "->", "includeBoundary", "=", "$", "includeBoundary", ";", "}", "else", "{", "$", "msg", "=", ...
Set if an exact match of the sourceValue attribute matches this entry. @param boolean $includeBoundary A boolean value. @throws \InvalidArgumentException If $includeBoundary is not a boolean.
[ "Set", "if", "an", "exact", "match", "of", "the", "sourceValue", "attribute", "matches", "this", "entry", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/InterpolationTableEntry.php#L136-L144
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.readVariableValue
public function readVariableValue(Variable $variable, $valueType = self::RW_VALUE) { switch ($valueType) { case self::RW_DEFAULTVALUE: $setterToCall = 'setDefaultValue'; break; case self::RW_CORRECTRESPONSE: $setterToCall = 'se...
php
public function readVariableValue(Variable $variable, $valueType = self::RW_VALUE) { switch ($valueType) { case self::RW_DEFAULTVALUE: $setterToCall = 'setDefaultValue'; break; case self::RW_CORRECTRESPONSE: $setterToCall = 'se...
[ "public", "function", "readVariableValue", "(", "Variable", "$", "variable", ",", "$", "valueType", "=", "self", "::", "RW_VALUE", ")", "{", "switch", "(", "$", "valueType", ")", "{", "case", "self", "::", "RW_DEFAULTVALUE", ":", "$", "setterToCall", "=", ...
Read and fill the Variable $variable with its value contained in the current stream. @param \qtism\runtime\common\Variable $variable A QTI Runtime Variable object. @param integer The kind of value to be read (self::RW_VALUE | self::RW_DEFAULTVALUE | self::RW_CORRECTRESPONSE) @throws \qtism\common\storage\BinaryStreamA...
[ "Read", "and", "fill", "the", "Variable", "$variable", "with", "its", "value", "contained", "in", "the", "current", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L127-L193
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.writeVariableValue
public function writeVariableValue(Variable $variable, $valueType = self::RW_VALUE) { switch ($valueType) { case self::RW_DEFAULTVALUE: $getterToCall = 'getDefaultValue'; break; case self::RW_CORRECTRESPONSE: $getterToC...
php
public function writeVariableValue(Variable $variable, $valueType = self::RW_VALUE) { switch ($valueType) { case self::RW_DEFAULTVALUE: $getterToCall = 'getDefaultValue'; break; case self::RW_CORRECTRESPONSE: $getterToC...
[ "public", "function", "writeVariableValue", "(", "Variable", "$", "variable", ",", "$", "valueType", "=", "self", "::", "RW_VALUE", ")", "{", "switch", "(", "$", "valueType", ")", "{", "case", "self", "::", "RW_DEFAULTVALUE", ":", "$", "getterToCall", "=", ...
Write the value of $variable in the current binary stream. @param \qtism\runtime\common\Variable $variable A QTI Runtime Variable object. @throws \qtism\runtime\storage\binary\QtiBinaryStreamAccessException
[ "Write", "the", "value", "of", "$variable", "in", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L201-L272
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.readRecordField
public function readRecordField($isNull = false) { try { $key = $this->readString(); if ($isNull === false) { $baseType = $this->readTinyInt(); $toCall = 'read' . ucfirst(BaseType::getNameByConstant($baseType)); $value = Utils::valueT...
php
public function readRecordField($isNull = false) { try { $key = $this->readString(); if ($isNull === false) { $baseType = $this->readTinyInt(); $toCall = 'read' . ucfirst(BaseType::getNameByConstant($baseType)); $value = Utils::valueT...
[ "public", "function", "readRecordField", "(", "$", "isNull", "=", "false", ")", "{", "try", "{", "$", "key", "=", "$", "this", "->", "readString", "(", ")", ";", "if", "(", "$", "isNull", "===", "false", ")", "{", "$", "baseType", "=", "$", "this",...
Read a record field value from the current binary stream. A record field is composed of a key string and a value. @return array An array where the value at index 0 is the key string and index 1 is the value. @throws \qtism\runtime\storage\binary\QtiBinaryStreamAccessException
[ "Read", "a", "record", "field", "value", "from", "the", "current", "binary", "stream", ".", "A", "record", "field", "is", "composed", "of", "a", "key", "string", "and", "a", "value", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L281-L300
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.writeRecordField
public function writeRecordField(array $recordField, $isNull = false) { try { $this->writeBoolean($isNull); $key = $recordField[0]; $this->writeString($key); if ($isNull === false) { $value = $recordField[1]; $baseType = Utils:...
php
public function writeRecordField(array $recordField, $isNull = false) { try { $this->writeBoolean($isNull); $key = $recordField[0]; $this->writeString($key); if ($isNull === false) { $value = $recordField[1]; $baseType = Utils:...
[ "public", "function", "writeRecordField", "(", "array", "$", "recordField", ",", "$", "isNull", "=", "false", ")", "{", "try", "{", "$", "this", "->", "writeBoolean", "(", "$", "isNull", ")", ";", "$", "key", "=", "$", "recordField", "[", "0", "]", "...
Write a record field value in the current binary stream. A record field is composed of a key string and a value. @param array $recordField An array where index 0 is the key string, and the index 1 is the value. @throws \qtism\runtime\storage\binary\QtiBinaryStreamAccessException
[ "Write", "a", "record", "field", "value", "in", "the", "current", "binary", "stream", ".", "A", "record", "field", "is", "composed", "of", "a", "key", "string", "and", "a", "value", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L308-L328
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.readIdentifier
public function readIdentifier() { try { return $this->readString(); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while reading an identifier."; throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::IDENTIFIER...
php
public function readIdentifier() { try { return $this->readString(); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while reading an identifier."; throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::IDENTIFIER...
[ "public", "function", "readIdentifier", "(", ")", "{", "try", "{", "return", "$", "this", "->", "readString", "(", ")", ";", "}", "catch", "(", "BinaryStreamAccessException", "$", "e", ")", "{", "$", "msg", "=", "\"An error occured while reading an identifier.\"...
Read an identifier from the current binary stream. @throws \qtism\runtime\storage\binary\QtiBinaryStreamAccessException @return string An identifier.
[ "Read", "an", "identifier", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L336-L344
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.writeIdentifier
public function writeIdentifier($identifier) { try { $this->writeString($identifier); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while writing an identifier."; throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessExce...
php
public function writeIdentifier($identifier) { try { $this->writeString($identifier); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while writing an identifier."; throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessExce...
[ "public", "function", "writeIdentifier", "(", "$", "identifier", ")", "{", "try", "{", "$", "this", "->", "writeString", "(", "$", "identifier", ")", ";", "}", "catch", "(", "BinaryStreamAccessException", "$", "e", ")", "{", "$", "msg", "=", "\"An error oc...
Write an identifier in the current binary stream. @param string $identifier A QTI Identifier. @throws \qtism\runtime\storage\binary\QtiBinaryStreamAccessException
[ "Write", "an", "identifier", "in", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L352-L360
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.readPoint
public function readPoint() { try { return new QtiPoint($this->readShort(), $this->readShort()); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while reading a point."; throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAcces...
php
public function readPoint() { try { return new QtiPoint($this->readShort(), $this->readShort()); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while reading a point."; throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAcces...
[ "public", "function", "readPoint", "(", ")", "{", "try", "{", "return", "new", "QtiPoint", "(", "$", "this", "->", "readShort", "(", ")", ",", "$", "this", "->", "readShort", "(", ")", ")", ";", "}", "catch", "(", "BinaryStreamAccessException", "$", "e...
Read a Point from the current binary stream. @throws \qtism\runtime\storage\binary\QtiBinaryStreamAccessException @return \qtism\common\datatypes\Point A Point object.
[ "Read", "a", "Point", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L368-L376
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.writePoint
public function writePoint(QtiPoint $point) { try { $this->writeShort($point->getX()); $this->writeShort($point->getY()); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while writing a point."; throw new QtiBinaryStreamAccessException($m...
php
public function writePoint(QtiPoint $point) { try { $this->writeShort($point->getX()); $this->writeShort($point->getY()); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while writing a point."; throw new QtiBinaryStreamAccessException($m...
[ "public", "function", "writePoint", "(", "QtiPoint", "$", "point", ")", "{", "try", "{", "$", "this", "->", "writeShort", "(", "$", "point", "->", "getX", "(", ")", ")", ";", "$", "this", "->", "writeShort", "(", "$", "point", "->", "getY", "(", ")...
Write a Point in the current binary stream. @param \qtism\common\datatypes\Point $point A Point object. @throws \qtism\runtime\storage\binary\QtiBinaryStreamAccessException
[ "Write", "a", "Point", "in", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L384-L393
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.readPair
public function readPair() { try { return new QtiPair($this->readString(), $this->readString()); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while reading a pair."; throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccess...
php
public function readPair() { try { return new QtiPair($this->readString(), $this->readString()); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while reading a pair."; throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccess...
[ "public", "function", "readPair", "(", ")", "{", "try", "{", "return", "new", "QtiPair", "(", "$", "this", "->", "readString", "(", ")", ",", "$", "this", "->", "readString", "(", ")", ")", ";", "}", "catch", "(", "BinaryStreamAccessException", "$", "e...
Read a Pair from the current binary stream. @throws \qtism\runtime\storage\binary\QtiBinaryStreamAccessException @return \qtism\common\datatypes\Pair A Pair object.
[ "Read", "a", "Pair", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L401-L409
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.writePair
public function writePair(QtiPair $pair) { try { $this->writeString($pair->getFirst()); $this->writeString($pair->getSecond()); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while writing a pair."; throw new QtiBinaryStreamAccessE...
php
public function writePair(QtiPair $pair) { try { $this->writeString($pair->getFirst()); $this->writeString($pair->getSecond()); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while writing a pair."; throw new QtiBinaryStreamAccessE...
[ "public", "function", "writePair", "(", "QtiPair", "$", "pair", ")", "{", "try", "{", "$", "this", "->", "writeString", "(", "$", "pair", "->", "getFirst", "(", ")", ")", ";", "$", "this", "->", "writeString", "(", "$", "pair", "->", "getSecond", "("...
Write a Pair in the current binary stream. @param \qtism\common\datatypes\Pair $pair A Pair object. @throws \qtism\runtime\storage\binary\QtiBinaryStreamAccessException
[ "Write", "a", "Pair", "in", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L417-L426
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.readDirectedPair
public function readDirectedPair() { try { return new QtiDirectedPair($this->readString(), $this->readString()); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while reading a directedPair."; throw new QtiBinaryStreamAccessException($msg, $thi...
php
public function readDirectedPair() { try { return new QtiDirectedPair($this->readString(), $this->readString()); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while reading a directedPair."; throw new QtiBinaryStreamAccessException($msg, $thi...
[ "public", "function", "readDirectedPair", "(", ")", "{", "try", "{", "return", "new", "QtiDirectedPair", "(", "$", "this", "->", "readString", "(", ")", ",", "$", "this", "->", "readString", "(", ")", ")", ";", "}", "catch", "(", "BinaryStreamAccessExcepti...
Read a DirectedPair from the current binary stream. @throws \qtism\runtime\storage\binary\QtiBinaryStreamAccessException @return \qtism\common\datatypes\DirectedPair A DirectedPair object.
[ "Read", "a", "DirectedPair", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L434-L442
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.writeDirectedPair
public function writeDirectedPair(QtiDirectedPair $directedPair) { try { $this->writeString($directedPair->getFirst()); $this->writeString($directedPair->getSecond()); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while writing a directedPair...
php
public function writeDirectedPair(QtiDirectedPair $directedPair) { try { $this->writeString($directedPair->getFirst()); $this->writeString($directedPair->getSecond()); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while writing a directedPair...
[ "public", "function", "writeDirectedPair", "(", "QtiDirectedPair", "$", "directedPair", ")", "{", "try", "{", "$", "this", "->", "writeString", "(", "$", "directedPair", "->", "getFirst", "(", ")", ")", ";", "$", "this", "->", "writeString", "(", "$", "dir...
Write a DirectedPair in the current binary stream. @param \qtism\common\datatypes\DirectedPair $directedPair A DirectedPair object. @throws \qtism\runtime\storage\binary\QtiBinaryStreamAccessException
[ "Write", "a", "DirectedPair", "in", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L450-L459
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.readShufflingGroup
public function readShufflingGroup() { try { $identifiers = new IdentifierCollection(); $fixedIdentifiers = new IdentifierCollection(); $identifiersCount = $this->readTinyInt(); for ($i = 0; $i < $identifiersCount; $i++) { ...
php
public function readShufflingGroup() { try { $identifiers = new IdentifierCollection(); $fixedIdentifiers = new IdentifierCollection(); $identifiersCount = $this->readTinyInt(); for ($i = 0; $i < $identifiersCount; $i++) { ...
[ "public", "function", "readShufflingGroup", "(", ")", "{", "try", "{", "$", "identifiers", "=", "new", "IdentifierCollection", "(", ")", ";", "$", "fixedIdentifiers", "=", "new", "IdentifierCollection", "(", ")", ";", "$", "identifiersCount", "=", "$", "this",...
Read a ShufflingGroup from the current binary stream. @throws QtiBinaryStreamAccessException @return \qtism\data\state\ShufflingGroup
[ "Read", "a", "ShufflingGroup", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L467-L494