repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.writeShufflingGroup
public function writeShufflingGroup(ShufflingGroup $shufflingGroup) { try { $identifiers = $shufflingGroup->getIdentifiers(); $this->writeTinyInt(count($identifiers)); foreach ($identifiers as $identifier) { $this->writeString($identifier); } ...
php
public function writeShufflingGroup(ShufflingGroup $shufflingGroup) { try { $identifiers = $shufflingGroup->getIdentifiers(); $this->writeTinyInt(count($identifiers)); foreach ($identifiers as $identifier) { $this->writeString($identifier); } ...
[ "public", "function", "writeShufflingGroup", "(", "ShufflingGroup", "$", "shufflingGroup", ")", "{", "try", "{", "$", "identifiers", "=", "$", "shufflingGroup", "->", "getIdentifiers", "(", ")", ";", "$", "this", "->", "writeTinyInt", "(", "count", "(", "$", ...
Write a ShufflingGroup in the current binary stream. @param \qtism\data\state\ShufflingGroup $shufflingGroup @throws QtiBinaryStreamAccessException
[ "Write", "a", "ShufflingGroup", "in", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L502-L520
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.readShufflingState
public function readShufflingState() { try { $responseIdentifier = $this->readIdentifier(); $shufflingGroupCount = $this->readTinyInt(); $shufflingGroups = new ShufflingGroupCollection(); for ($i = 0; $i < $shufflingGroupCount; $i++) ...
php
public function readShufflingState() { try { $responseIdentifier = $this->readIdentifier(); $shufflingGroupCount = $this->readTinyInt(); $shufflingGroups = new ShufflingGroupCollection(); for ($i = 0; $i < $shufflingGroupCount; $i++) ...
[ "public", "function", "readShufflingState", "(", ")", "{", "try", "{", "$", "responseIdentifier", "=", "$", "this", "->", "readIdentifier", "(", ")", ";", "$", "shufflingGroupCount", "=", "$", "this", "->", "readTinyInt", "(", ")", ";", "$", "shufflingGroups...
Read a Shuffling object from the current binary stream. @throws QtiBinaryStreamAccessException @return \qtism\data\state\Shuffling
[ "Read", "a", "Shuffling", "object", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L528-L545
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.writeShufflingState
public function writeShufflingState(Shuffling $shufflingState) { try { $this->writeIdentifier($shufflingState->getResponseIdentifier()); $shufflingGroups = $shufflingState->getShufflingGroups(); $this->writeTinyInt(count($shufflingGroups)); foreac...
php
public function writeShufflingState(Shuffling $shufflingState) { try { $this->writeIdentifier($shufflingState->getResponseIdentifier()); $shufflingGroups = $shufflingState->getShufflingGroups(); $this->writeTinyInt(count($shufflingGroups)); foreac...
[ "public", "function", "writeShufflingState", "(", "Shuffling", "$", "shufflingState", ")", "{", "try", "{", "$", "this", "->", "writeIdentifier", "(", "$", "shufflingState", "->", "getResponseIdentifier", "(", ")", ")", ";", "$", "shufflingGroups", "=", "$", "...
Write a Shuffling object in the current binary stream. @param \qtism\data\state\Shuffling $shufflingState @throws QtiBinaryStreamAccessException
[ "Write", "a", "Shuffling", "object", "in", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L553-L567
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.readDuration
public function readDuration() { try { return new QtiDuration($this->readString()); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while reading a duration."; throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException...
php
public function readDuration() { try { return new QtiDuration($this->readString()); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while reading a duration."; throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException...
[ "public", "function", "readDuration", "(", ")", "{", "try", "{", "return", "new", "QtiDuration", "(", "$", "this", "->", "readString", "(", ")", ")", ";", "}", "catch", "(", "BinaryStreamAccessException", "$", "e", ")", "{", "$", "msg", "=", "\"An error ...
Read a Duration from the current binary stream. @throws \qtism\runtime\storage\binary\QtiBinaryStreamAccessException @return \qtism\common\datatypes\Duration A Duration object.
[ "Read", "a", "Duration", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L575-L583
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.writeDuration
public function writeDuration(QtiDuration $duration) { try { $this->writeString($duration->__toString()); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while writing a duration."; throw new QtiBinaryStreamAccessException($msg, $this, QtiBinar...
php
public function writeDuration(QtiDuration $duration) { try { $this->writeString($duration->__toString()); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while writing a duration."; throw new QtiBinaryStreamAccessException($msg, $this, QtiBinar...
[ "public", "function", "writeDuration", "(", "QtiDuration", "$", "duration", ")", "{", "try", "{", "$", "this", "->", "writeString", "(", "$", "duration", "->", "__toString", "(", ")", ")", ";", "}", "catch", "(", "BinaryStreamAccessException", "$", "e", ")...
Write a Duration in the current binary stream. @param \qtism\common\datatypes\Duration $duration A Duration object. @throws \qtism\runtime\storage\binary\QtiBinaryStreamAccessException
[ "Write", "a", "Duration", "in", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L591-L599
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.readUri
public function readUri() { try { return $this->readString(); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while reading a URI."; throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::URI, $e); } }
php
public function readUri() { try { return $this->readString(); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while reading a URI."; throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::URI, $e); } }
[ "public", "function", "readUri", "(", ")", "{", "try", "{", "return", "$", "this", "->", "readString", "(", ")", ";", "}", "catch", "(", "BinaryStreamAccessException", "$", "e", ")", "{", "$", "msg", "=", "\"An error occured while reading a URI.\"", ";", "th...
Read a URI (Uniform Resource Identifier) from the current binary stream. @throws \qtism\runtime\storage\binary\QtiBinaryStreamAccessException @return string A URI.
[ "Read", "a", "URI", "(", "Uniform", "Resource", "Identifier", ")", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L607-L615
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.writeUri
public function writeUri($uri) { try { $this->writeString($uri); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while writing a URI."; throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::URI, $e); } ...
php
public function writeUri($uri) { try { $this->writeString($uri); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while writing a URI."; throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::URI, $e); } ...
[ "public", "function", "writeUri", "(", "$", "uri", ")", "{", "try", "{", "$", "this", "->", "writeString", "(", "$", "uri", ")", ";", "}", "catch", "(", "BinaryStreamAccessException", "$", "e", ")", "{", "$", "msg", "=", "\"An error occured while writing a...
Write a URI (Uniform Resource Identifier) in the current binary stream. @param string $uri A URI. @throws \qtism\runtime\storage\binary\QtiBinaryStreamAccessException
[ "Write", "a", "URI", "(", "Uniform", "Resource", "Identifier", ")", "in", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L623-L631
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.readIntOrIdentifier
public function readIntOrIdentifier() { try { $isInt = $this->readBoolean(); return ($isInt === true) ? $this->readInteger() : $this->readIdentifier(); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while reading an intOrIdentifier."; ...
php
public function readIntOrIdentifier() { try { $isInt = $this->readBoolean(); return ($isInt === true) ? $this->readInteger() : $this->readIdentifier(); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while reading an intOrIdentifier."; ...
[ "public", "function", "readIntOrIdentifier", "(", ")", "{", "try", "{", "$", "isInt", "=", "$", "this", "->", "readBoolean", "(", ")", ";", "return", "(", "$", "isInt", "===", "true", ")", "?", "$", "this", "->", "readInteger", "(", ")", ":", "$", ...
Read an intOrIdentifier from the current binary stream. @return integer|string An integer or a string depending on the nature of the intOrIdentifier datatype.
[ "Read", "an", "intOrIdentifier", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L638-L648
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.writeIntOrIdentifier
public function writeIntOrIdentifier($intOrIdentifier) { try { if (gettype($intOrIdentifier) === 'integer') { $this->writeBoolean(true); $this->writeInteger($intOrIdentifier); } elseif (gettype($intOrIdentifier) === 'string') { $this->w...
php
public function writeIntOrIdentifier($intOrIdentifier) { try { if (gettype($intOrIdentifier) === 'integer') { $this->writeBoolean(true); $this->writeInteger($intOrIdentifier); } elseif (gettype($intOrIdentifier) === 'string') { $this->w...
[ "public", "function", "writeIntOrIdentifier", "(", "$", "intOrIdentifier", ")", "{", "try", "{", "if", "(", "gettype", "(", "$", "intOrIdentifier", ")", "===", "'integer'", ")", "{", "$", "this", "->", "writeBoolean", "(", "true", ")", ";", "$", "this", ...
Write an intOrIdentifier in the current binary stream. @param integer|string $intOrIdentifier An integer or a string value. @throws \qtism\runtime\storage\binary\QtiBinaryStreamAccessException
[ "Write", "an", "intOrIdentifier", "in", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L656-L673
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.readAssessmentItemSession
public function readAssessmentItemSession(AbstractSessionManager $manager, AssessmentTestSeeker $seeker) { try { $itemRefPosition = $this->readShort(); $assessmentItemRef = $seeker->seekComponent('assessmentItemRef', $itemRefPosition); $session = $manager->createAssessme...
php
public function readAssessmentItemSession(AbstractSessionManager $manager, AssessmentTestSeeker $seeker) { try { $itemRefPosition = $this->readShort(); $assessmentItemRef = $seeker->seekComponent('assessmentItemRef', $itemRefPosition); $session = $manager->createAssessme...
[ "public", "function", "readAssessmentItemSession", "(", "AbstractSessionManager", "$", "manager", ",", "AssessmentTestSeeker", "$", "seeker", ")", "{", "try", "{", "$", "itemRefPosition", "=", "$", "this", "->", "readShort", "(", ")", ";", "$", "assessmentItemRef"...
Read an AssessmentItemSession from the current binary stream. @param \qtism\runtime\tests\AbstractSessionManager $manager @param \qtism\runtime\storage\common\AssessmentTestSeeker $seeker An AssessmentTestSeeker object from where 'assessmentItemRef', 'outcomeDeclaration' and 'responseDeclaration' QTI components will b...
[ "Read", "an", "AssessmentItemSession", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L682-L780
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.writeAssessmentItemSession
public function writeAssessmentItemSession(AssessmentTestSeeker $seeker, AssessmentItemSession $session) { try { $this->writeShort($seeker->seekPosition($session->getAssessmentItem())); $this->writeTinyInt($session->getState()); $this->writeTinyInt($session->getNavigation...
php
public function writeAssessmentItemSession(AssessmentTestSeeker $seeker, AssessmentItemSession $session) { try { $this->writeShort($seeker->seekPosition($session->getAssessmentItem())); $this->writeTinyInt($session->getState()); $this->writeTinyInt($session->getNavigation...
[ "public", "function", "writeAssessmentItemSession", "(", "AssessmentTestSeeker", "$", "seeker", ",", "AssessmentItemSession", "$", "session", ")", "{", "try", "{", "$", "this", "->", "writeShort", "(", "$", "seeker", "->", "seekPosition", "(", "$", "session", "-...
Write an AssessmetnItemSession from the current binary stream. @param \qtism\runtime\storage\common\AssessmentTestSeeker $seeker The AssessmentTestSeeker object from where the position of components will be pulled out. @param \qtism\runtime\tests\AssessmentItemSession $session An AssessmentItemSession object. @throws ...
[ "Write", "an", "AssessmetnItemSession", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L789-L890
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.readRouteItem
public function readRouteItem(AssessmentTestSeeker $seeker) { try { $occurence = $this->readTinyInt(); $itemRef = $seeker->seekComponent('assessmentItemRef', $this->readShort()); $testPart = $seeker->seekComponent('testPart', $this->readShort()); $sectionsCou...
php
public function readRouteItem(AssessmentTestSeeker $seeker) { try { $occurence = $this->readTinyInt(); $itemRef = $seeker->seekComponent('assessmentItemRef', $this->readShort()); $testPart = $seeker->seekComponent('testPart', $this->readShort()); $sectionsCou...
[ "public", "function", "readRouteItem", "(", "AssessmentTestSeeker", "$", "seeker", ")", "{", "try", "{", "$", "occurence", "=", "$", "this", "->", "readTinyInt", "(", ")", ";", "$", "itemRef", "=", "$", "seeker", "->", "seekComponent", "(", "'assessmentItemR...
Read a route item from the current binary stream. @param \qtism\runtime\storage\common\AssessmentTestSeeker $seeker An AssessmentTestSeeker object where components will be pulled out by position. @throws \qtism\runtime\storage\binary\QtiBinaryStreamAccessException @return \qtism\runtime\tests\RouteItem
[ "Read", "a", "route", "item", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L899-L940
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.writeRouteItem
public function writeRouteItem(AssessmentTestSeeker $seeker, RouteItem $routeItem) { try { $this->writeTinyInt($routeItem->getOccurence()); $this->writeShort($seeker->seekPosition($routeItem->getAssessmentItemRef())); $this->writeShort($seeker->seekPosition($routeItem->ge...
php
public function writeRouteItem(AssessmentTestSeeker $seeker, RouteItem $routeItem) { try { $this->writeTinyInt($routeItem->getOccurence()); $this->writeShort($seeker->seekPosition($routeItem->getAssessmentItemRef())); $this->writeShort($seeker->seekPosition($routeItem->ge...
[ "public", "function", "writeRouteItem", "(", "AssessmentTestSeeker", "$", "seeker", ",", "RouteItem", "$", "routeItem", ")", "{", "try", "{", "$", "this", "->", "writeTinyInt", "(", "$", "routeItem", "->", "getOccurence", "(", ")", ")", ";", "$", "this", "...
Write a route item in the current binary stream. @param \qtism\runtime\storage\common\AssessmentTestSeeker $seeker An AssessmentTestSeeker object in order to know tree position for involved QTI Components. @param \qtism\runtime\tests\RouteItem $routeItem A RouteItem object. @throws \qtism\runtime\storage\binary\QtiBin...
[ "Write", "a", "route", "item", "in", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L949-L984
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.readPendingResponses
public function readPendingResponses(AssessmentTestSeeker $seeker) { try { // Read the state. $state = new State(); $varCount = $this->readTinyInt(); for ($i = 0; $i < $varCount; $i++) { $responseDeclaration = $seeker->seekComponent('responseD...
php
public function readPendingResponses(AssessmentTestSeeker $seeker) { try { // Read the state. $state = new State(); $varCount = $this->readTinyInt(); for ($i = 0; $i < $varCount; $i++) { $responseDeclaration = $seeker->seekComponent('responseD...
[ "public", "function", "readPendingResponses", "(", "AssessmentTestSeeker", "$", "seeker", ")", "{", "try", "{", "// Read the state.", "$", "state", "=", "new", "State", "(", ")", ";", "$", "varCount", "=", "$", "this", "->", "readTinyInt", "(", ")", ";", "...
Read a PendingResponse object from the current binary stream. @param \qtism\runtime\storage\common\AssessmentTestSeeker $seeker An AssessmentTestSeeker object in order to know tree position for involved QTI Components. @return \qtism\runtime\tests\PendingResponses A PendingResponses object. @throws \qtism\runtime\stor...
[ "Read", "a", "PendingResponse", "object", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L993-L1021
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.writePendingResponses
public function writePendingResponses(AssessmentTestSeeker $seeker, PendingResponses $pendingResponses) { try { $state = $pendingResponses->getState(); $itemRef = $pendingResponses->getAssessmentItemRef(); $occurence = $pendingResponses->getOccurence(); // Wr...
php
public function writePendingResponses(AssessmentTestSeeker $seeker, PendingResponses $pendingResponses) { try { $state = $pendingResponses->getState(); $itemRef = $pendingResponses->getAssessmentItemRef(); $occurence = $pendingResponses->getOccurence(); // Wr...
[ "public", "function", "writePendingResponses", "(", "AssessmentTestSeeker", "$", "seeker", ",", "PendingResponses", "$", "pendingResponses", ")", "{", "try", "{", "$", "state", "=", "$", "pendingResponses", "->", "getState", "(", ")", ";", "$", "itemRef", "=", ...
Write a PendingResponses object in the current binary stream. @param \qtism\runtime\storage\common\AssessmentTestSeeker $seeker An AssessmentTestSeeker object from where positions in the assessmentTest tree will be pulled out. @param \qtism\runtime\tests\PendingResponses $pendingResponses The read PendingResponses obj...
[ "Write", "a", "PendingResponses", "object", "in", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L1030-L1065
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.writeFile
public function writeFile(QtiFile $file) { try { $this->writeString($file->getIdentifier()); } catch (QtiBinaryStreamAccessException $e) { $msg = "An error occured while reading a QTI File."; throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAcc...
php
public function writeFile(QtiFile $file) { try { $this->writeString($file->getIdentifier()); } catch (QtiBinaryStreamAccessException $e) { $msg = "An error occured while reading a QTI File."; throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAcc...
[ "public", "function", "writeFile", "(", "QtiFile", "$", "file", ")", "{", "try", "{", "$", "this", "->", "writeString", "(", "$", "file", "->", "getIdentifier", "(", ")", ")", ";", "}", "catch", "(", "QtiBinaryStreamAccessException", "$", "e", ")", "{", ...
Write a QtiFile object in the current binary stream. @param \qtism\common\datatypes\QtiFile $file
[ "Write", "a", "QtiFile", "object", "in", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L1072-L1080
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.readFile
public function readFile() { try { $id = $this->readString(); return $this->getFileManager()->retrieve($id); } catch (\Exception $e) { $msg = "An error occured while writing a QTI File."; throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryS...
php
public function readFile() { try { $id = $this->readString(); return $this->getFileManager()->retrieve($id); } catch (\Exception $e) { $msg = "An error occured while writing a QTI File."; throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryS...
[ "public", "function", "readFile", "(", ")", "{", "try", "{", "$", "id", "=", "$", "this", "->", "readString", "(", ")", ";", "return", "$", "this", "->", "getFileManager", "(", ")", "->", "retrieve", "(", "$", "id", ")", ";", "}", "catch", "(", "...
Read a QtiFile object from the current binary stream. @return \qtism\common\datatypes\QtiFile
[ "Read", "a", "QtiFile", "object", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L1087-L1096
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.readPath
public function readPath() { try { $pathCount = $this->readShort(); $path = array(); for ($i = 0; $i < $pathCount; $i++) { $path[] = $this->readShort(); } return $path; } catch (BinaryStreamAccessExcept...
php
public function readPath() { try { $pathCount = $this->readShort(); $path = array(); for ($i = 0; $i < $pathCount; $i++) { $path[] = $this->readShort(); } return $path; } catch (BinaryStreamAccessExcept...
[ "public", "function", "readPath", "(", ")", "{", "try", "{", "$", "pathCount", "=", "$", "this", "->", "readShort", "(", ")", ";", "$", "path", "=", "array", "(", ")", ";", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "$", "pathCount", ...
Read the path from the current binary stream. @return array An array of integer values representing flow positions.
[ "Read", "the", "path", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L1103-L1117
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php
QtiBinaryStreamAccess.writePath
public function writePath(array $path) { try { $this->writeShort(count($path)); foreach ($path as $p) { $this->writeShort($p); } } catch (BinaryStreamAccessException $e) { $msg = "An error occured while writing the path."; throw new Q...
php
public function writePath(array $path) { try { $this->writeShort(count($path)); foreach ($path as $p) { $this->writeShort($p); } } catch (BinaryStreamAccessException $e) { $msg = "An error occured while writing the path."; throw new Q...
[ "public", "function", "writePath", "(", "array", "$", "path", ")", "{", "try", "{", "$", "this", "->", "writeShort", "(", "count", "(", "$", "path", ")", ")", ";", "foreach", "(", "$", "path", "as", "$", "p", ")", "{", "$", "this", "->", "writeSh...
Write the path in the current binary stream. @param array $path An array of integer values representing flow positions.
[ "Write", "the", "path", "in", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/QtiBinaryStreamAccess.php#L1124-L1134
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/MappingMarshaller.php
MappingMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); if ($component->hasLowerBound() === true) { $this->setDOMElementAttribute($element, 'lowerBound', $component->getLowerBound()); } if (...
php
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); if ($component->hasLowerBound() === true) { $this->setDOMElementAttribute($element, 'lowerBound', $component->getLowerBound()); } if (...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "static", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "$", "component", "->", "getQtiClassName", "(", ")", ")", ";", "if", "(", "$", ...
Marshall a Mapping object into a DOMElement object. @param \qtism\data\QtiComponent $component A Mapping object. @return \DOMElement The according DOMElement object.
[ "Marshall", "a", "Mapping", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/MappingMarshaller.php#L95-L115
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/MappingMarshaller.php
MappingMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { $mapEntriesElts = $this->getChildElementsByTagName($element, 'mapEntry'); $mapEntries = new MapEntryCollection(); foreach ($mapEntriesElts as $mapEntryElt) { $marshaller = $this->getMarshallerFactory()->createMarshaller($mapEn...
php
protected function unmarshall(DOMElement $element) { $mapEntriesElts = $this->getChildElementsByTagName($element, 'mapEntry'); $mapEntries = new MapEntryCollection(); foreach ($mapEntriesElts as $mapEntryElt) { $marshaller = $this->getMarshallerFactory()->createMarshaller($mapEn...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "$", "mapEntriesElts", "=", "$", "this", "->", "getChildElementsByTagName", "(", "$", "element", ",", "'mapEntry'", ")", ";", "$", "mapEntries", "=", "new", "MapEntryCollection",...
Unmarshall a DOMElement object corresponding to a QTI mapping element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A Mapping object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "mapping", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/MappingMarshaller.php#L124-L154
oat-sa/qti-sdk
src/qtism/runtime/common/StackTraceItem.php
StackTraceItem.setTraceMessage
public function setTraceMessage($traceMessage) { if (gettype($traceMessage) === 'string') { $this->traceMessage = $traceMessage; } else { $msg = "The traceMessage argument must be a string, '" . gettype($traceMessage) . "' given."; throw new InvalidArgumentExcepti...
php
public function setTraceMessage($traceMessage) { if (gettype($traceMessage) === 'string') { $this->traceMessage = $traceMessage; } else { $msg = "The traceMessage argument must be a string, '" . gettype($traceMessage) . "' given."; throw new InvalidArgumentExcepti...
[ "public", "function", "setTraceMessage", "(", "$", "traceMessage", ")", "{", "if", "(", "gettype", "(", "$", "traceMessage", ")", "===", "'string'", ")", "{", "$", "this", "->", "traceMessage", "=", "$", "traceMessage", ";", "}", "else", "{", "$", "msg",...
Get the message about the traced QtiComponent object. @param string $traceMessage A human-readable message. @throws \InvalidArgumentException If $traceMessage is not a string.
[ "Get", "the", "message", "about", "the", "traced", "QtiComponent", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/common/StackTraceItem.php#L103-L111
oat-sa/qti-sdk
src/qtism/runtime/expressions/VariableProcessor.php
VariableProcessor.process
public function process() { $state = $this->getState(); $variableIdentifier = $this->getExpression()->getIdentifier(); $weightIdentifier = $this->getExpression()->getWeightIdentifier(); $variable = $state->getVariable($variableIdentifier); if (empty($variable)) { ...
php
public function process() { $state = $this->getState(); $variableIdentifier = $this->getExpression()->getIdentifier(); $weightIdentifier = $this->getExpression()->getWeightIdentifier(); $variable = $state->getVariable($variableIdentifier); if (empty($variable)) { ...
[ "public", "function", "process", "(", ")", "{", "$", "state", "=", "$", "this", "->", "getState", "(", ")", ";", "$", "variableIdentifier", "=", "$", "this", "->", "getExpression", "(", ")", "->", "getIdentifier", "(", ")", ";", "$", "weightIdentifier", ...
Process the Variable expression. * If the requested variable does not exist, NULL is returned. * In a test context, if the requested weight does not exist, the raw value of the variable is returned. @returns null|mixed The value of the target variable or NULL if the variable does not exist. @throws \qtism\runtime\exp...
[ "Process", "the", "Variable", "expression", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/VariableProcessor.php#L85-L149
oat-sa/qti-sdk
src/qtism/runtime/rendering/qtipl/expressions/operators/OperatorQtiPLRenderer.php
OperatorQtiPLRenderer.render
public function render($something) { if (!array_key_exists($something->getQtiClassName(), $this->getSignAsOperatorMap()) || $something->getExpressions()->count() != 2) { return $this->getDefaultRendering($something); } else { // With operator sign form re...
php
public function render($something) { if (!array_key_exists($something->getQtiClassName(), $this->getSignAsOperatorMap()) || $something->getExpressions()->count() != 2) { return $this->getDefaultRendering($something); } else { // With operator sign form re...
[ "public", "function", "render", "(", "$", "something", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "something", "->", "getQtiClassName", "(", ")", ",", "$", "this", "->", "getSignAsOperatorMap", "(", ")", ")", "||", "$", "something", "->", "g...
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/OperatorQtiPLRenderer.php#L80-L90
oat-sa/qti-sdk
src/qtism/runtime/rendering/qtipl/expressions/operators/OperatorQtiPLRenderer.php
OperatorQtiPLRenderer.getDefaultRendering
public function getDefaultRendering($something) { $renderer = new QtiPLRenderer($this->getCRO()); return $something->getQtiClassName() . $renderer->writeChildElements($something->getExpressions()); }
php
public function getDefaultRendering($something) { $renderer = new QtiPLRenderer($this->getCRO()); return $something->getQtiClassName() . $renderer->writeChildElements($something->getExpressions()); }
[ "public", "function", "getDefaultRendering", "(", "$", "something", ")", "{", "$", "renderer", "=", "new", "QtiPLRenderer", "(", "$", "this", "->", "getCRO", "(", ")", ")", ";", "return", "$", "something", "->", "getQtiClassName", "(", ")", ".", "$", "re...
Returns the default QtiPL rendering for an Operator. @param mixed $something Something to render into another consitution. @return string The default QtiPL rendering for an Operator
[ "Returns", "the", "default", "QtiPL", "rendering", "for", "an", "Operator", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/qtipl/expressions/operators/OperatorQtiPLRenderer.php#L97-L101
oat-sa/qti-sdk
src/qtism/runtime/rendering/qtipl/expressions/operators/OperatorQtiPLRenderer.php
OperatorQtiPLRenderer.renderWithSignAsOperator
private function renderWithSignAsOperator($something) { $qtipl = ""; $renderer = new QtiPLRenderer($this->getCRO()); $needsparenthesis0 = array_key_exists($something->getExpressions()[0]->getQtiClassName(), $this->getSignAsOperatorMap()) && $something->getExpressions()[0]->getExp...
php
private function renderWithSignAsOperator($something) { $qtipl = ""; $renderer = new QtiPLRenderer($this->getCRO()); $needsparenthesis0 = array_key_exists($something->getExpressions()[0]->getQtiClassName(), $this->getSignAsOperatorMap()) && $something->getExpressions()[0]->getExp...
[ "private", "function", "renderWithSignAsOperator", "(", "$", "something", ")", "{", "$", "qtipl", "=", "\"\"", ";", "$", "renderer", "=", "new", "QtiPLRenderer", "(", "$", "this", "->", "getCRO", "(", ")", ")", ";", "$", "needsparenthesis0", "=", "array_ke...
Returns the default QtiPL rendering for an Operator with a specific sign and 2 sub-expressions. @param mixed $something Something to render into another consitution. @return string The default QtiPL rendering for an Operator with a specific sign and 2 sub-expressions
[ "Returns", "the", "default", "QtiPL", "rendering", "for", "an", "Operator", "with", "a", "specific", "sign", "and", "2", "sub", "-", "expressions", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/rendering/qtipl/expressions/operators/OperatorQtiPLRenderer.php#L111-L129
oat-sa/qti-sdk
src/qtism/data/state/ResponseValidityConstraint.php
ResponseValidityConstraint.setResponseIdentifier
public function setResponseIdentifier($responseIdentifier) { if (is_string($responseIdentifier) === false || empty($responseIdentifier) === true) { throw new InvalidArgumentException( "The 'responseIdentifier' argument must be a non-empty string." ); } ...
php
public function setResponseIdentifier($responseIdentifier) { if (is_string($responseIdentifier) === false || empty($responseIdentifier) === true) { throw new InvalidArgumentException( "The 'responseIdentifier' argument must be a non-empty string." ); } ...
[ "public", "function", "setResponseIdentifier", "(", "$", "responseIdentifier", ")", "{", "if", "(", "is_string", "(", "$", "responseIdentifier", ")", "===", "false", "||", "empty", "(", "$", "responseIdentifier", ")", "===", "true", ")", "{", "throw", "new", ...
Set the identifier of the response the validity constraint applies to. @param integer $responseIdentifier @throws \InvalidArgumentException If $responseIdentifier is not a non-empty string.
[ "Set", "the", "identifier", "of", "the", "response", "the", "validity", "constraint", "applies", "to", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/ResponseValidityConstraint.php#L101-L110
oat-sa/qti-sdk
src/qtism/data/state/ResponseValidityConstraint.php
ResponseValidityConstraint.setPatternMask
public function setPatternMask($patternMask) { if (is_string($patternMask) === false) { throw new InvalidArgumentException( "The 'patternMask' argument must be a string, '" . gettype($patternMask) . "' given." ); } $this->patternMask = $patter...
php
public function setPatternMask($patternMask) { if (is_string($patternMask) === false) { throw new InvalidArgumentException( "The 'patternMask' argument must be a string, '" . gettype($patternMask) . "' given." ); } $this->patternMask = $patter...
[ "public", "function", "setPatternMask", "(", "$", "patternMask", ")", "{", "if", "(", "is_string", "(", "$", "patternMask", ")", "===", "false", ")", "{", "throw", "new", "InvalidArgumentException", "(", "\"The 'patternMask' argument must be a string, '\"", ".", "ge...
Set the PatternMask for the ResponseValidityConstraint. Set the XML Schema regular expression representing a constraint to be applied on all string values contained by the variable described in the $responseÏdentifier variable. Providing an empty string as the $patternMask means there is no constraint to be applied. ...
[ "Set", "the", "PatternMask", "for", "the", "ResponseValidityConstraint", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/ResponseValidityConstraint.php#L197-L206
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/TableMarshaller.php
TableMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = self::getDOMCradle()->createElement('table'); if ($component->hasSummary() === true) { $this->setDOMElementAttribute($element, 'summary', $component->getSummary()); } if ($component->hasXmlBase() === true...
php
protected function marshall(QtiComponent $component) { $element = self::getDOMCradle()->createElement('table'); if ($component->hasSummary() === true) { $this->setDOMElementAttribute($element, 'summary', $component->getSummary()); } if ($component->hasXmlBase() === true...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "self", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "'table'", ")", ";", "if", "(", "$", "component", "->", "hasSummary", "(", ")", ...
Marshall a Table object into a DOMElement object. @param \qtism\data\QtiComponent $component A Table object. @return \DOMElement The according DOMElement object. @throws \qtism\data\storage\xml\marshalling\MarshallingException
[ "Marshall", "a", "Table", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/TableMarshaller.php#L47-L101
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/TableMarshaller.php
TableMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { $tbodyElts = $this->getChildElementsByTagName($element, 'tbody'); if (count($tbodyElts) > 0) { $tbodies = new TbodyCollection(); foreach ($tbodyElts as $tbodyElt) { $marshaller = $this->getMarshallerFacto...
php
protected function unmarshall(DOMElement $element) { $tbodyElts = $this->getChildElementsByTagName($element, 'tbody'); if (count($tbodyElts) > 0) { $tbodies = new TbodyCollection(); foreach ($tbodyElts as $tbodyElt) { $marshaller = $this->getMarshallerFacto...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "$", "tbodyElts", "=", "$", "this", "->", "getChildElementsByTagName", "(", "$", "element", ",", "'tbody'", ")", ";", "if", "(", "count", "(", "$", "tbodyElts", ")", ">", ...
Unmarshall a DOMElement object corresponding to an XHTML table element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A Table object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "an", "XHTML", "table", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/TableMarshaller.php#L110-L178
oat-sa/qti-sdk
src/qtism/common/utils/Exception.php
Exception.formatMessage
static public function formatMessage(\Exception $e, $withClassName = true) { $returnValue = ''; do { $className = get_class($e); $message = $e->getMessage(); $returnValue .= ($withClassName === true) ? "[${className}] ${message}" : $message; ...
php
static public function formatMessage(\Exception $e, $withClassName = true) { $returnValue = ''; do { $className = get_class($e); $message = $e->getMessage(); $returnValue .= ($withClassName === true) ? "[${className}] ${message}" : $message; ...
[ "static", "public", "function", "formatMessage", "(", "\\", "Exception", "$", "e", ",", "$", "withClassName", "=", "true", ")", "{", "$", "returnValue", "=", "''", ";", "do", "{", "$", "className", "=", "get_class", "(", "$", "e", ")", ";", "$", "mes...
Format an Exception message. This method will format an exception message using the following scheme: [CLASSNAME] MESSAGE If the Exception contains previous exceptions, the following scheme will be used: [CLASSNAME] MESSAGE Caused by: [CLASSNAME] MESSAGE ... @param \Exception $e A PHP Exception object. @param true...
[ "Format", "an", "Exception", "message", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/utils/Exception.php#L49-L64
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/ValueMarshaller.php
ValueMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $fieldIdentifer = $component->getFieldIdentifier(); $baseType = $component->getBaseType(); self::setDOMElementValue($element, $component->getValue...
php
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $fieldIdentifer = $component->getFieldIdentifier(); $baseType = $component->getBaseType(); self::setDOMElementValue($element, $component->getValue...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "static", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "$", "component", "->", "getQtiClassName", "(", ")", ")", ";", "$", "fieldIdentif...
Marshall a Value object into a DOMElement object. @param \qtism\data\QtiComponent $component A Value object. @return \DOMElement The according DOMElement object.
[ "Marshall", "a", "Value", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/ValueMarshaller.php#L95-L113
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/ValueMarshaller.php
ValueMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { $object = null; if (($baseType = $this->getDOMElementAttributeAs($element, 'baseType', 'string')) !== null) { // baseType attribute is set -> part of a record. $baseTypeCst = BaseType::getConstantByName($baseType); ...
php
protected function unmarshall(DOMElement $element) { $object = null; if (($baseType = $this->getDOMElementAttributeAs($element, 'baseType', 'string')) !== null) { // baseType attribute is set -> part of a record. $baseTypeCst = BaseType::getConstantByName($baseType); ...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "$", "object", "=", "null", ";", "if", "(", "(", "$", "baseType", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'baseType'", ",", "'string'...
Unmarshall a DOMElement object corresponding to a QTI Value element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A Value object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException If the 'baseType' attribute is not a valid QTI baseType.
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "Value", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/ValueMarshaller.php#L122-L159
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/AbstractQtiBinaryStorage.php
AbstractQtiBinaryStorage.instantiate
public function instantiate($config = 0, $sessionId = '') { // If not provided, generate a session ID. if (empty($sessionId) === true) { $sessionId = uniqid('qtism', true); } try { $session = $this->getManager()->createAssessmentTestSession($this->getAssessme...
php
public function instantiate($config = 0, $sessionId = '') { // If not provided, generate a session ID. if (empty($sessionId) === true) { $sessionId = uniqid('qtism', true); } try { $session = $this->getManager()->createAssessmentTestSession($this->getAssessme...
[ "public", "function", "instantiate", "(", "$", "config", "=", "0", ",", "$", "sessionId", "=", "''", ")", "{", "// If not provided, generate a session ID.", "if", "(", "empty", "(", "$", "sessionId", ")", "===", "true", ")", "{", "$", "sessionId", "=", "un...
Instantiate a new AssessmentTestSession. @param integer $config (optional) The configuration to be taken into account for the instantiated AssessmentTestSession object. @param string $sessionId An session ID. If not provided, a new session ID will be generated and given to the AssessmentTestSession. @return \qtism\run...
[ "Instantiate", "a", "new", "AssessmentTestSession", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/AbstractQtiBinaryStorage.php#L96-L112
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/AbstractQtiBinaryStorage.php
AbstractQtiBinaryStorage.persist
public function persist(AssessmentTestSession $assessmentTestSession) { try { $stream = new MemoryStream(); $stream->open(); $access = $this->createBinaryStreamAccess($stream); // -- Deal with intrinsic values of the Test Session. $access->writeT...
php
public function persist(AssessmentTestSession $assessmentTestSession) { try { $stream = new MemoryStream(); $stream->open(); $access = $this->createBinaryStreamAccess($stream); // -- Deal with intrinsic values of the Test Session. $access->writeT...
[ "public", "function", "persist", "(", "AssessmentTestSession", "$", "assessmentTestSession", ")", "{", "try", "{", "$", "stream", "=", "new", "MemoryStream", "(", ")", ";", "$", "stream", "->", "open", "(", ")", ";", "$", "access", "=", "$", "this", "->"...
Persist an AssessmentTestSession into persistent binary data. @param \qtism\runtime\tests\AssessmentTestSession $assessmentTestSession @throws \qtism\runtime\storage\common\StorageException
[ "Persist", "an", "AssessmentTestSession", "into", "persistent", "binary", "data", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/AbstractQtiBinaryStorage.php#L120-L219
oat-sa/qti-sdk
src/qtism/runtime/storage/binary/AbstractQtiBinaryStorage.php
AbstractQtiBinaryStorage.retrieve
public function retrieve($sessionId) { try { $stream = $this->getRetrievalStream($sessionId); $stream->open(); $access = $this->createBinaryStreamAccess($stream); // -- Deal with intrinsic values of the Test Session. $assessmentTestSessionState =...
php
public function retrieve($sessionId) { try { $stream = $this->getRetrievalStream($sessionId); $stream->open(); $access = $this->createBinaryStreamAccess($stream); // -- Deal with intrinsic values of the Test Session. $assessmentTestSessionState =...
[ "public", "function", "retrieve", "(", "$", "sessionId", ")", "{", "try", "{", "$", "stream", "=", "$", "this", "->", "getRetrievalStream", "(", "$", "sessionId", ")", ";", "$", "stream", "->", "open", "(", ")", ";", "$", "access", "=", "$", "this", ...
Retrieve an AssessmentTestSession object from storage by $sessionId. @param string $sessionId @throws \qtism\runtime\storage\common\StorageException If the AssessmentTestSession could not be retrieved from persistent binary storage.
[ "Retrieve", "an", "AssessmentTestSession", "object", "from", "storage", "by", "$sessionId", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/storage/binary/AbstractQtiBinaryStorage.php#L227-L328
oat-sa/qti-sdk
src/qtism/data/state/VariableMapping.php
VariableMapping.setSource
public function setSource($source) { if (Format::isIdentifier($source)) { $this->source = $source; } else { $msg = "'${source}' is not a valid QTI identifier."; throw new InvalidArgumentException($msg); } }
php
public function setSource($source) { if (Format::isIdentifier($source)) { $this->source = $source; } else { $msg = "'${source}' is not a valid QTI identifier."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setSource", "(", "$", "source", ")", "{", "if", "(", "Format", "::", "isIdentifier", "(", "$", "source", ")", ")", "{", "$", "this", "->", "source", "=", "$", "source", ";", "}", "else", "{", "$", "msg", "=", "\"'${source}' is ...
Set the source variable identifier. @param string $source A valid QTI identifier. @throws \InvalidArgumentException If $source is not a valid QTI identifier.
[ "Set", "the", "source", "variable", "identifier", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/VariableMapping.php#L88-L96
oat-sa/qti-sdk
src/qtism/data/state/VariableMapping.php
VariableMapping.setTarget
public function setTarget($target) { if (Format::isIdentifier($target)) { $this->target = $target; } else { $msg = "'${target}' is not a valid QTI identifier."; throw new InvalidArgumentException($msg); } }
php
public function setTarget($target) { if (Format::isIdentifier($target)) { $this->target = $target; } else { $msg = "'${target}' is not a valid QTI identifier."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setTarget", "(", "$", "target", ")", "{", "if", "(", "Format", "::", "isIdentifier", "(", "$", "target", ")", ")", "{", "$", "this", "->", "target", "=", "$", "target", ";", "}", "else", "{", "$", "msg", "=", "\"'${target}' is ...
Set the target variable identifier. @param string $target A valid QTI identifier. @throws \InvalidArgumentException If $target is not a valid QTI identifier.
[ "Set", "the", "target", "variable", "identifier", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/state/VariableMapping.php#L114-L122
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/VariableMarshaller.php
VariableMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'identifier', $component->getIdentifier()); $weightIdentifier = $component->getWeightIdentifier(); if (!em...
php
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'identifier', $component->getIdentifier()); $weightIdentifier = $component->getWeightIdentifier(); if (!em...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "static", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "$", "component", "->", "getQtiClassName", "(", ")", ")", ";", "$", "this", "->...
Marshall a Variable object into a DOMElement object. @param \qtism\data\QtiComponent $component A Variable object. @return \DOMElement The according DOMElement object.
[ "Marshall", "a", "Variable", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/VariableMarshaller.php#L43-L55
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/VariableMarshaller.php
VariableMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { if (($identifier = $this->getDOMElementAttributeAs($element, 'identifier')) !== null) { $object = new Variable($identifier); if (($weightIdentifier = $this->getDOMElementAttributeAs($element, 'weightIdentifier')) !== null) { ...
php
protected function unmarshall(DOMElement $element) { if (($identifier = $this->getDOMElementAttributeAs($element, 'identifier')) !== null) { $object = new Variable($identifier); if (($weightIdentifier = $this->getDOMElementAttributeAs($element, 'weightIdentifier')) !== null) { ...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "if", "(", "(", "$", "identifier", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'identifier'", ")", ")", "!==", "null", ")", "{", "$", "...
Unmarshall a DOMElement object corresponding to a QTI Variable element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A Variable object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException If the mandatory attribute 'identifier' is not set in $element.
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "Variable", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/VariableMarshaller.php#L64-L78
oat-sa/qti-sdk
src/qtism/runtime/rendering/qtipl/expressions/RandomIntegerQtiPLRenderer.php
RandomIntegerQtiPLRenderer.render
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); $attributes = []; $attributes['min'] = $something->getMin(); $attributes['max'] = $something->getMax(); if ($something->getStep() != 1) { $attributes['step'] = $something->get...
php
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); $attributes = []; $attributes['min'] = $something->getMin(); $attributes['max'] = $something->getMax(); if ($something->getStep() != 1) { $attributes['step'] = $something->get...
[ "public", "function", "render", "(", "$", "something", ")", "{", "$", "renderer", "=", "new", "QtiPLRenderer", "(", "$", "this", "->", "getCRO", "(", ")", ")", ";", "$", "attributes", "=", "[", "]", ";", "$", "attributes", "[", "'min'", "]", "=", "...
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/RandomIntegerQtiPLRenderer.php#L45-L59
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/StylesheetMarshaller.php
StylesheetMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'href', $component->getHref()); $this->setDOMElementAttribute($element, 'media', $component->getMedia()); $...
php
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $this->setDOMElementAttribute($element, 'href', $component->getHref()); $this->setDOMElementAttribute($element, 'media', $component->getMedia()); $...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "static", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "$", "component", "->", "getQtiClassName", "(", ")", ")", ";", "$", "this", "->...
Marshall a Stylesheet object into a DOMElement object. @param \qtism\data\QtiComponent $component A Stylesheet object. @return \DOMElement The according DOMElement object.
[ "Marshall", "a", "Stylesheet", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/StylesheetMarshaller.php#L43-L56
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/StylesheetMarshaller.php
StylesheetMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { // href is a mandatory value, retrieve it first. if (($value = $this->getDOMElementAttributeAs($element, 'href', 'string')) !== null) { $object = new Stylesheet($value); if (($value = $this->getDOMElementAttributeAs($eleme...
php
protected function unmarshall(DOMElement $element) { // href is a mandatory value, retrieve it first. if (($value = $this->getDOMElementAttributeAs($element, 'href', 'string')) !== null) { $object = new Stylesheet($value); if (($value = $this->getDOMElementAttributeAs($eleme...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "// href is a mandatory value, retrieve it first.", "if", "(", "(", "$", "value", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'href'", ",", "'str...
Unmarshall a DOMElement object corresponding to a QTI stylesheet element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A Stylesheet object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException If the mandatory attribute 'href' is missing from $element.
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "stylesheet", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/StylesheetMarshaller.php#L65-L88
oat-sa/qti-sdk
src/qtism/data/rules/OutcomeIf.php
OutcomeIf.setOutcomeRules
public function setOutcomeRules(OutcomeRuleCollection $outcomeRules) { if (count($outcomeRules) > 0) { $this->outcomeRules = $outcomeRules; } else { $msg = "An OutcomeIf object must be bound to at least one OutcomeRule."; throw new InvalidArgumentException($msg); ...
php
public function setOutcomeRules(OutcomeRuleCollection $outcomeRules) { if (count($outcomeRules) > 0) { $this->outcomeRules = $outcomeRules; } else { $msg = "An OutcomeIf object must be bound to at least one OutcomeRule."; throw new InvalidArgumentException($msg); ...
[ "public", "function", "setOutcomeRules", "(", "OutcomeRuleCollection", "$", "outcomeRules", ")", "{", "if", "(", "count", "(", "$", "outcomeRules", ")", ">", "0", ")", "{", "$", "this", "->", "outcomeRules", "=", "$", "outcomeRules", ";", "}", "else", "{",...
Set the OutcomeRule objects to be evaluated as sub expressions if the expression evaluated with the If statement returns true. @param \qtism\data\rules\OutcomeRuleCollection $outcomeRules A collection of OutcomeRule objects. @throws \InvalidArgumentException If $outcomeRules is an empty collection.
[ "Set", "the", "OutcomeRule", "objects", "to", "be", "evaluated", "as", "sub", "expressions", "if", "the", "expression", "evaluated", "with", "the", "If", "statement", "returns", "true", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/rules/OutcomeIf.php#L101-L109
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/DrawingInteractionMarshaller.php
DrawingInteractionMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = $this->createElement($component); $this->fillElement($element, $component); $this->setDOMElementAttribute($element, 'responseIdentifier', $component->getResponseIdentifier()); if ($component->hasXmlBase() === true) { ...
php
protected function marshall(QtiComponent $component) { $element = $this->createElement($component); $this->fillElement($element, $component); $this->setDOMElementAttribute($element, 'responseIdentifier', $component->getResponseIdentifier()); if ($component->hasXmlBase() === true) { ...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "$", "this", "->", "createElement", "(", "$", "component", ")", ";", "$", "this", "->", "fillElement", "(", "$", "element", ",", "$", "component", ...
Marshall a DrawingInteraction object into a DOMElement object. @param \qtism\data\QtiComponent $component A DrawingInteraction object. @return \DOMElement The according DOMElement object. @throws \qtism\data\storage\xml\marshalling\MarshallingException
[ "Marshall", "a", "DrawingInteraction", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/DrawingInteractionMarshaller.php#L44-L61
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/DrawingInteractionMarshaller.php
DrawingInteractionMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { if (($responseIdentifier = $this->getDOMElementAttributeAs($element, 'responseIdentifier')) !== null) { $objectElts = $this->getChildElementsByTagName($element, 'object'); if (count($objectElts) > 0) { $objectElt =...
php
protected function unmarshall(DOMElement $element) { if (($responseIdentifier = $this->getDOMElementAttributeAs($element, 'responseIdentifier')) !== null) { $objectElts = $this->getChildElementsByTagName($element, 'object'); if (count($objectElts) > 0) { $objectElt =...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "if", "(", "(", "$", "responseIdentifier", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'responseIdentifier'", ")", ")", "!==", "null", ")", ...
Unmarshall a DOMElement object corresponding to a DrawingInteraction element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A DrawingInteraction object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "DrawingInteraction", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/DrawingInteractionMarshaller.php#L70-L103
oat-sa/qti-sdk
src/qtism/runtime/rendering/qtipl/expressions/VariableQtiPLRenderer.php
VariableQtiPLRenderer.render
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); $attributes = []; $attributes['identifier'] = "\"" . $something->getIdentifier() . "\""; if ($something->getWeightIdentifier() != "") { $attributes['weightIdentifier'] = "\"" . $somethin...
php
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); $attributes = []; $attributes['identifier'] = "\"" . $something->getIdentifier() . "\""; if ($something->getWeightIdentifier() != "") { $attributes['weightIdentifier'] = "\"" . $somethin...
[ "public", "function", "render", "(", "$", "something", ")", "{", "$", "renderer", "=", "new", "QtiPLRenderer", "(", "$", "this", "->", "getCRO", "(", ")", ")", ";", "$", "attributes", "=", "[", "]", ";", "$", "attributes", "[", "'identifier'", "]", "...
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/VariableQtiPLRenderer.php#L45-L57
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/CorrectResponseMarshaller.php
CorrectResponseMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $interpretation = $component->getInterpretation(); if (!empty($interpretation)) { $this->setDOMElementAttribute($element, 'interpretation', $in...
php
protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); $interpretation = $component->getInterpretation(); if (!empty($interpretation)) { $this->setDOMElementAttribute($element, 'interpretation', $in...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "static", "::", "getDOMCradle", "(", ")", "->", "createElement", "(", "$", "component", "->", "getQtiClassName", "(", ")", ")", ";", "$", "interpretati...
Marshall a CorrectResponse object into a DOMElement object. @param \qtism\data\QtiComponent $component A CorrectResponse object. @return \DOMElement The according DOMElement object.
[ "Marshall", "a", "CorrectResponse", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/CorrectResponseMarshaller.php#L86-L103
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/ResponseDeclarationMarshaller.php
ResponseDeclarationMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = parent::marshall($component); $baseType = $component->getBaseType(); if ($component->getCorrectResponse() !== null) { $marshaller = $this->getMarshallerFactory()->createMarshaller($component->getCorrectResponse(),...
php
protected function marshall(QtiComponent $component) { $element = parent::marshall($component); $baseType = $component->getBaseType(); if ($component->getCorrectResponse() !== null) { $marshaller = $this->getMarshallerFactory()->createMarshaller($component->getCorrectResponse(),...
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "parent", "::", "marshall", "(", "$", "component", ")", ";", "$", "baseType", "=", "$", "component", "->", "getBaseType", "(", ")", ";", "if", "(",...
Marshall a ResponseDeclaration object into a DOMElement object. @param \qtism\data\QtiComponent $component A ResponseDeclaration object. @return \DOMElement The according DOMElement object.
[ "Marshall", "a", "ResponseDeclaration", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/ResponseDeclarationMarshaller.php#L44-L65
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/ResponseDeclarationMarshaller.php
ResponseDeclarationMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { try { $baseComponent = parent::unmarshall($element); $object = new ResponseDeclaration($baseComponent->getIdentifier()); $object->setBaseType($baseComponent->getBaseType()); $object->setCardinality($baseComp...
php
protected function unmarshall(DOMElement $element) { try { $baseComponent = parent::unmarshall($element); $object = new ResponseDeclaration($baseComponent->getIdentifier()); $object->setBaseType($baseComponent->getBaseType()); $object->setCardinality($baseComp...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "try", "{", "$", "baseComponent", "=", "parent", "::", "unmarshall", "(", "$", "element", ")", ";", "$", "object", "=", "new", "ResponseDeclaration", "(", "$", "baseComponent...
Unmarshall a DOMElement object corresponding to a QTI responseDeclaration element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A ResponseDeclaration object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "responseDeclaration", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/ResponseDeclarationMarshaller.php#L74-L109
oat-sa/qti-sdk
src/qtism/data/ItemSessionControl.php
ItemSessionControl.setMaxAttempts
public function setMaxAttempts($maxAttempts) { if (is_int($maxAttempts)) { $this->maxAttempts = $maxAttempts; } else { $msg = "MaxAttempts must be an integer, '" . gettype($maxAttempts) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setMaxAttempts($maxAttempts) { if (is_int($maxAttempts)) { $this->maxAttempts = $maxAttempts; } else { $msg = "MaxAttempts must be an integer, '" . gettype($maxAttempts) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setMaxAttempts", "(", "$", "maxAttempts", ")", "{", "if", "(", "is_int", "(", "$", "maxAttempts", ")", ")", "{", "$", "this", "->", "maxAttempts", "=", "$", "maxAttempts", ";", "}", "else", "{", "$", "msg", "=", "\"MaxAttempts must...
Set the maximum number of attempts in the given test context. @param integer $maxAttempts An integer. @throws \InvalidArgumentException If $maxAttempts is not an integer.
[ "Set", "the", "maximum", "number", "of", "attempts", "in", "the", "given", "test", "context", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/ItemSessionControl.php#L173-L181
oat-sa/qti-sdk
src/qtism/data/ItemSessionControl.php
ItemSessionControl.setShowFeedback
public function setShowFeedback($showFeedback) { if (is_bool($showFeedback)) { $this->showFeedback = $showFeedback; } else { $msg = "ShowFeedback must be a boolean, '" . gettype($showFeedback) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setShowFeedback($showFeedback) { if (is_bool($showFeedback)) { $this->showFeedback = $showFeedback; } else { $msg = "ShowFeedback must be a boolean, '" . gettype($showFeedback) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setShowFeedback", "(", "$", "showFeedback", ")", "{", "if", "(", "is_bool", "(", "$", "showFeedback", ")", ")", "{", "$", "this", "->", "showFeedback", "=", "$", "showFeedback", ";", "}", "else", "{", "$", "msg", "=", "\"ShowFeedba...
Set if feedbacks must be shown in the given test context. @param boolean $showFeedback true if feedbacks must be shown, otherwise false. @throws \InvalidArgumentException If $showFeedback is not a boolean value.
[ "Set", "if", "feedbacks", "must", "be", "shown", "in", "the", "given", "test", "context", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/ItemSessionControl.php#L199-L207
oat-sa/qti-sdk
src/qtism/data/ItemSessionControl.php
ItemSessionControl.setAllowReview
public function setAllowReview($allowReview) { if (is_bool($allowReview)) { $this->allowReview = $allowReview; } else { $msg = "AllowReview must be a boolean, '" . gettype($allowReview) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setAllowReview($allowReview) { if (is_bool($allowReview)) { $this->allowReview = $allowReview; } else { $msg = "AllowReview must be a boolean, '" . gettype($allowReview) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setAllowReview", "(", "$", "allowReview", ")", "{", "if", "(", "is_bool", "(", "$", "allowReview", ")", ")", "{", "$", "this", "->", "allowReview", "=", "$", "allowReview", ";", "}", "else", "{", "$", "msg", "=", "\"AllowReview mus...
Set that the candidate is allowed to review item body and given responses after the last item. @param boolean $allowReview true if allowed, false if not. @throws \InvalidArgumentException If $allowReview is not a boolean.
[ "Set", "that", "the", "candidate", "is", "allowed", "to", "review", "item", "body", "and", "given", "responses", "after", "the", "last", "item", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/ItemSessionControl.php#L226-L234
oat-sa/qti-sdk
src/qtism/data/ItemSessionControl.php
ItemSessionControl.setShowSolution
public function setShowSolution($showSolution) { if (is_bool($showSolution)) { $this->showSolution = $showSolution; } else { $msg = "ShowSolution must be a boolean, '" . gettype($showSolution) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setShowSolution($showSolution) { if (is_bool($showSolution)) { $this->showSolution = $showSolution; } else { $msg = "ShowSolution must be a boolean, '" . gettype($showSolution) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setShowSolution", "(", "$", "showSolution", ")", "{", "if", "(", "is_bool", "(", "$", "showSolution", ")", ")", "{", "$", "this", "->", "showSolution", "=", "$", "showSolution", ";", "}", "else", "{", "$", "msg", "=", "\"ShowSoluti...
Set if the candidate is provided a way to enter the 'solution' state. @param boolean $showSolution true if he is provided, false if not. @throws \InvalidArgumentException If $showSolution is not a boolean.
[ "Set", "if", "the", "candidate", "is", "provided", "a", "way", "to", "enter", "the", "solution", "state", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/ItemSessionControl.php#L252-L260
oat-sa/qti-sdk
src/qtism/data/ItemSessionControl.php
ItemSessionControl.setAllowComment
public function setAllowComment($allowComment) { if (is_bool($allowComment)) { $this->allowComment = $allowComment; } else { $msg = "AllowComment must be a boolean, '" . gettype($allowComment) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setAllowComment($allowComment) { if (is_bool($allowComment)) { $this->allowComment = $allowComment; } else { $msg = "AllowComment must be a boolean, '" . gettype($allowComment) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setAllowComment", "(", "$", "allowComment", ")", "{", "if", "(", "is_bool", "(", "$", "allowComment", ")", ")", "{", "$", "this", "->", "allowComment", "=", "$", "allowComment", ";", "}", "else", "{", "$", "msg", "=", "\"AllowComme...
Set if the candidate is allowed to communicate comments during the session. @param boolean $allowComment true if allowed, false if not. @throws \InvalidArgumentException If $allowComment is not a boolean.
[ "Set", "if", "the", "candidate", "is", "allowed", "to", "communicate", "comments", "during", "the", "session", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/ItemSessionControl.php#L278-L286
oat-sa/qti-sdk
src/qtism/data/ItemSessionControl.php
ItemSessionControl.setAllowSkipping
public function setAllowSkipping($allowSkipping) { if (is_bool($allowSkipping)) { $this->allowSkipping = $allowSkipping; } else { $msg = "AllowSkipping must be a boolean, '" . gettype($allowSkipping) . "' given."; throw new InvalidArgumentException($msg); ...
php
public function setAllowSkipping($allowSkipping) { if (is_bool($allowSkipping)) { $this->allowSkipping = $allowSkipping; } else { $msg = "AllowSkipping must be a boolean, '" . gettype($allowSkipping) . "' given."; throw new InvalidArgumentException($msg); ...
[ "public", "function", "setAllowSkipping", "(", "$", "allowSkipping", ")", "{", "if", "(", "is_bool", "(", "$", "allowSkipping", ")", ")", "{", "$", "this", "->", "allowSkipping", "=", "$", "allowSkipping", ";", "}", "else", "{", "$", "msg", "=", "\"Allow...
Set if the candidate is allowed to skip items. Set whether or not the Delivery Engine allows the candidate to skip items. @param boolean $allowSkipping true if allowed, false otherwise. @throws \InvalidArgumentException If $allowSkipping is not a valid boolean.
[ "Set", "if", "the", "candidate", "is", "allowed", "to", "skip", "items", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/ItemSessionControl.php#L308-L316
oat-sa/qti-sdk
src/qtism/data/ItemSessionControl.php
ItemSessionControl.isDefault
public function isDefault() { return $this->getMaxAttempts() === 1 && $this->mustShowFeedback() === false && $this->doesAllowReview() === true && $this->mustShowSolution() === false && $this->doesAllowComment() === false && ...
php
public function isDefault() { return $this->getMaxAttempts() === 1 && $this->mustShowFeedback() === false && $this->doesAllowReview() === true && $this->mustShowSolution() === false && $this->doesAllowComment() === false && ...
[ "public", "function", "isDefault", "(", ")", "{", "return", "$", "this", "->", "getMaxAttempts", "(", ")", "===", "1", "&&", "$", "this", "->", "mustShowFeedback", "(", ")", "===", "false", "&&", "$", "this", "->", "doesAllowReview", "(", ")", "===", "...
Is a default Item Session Control? Whether the values held by the ItemSessionControl are the default ones. @return boolean
[ "Is", "a", "default", "Item", "Session", "Control?" ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/ItemSessionControl.php#L335-L344
oat-sa/qti-sdk
src/qtism/data/ItemSessionControl.php
ItemSessionControl.setValidateResponses
public function setValidateResponses($validateResponses) { if (is_bool($validateResponses)) { $this->validateResponses = $validateResponses; } else { $msg = "ValidateResponses must be a boolean value, '" . gettype($validateResponses) . "' given."; throw new Invali...
php
public function setValidateResponses($validateResponses) { if (is_bool($validateResponses)) { $this->validateResponses = $validateResponses; } else { $msg = "ValidateResponses must be a boolean value, '" . gettype($validateResponses) . "' given."; throw new Invali...
[ "public", "function", "setValidateResponses", "(", "$", "validateResponses", ")", "{", "if", "(", "is_bool", "(", "$", "validateResponses", ")", ")", "{", "$", "this", "->", "validateResponses", "=", "$", "validateResponses", ";", "}", "else", "{", "$", "msg...
Set if the responses must be validated. Set whether or not responses must be validated by the Delivery Engine. @param boolean $validateResponses true if responses must be validated, false if not. @throws \InvalidArgumentException If $validateResponses is not a boolean.
[ "Set", "if", "the", "responses", "must", "be", "validated", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/ItemSessionControl.php#L354-L362
oat-sa/qti-sdk
src/qtism/runtime/common/RecordContainer.php
RecordContainer.offsetSet
public function offsetSet($offset, $value) { if (gettype($offset) === 'string') { $this->checkType($value); $placeholder = &$this->getDataPlaceHolder(); $placeholder[$offset] = $value; } else { $msg = "The offset of a value in a RecordContainer must be...
php
public function offsetSet($offset, $value) { if (gettype($offset) === 'string') { $this->checkType($value); $placeholder = &$this->getDataPlaceHolder(); $placeholder[$offset] = $value; } else { $msg = "The offset of a value in a RecordContainer must be...
[ "public", "function", "offsetSet", "(", "$", "offset", ",", "$", "value", ")", "{", "if", "(", "gettype", "(", "$", "offset", ")", "===", "'string'", ")", "{", "$", "this", "->", "checkType", "(", "$", "value", ")", ";", "$", "placeholder", "=", "&...
Overloading of offsetSet that makes sure that the $offset is a string. @param string $offset A string offset. @param mixed $value A value. @throws \RuntimeException If $offset is not a string.
[ "Overloading", "of", "offsetSet", "that", "makes", "sure", "that", "the", "$offset", "is", "a", "string", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/common/RecordContainer.php#L89-L99
oat-sa/qti-sdk
src/qtism/runtime/common/RecordContainer.php
RecordContainer.createFromDataModel
public static function createFromDataModel(ValueCollection $valueCollection) { $container = new static(); foreach ($valueCollection as $value) { $fieldIdentifier = $value->getFieldIdentifier(); if (!empty($fieldIdentifier)) { $container[$value->getFieldIdenti...
php
public static function createFromDataModel(ValueCollection $valueCollection) { $container = new static(); foreach ($valueCollection as $value) { $fieldIdentifier = $value->getFieldIdentifier(); if (!empty($fieldIdentifier)) { $container[$value->getFieldIdenti...
[ "public", "static", "function", "createFromDataModel", "(", "ValueCollection", "$", "valueCollection", ")", "{", "$", "container", "=", "new", "static", "(", ")", ";", "foreach", "(", "$", "valueCollection", "as", "$", "value", ")", "{", "$", "fieldIdentifier"...
Create a RecordContainer object from a Data Model ValueCollection object. @param \qtism\data\state\ValueCollection $valueCollection A collection of qtism\data\state\Value objects. @return \qtism\runtime\common\RecordContainer A Container object populated with the values found in $valueCollection. @throws \InvalidArgum...
[ "Create", "a", "RecordContainer", "object", "from", "a", "Data", "Model", "ValueCollection", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/common/RecordContainer.php#L108-L124
oat-sa/qti-sdk
src/qtism/runtime/rendering/qtipl/expressions/OutcomeMaximumQtiPLRenderer.php
OutcomeMaximumQtiPLRenderer.render
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); $attributes = []; if ($something->getSectionIdentifier() != "") { $attributes['sectionIdentifier'] = "\"" . $something->getSectionIdentifier() . "\""; } if ($something->getInclu...
php
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); $attributes = []; if ($something->getSectionIdentifier() != "") { $attributes['sectionIdentifier'] = "\"" . $something->getSectionIdentifier() . "\""; } if ($something->getInclu...
[ "public", "function", "render", "(", "$", "something", ")", "{", "$", "renderer", "=", "new", "QtiPLRenderer", "(", "$", "this", "->", "getCRO", "(", ")", ")", ";", "$", "attributes", "=", "[", "]", ";", "if", "(", "$", "something", "->", "getSection...
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/OutcomeMaximumQtiPLRenderer.php#L45-L70
oat-sa/qti-sdk
src/qtism/data/storage/php/marshalling/PhpArrayMarshaller.php
PhpArrayMarshaller.marshall
public function marshall() { $ctx = $this->getContext(); $access = $ctx->getStreamAccess(); $array = $this->getToMarshall(); $args = new PhpArgumentCollection(); foreach ($array as $a) { if (PhpUtils::isScalar($a) === false) { $msg = "The PhpArray...
php
public function marshall() { $ctx = $this->getContext(); $access = $ctx->getStreamAccess(); $array = $this->getToMarshall(); $args = new PhpArgumentCollection(); foreach ($array as $a) { if (PhpUtils::isScalar($a) === false) { $msg = "The PhpArray...
[ "public", "function", "marshall", "(", ")", "{", "$", "ctx", "=", "$", "this", "->", "getContext", "(", ")", ";", "$", "access", "=", "$", "ctx", "->", "getStreamAccess", "(", ")", ";", "$", "array", "=", "$", "this", "->", "getToMarshall", "(", ")...
Marshall an array into PHP source code. @throws \qtism\data\storage\php\marshalling\PhpMarshallingException If something wrong happens during marshalling.
[ "Marshall", "an", "array", "into", "PHP", "source", "code", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/php/marshalling/PhpArrayMarshaller.php#L43-L66
oat-sa/qti-sdk
src/qtism/common/storage/BinaryStreamAccess.php
BinaryStreamAccess.setStream
protected function setStream(IStream $stream) { if ($stream->isOpen() === false) { $msg = "A BinaryStreamAccess do not accept closed streams to be read."; throw new BinaryStreamAccessException($msg, $this, StreamAccessException::NOT_OPEN); } parent::setStream($stream)...
php
protected function setStream(IStream $stream) { if ($stream->isOpen() === false) { $msg = "A BinaryStreamAccess do not accept closed streams to be read."; throw new BinaryStreamAccessException($msg, $this, StreamAccessException::NOT_OPEN); } parent::setStream($stream)...
[ "protected", "function", "setStream", "(", "IStream", "$", "stream", ")", "{", "if", "(", "$", "stream", "->", "isOpen", "(", ")", "===", "false", ")", "{", "$", "msg", "=", "\"A BinaryStreamAccess do not accept closed streams to be read.\"", ";", "throw", "new"...
Set the IStream object to be read. @param \qtism\common\storage\IStream $stream An IStream object. @throws \qtism\common\storage\StreamAccessException If the $stream is not open yet.
[ "Set", "the", "IStream", "object", "to", "be", "read", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/storage/BinaryStreamAccess.php#L41-L49
oat-sa/qti-sdk
src/qtism/common/storage/BinaryStreamAccess.php
BinaryStreamAccess.readTinyInt
public function readTinyInt() { try { $bin = $this->getStream()->read(1); return ord($bin); } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessException::TINYINT); } }
php
public function readTinyInt() { try { $bin = $this->getStream()->read(1); return ord($bin); } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessException::TINYINT); } }
[ "public", "function", "readTinyInt", "(", ")", "{", "try", "{", "$", "bin", "=", "$", "this", "->", "getStream", "(", ")", "->", "read", "(", "1", ")", ";", "return", "ord", "(", "$", "bin", ")", ";", "}", "catch", "(", "StreamException", "$", "e...
Read a single byte unsigned integer from the current binary stream. @throws \qtism\common\storage\BinaryStreamAccessException @return integer
[ "Read", "a", "single", "byte", "unsigned", "integer", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/storage/BinaryStreamAccess.php#L57-L66
oat-sa/qti-sdk
src/qtism/common/storage/BinaryStreamAccess.php
BinaryStreamAccess.writeTinyInt
public function writeTinyInt($tinyInt) { try { $this->getStream()->write(chr($tinyInt)); } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessException::TINYINT, false); } }
php
public function writeTinyInt($tinyInt) { try { $this->getStream()->write(chr($tinyInt)); } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessException::TINYINT, false); } }
[ "public", "function", "writeTinyInt", "(", "$", "tinyInt", ")", "{", "try", "{", "$", "this", "->", "getStream", "(", ")", "->", "write", "(", "chr", "(", "$", "tinyInt", ")", ")", ";", "}", "catch", "(", "StreamException", "$", "e", ")", "{", "$",...
Write a single byte unsigned integer in the current binary stream. @param integer $tinyInt @throws \qtism\common\storage\BinaryStreamAccessException
[ "Write", "a", "single", "byte", "unsigned", "integer", "in", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/storage/BinaryStreamAccess.php#L74-L81
oat-sa/qti-sdk
src/qtism/common/storage/BinaryStreamAccess.php
BinaryStreamAccess.readShort
public function readShort() { try { $bin = $this->getStream()->read(2); return current(unpack('S', $bin)); } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessException::SHORT); } }
php
public function readShort() { try { $bin = $this->getStream()->read(2); return current(unpack('S', $bin)); } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessException::SHORT); } }
[ "public", "function", "readShort", "(", ")", "{", "try", "{", "$", "bin", "=", "$", "this", "->", "getStream", "(", ")", "->", "read", "(", "2", ")", ";", "return", "current", "(", "unpack", "(", "'S'", ",", "$", "bin", ")", ")", ";", "}", "cat...
Read a 2 bytes unsigned integer from the current binary stream. @throws \qtism\common\storage\BinaryStreamAccessException @return integer
[ "Read", "a", "2", "bytes", "unsigned", "integer", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/storage/BinaryStreamAccess.php#L89-L98
oat-sa/qti-sdk
src/qtism/common/storage/BinaryStreamAccess.php
BinaryStreamAccess.writeShort
public function writeShort($short) { try { $this->getStream()->write(pack('S', $short)); } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessException::SHORT, false); } }
php
public function writeShort($short) { try { $this->getStream()->write(pack('S', $short)); } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessException::SHORT, false); } }
[ "public", "function", "writeShort", "(", "$", "short", ")", "{", "try", "{", "$", "this", "->", "getStream", "(", ")", "->", "write", "(", "pack", "(", "'S'", ",", "$", "short", ")", ")", ";", "}", "catch", "(", "StreamException", "$", "e", ")", ...
Write a 2 bytes unsigned integer in the current binary stream. @param integer $short @throws \qtism\common\storage\BinaryStreamAccessException
[ "Write", "a", "2", "bytes", "unsigned", "integer", "in", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/storage/BinaryStreamAccess.php#L106-L113
oat-sa/qti-sdk
src/qtism/common/storage/BinaryStreamAccess.php
BinaryStreamAccess.readInteger
public function readInteger() { try { $bin = $this->getStream()->read(4); return current(unpack('l', $bin)); } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessException::INT); } }
php
public function readInteger() { try { $bin = $this->getStream()->read(4); return current(unpack('l', $bin)); } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessException::INT); } }
[ "public", "function", "readInteger", "(", ")", "{", "try", "{", "$", "bin", "=", "$", "this", "->", "getStream", "(", ")", "->", "read", "(", "4", ")", ";", "return", "current", "(", "unpack", "(", "'l'", ",", "$", "bin", ")", ")", ";", "}", "c...
Read a 8 bytes signed integer from the current binary stream. @throws \qtism\common\storage\BinaryStreamAccessException @return integer
[ "Read", "a", "8", "bytes", "signed", "integer", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/storage/BinaryStreamAccess.php#L121-L130
oat-sa/qti-sdk
src/qtism/common/storage/BinaryStreamAccess.php
BinaryStreamAccess.writeInteger
public function writeInteger($int) { try { $this->getStream()->write(pack('l', $int)); } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessException::INT, false); } }
php
public function writeInteger($int) { try { $this->getStream()->write(pack('l', $int)); } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessException::INT, false); } }
[ "public", "function", "writeInteger", "(", "$", "int", ")", "{", "try", "{", "$", "this", "->", "getStream", "(", ")", "->", "write", "(", "pack", "(", "'l'", ",", "$", "int", ")", ")", ";", "}", "catch", "(", "StreamException", "$", "e", ")", "{...
Write a 8 bytes signed integer in the current binary stream. @param integer $int @throws \qtism\common\storage\BinaryStreamAccessException
[ "Write", "a", "8", "bytes", "signed", "integer", "in", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/storage/BinaryStreamAccess.php#L138-L145
oat-sa/qti-sdk
src/qtism/common/storage/BinaryStreamAccess.php
BinaryStreamAccess.readFloat
public function readFloat() { try { $bin = $this->getStream()->read(8); return current(unpack('d', $bin)); } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessException::FLOAT); } }
php
public function readFloat() { try { $bin = $this->getStream()->read(8); return current(unpack('d', $bin)); } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessException::FLOAT); } }
[ "public", "function", "readFloat", "(", ")", "{", "try", "{", "$", "bin", "=", "$", "this", "->", "getStream", "(", ")", "->", "read", "(", "8", ")", ";", "return", "current", "(", "unpack", "(", "'d'", ",", "$", "bin", ")", ")", ";", "}", "cat...
Read a double precision float from the current binary stream. @throws \qtism\common\storage\BinaryStreamAccessException @return integer
[ "Read", "a", "double", "precision", "float", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/storage/BinaryStreamAccess.php#L153-L162
oat-sa/qti-sdk
src/qtism/common/storage/BinaryStreamAccess.php
BinaryStreamAccess.writeFloat
public function writeFloat($float) { try { $this->getStream()->write(pack('d', $float)); } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessException::FLOAT, false); } }
php
public function writeFloat($float) { try { $this->getStream()->write(pack('d', $float)); } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessException::FLOAT, false); } }
[ "public", "function", "writeFloat", "(", "$", "float", ")", "{", "try", "{", "$", "this", "->", "getStream", "(", ")", "->", "write", "(", "pack", "(", "'d'", ",", "$", "float", ")", ")", ";", "}", "catch", "(", "StreamException", "$", "e", ")", ...
Write a double precision float in the current binary stream. @param float $float @throws \qtism\common\storage\BinaryStreamAccessException
[ "Write", "a", "double", "precision", "float", "in", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/storage/BinaryStreamAccess.php#L170-L177
oat-sa/qti-sdk
src/qtism/common/storage/BinaryStreamAccess.php
BinaryStreamAccess.readBoolean
public function readBoolean() { try { $int = ord($this->getStream()->read(1)); return ($int === 0) ? false : true; } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessException::BOOLEAN); } }
php
public function readBoolean() { try { $int = ord($this->getStream()->read(1)); return ($int === 0) ? false : true; } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessException::BOOLEAN); } }
[ "public", "function", "readBoolean", "(", ")", "{", "try", "{", "$", "int", "=", "ord", "(", "$", "this", "->", "getStream", "(", ")", "->", "read", "(", "1", ")", ")", ";", "return", "(", "$", "int", "===", "0", ")", "?", "false", ":", "true",...
Read a boolean value from the current binary stream. @throws \qtism\common\storage\BinaryStreamAccessException @return boolean
[ "Read", "a", "boolean", "value", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/storage/BinaryStreamAccess.php#L185-L194
oat-sa/qti-sdk
src/qtism/common/storage/BinaryStreamAccess.php
BinaryStreamAccess.writeBoolean
public function writeBoolean($boolean) { try { $val = ($boolean === true) ? 1 : 0; $this->getStream()->write(chr($val)); } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessException::FLOAT, false); } }
php
public function writeBoolean($boolean) { try { $val = ($boolean === true) ? 1 : 0; $this->getStream()->write(chr($val)); } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessException::FLOAT, false); } }
[ "public", "function", "writeBoolean", "(", "$", "boolean", ")", "{", "try", "{", "$", "val", "=", "(", "$", "boolean", "===", "true", ")", "?", "1", ":", "0", ";", "$", "this", "->", "getStream", "(", ")", "->", "write", "(", "chr", "(", "$", "...
Write a boolean value from the current binary stream. @param boolean $boolean @throws \qtism\common\storage\BinaryStreamAccessException
[ "Write", "a", "boolean", "value", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/storage/BinaryStreamAccess.php#L202-L210
oat-sa/qti-sdk
src/qtism/common/storage/BinaryStreamAccess.php
BinaryStreamAccess.readString
public function readString() { try { $binLength = $this->getStream()->read(2); $length = current(unpack('S', $binLength)); return $this->getStream()->read($length); } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessExce...
php
public function readString() { try { $binLength = $this->getStream()->read(2); $length = current(unpack('S', $binLength)); return $this->getStream()->read($length); } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessExce...
[ "public", "function", "readString", "(", ")", "{", "try", "{", "$", "binLength", "=", "$", "this", "->", "getStream", "(", ")", "->", "read", "(", "2", ")", ";", "$", "length", "=", "current", "(", "unpack", "(", "'S'", ",", "$", "binLength", ")", ...
Read a string value from the current binary stream. @throws \qtism\common\storage\BinaryStreamAccessException @return string
[ "Read", "a", "string", "value", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/storage/BinaryStreamAccess.php#L218-L228
oat-sa/qti-sdk
src/qtism/common/storage/BinaryStreamAccess.php
BinaryStreamAccess.writeString
public function writeString($string) { // $maxLen = 2^16 -1 = max val of unsigned short integer. $maxLen = 65535; $len = strlen($string); if ($len > $maxLen) { $len = $maxLen; $string = substr($string, 0, $maxLen); } try { $this->...
php
public function writeString($string) { // $maxLen = 2^16 -1 = max val of unsigned short integer. $maxLen = 65535; $len = strlen($string); if ($len > $maxLen) { $len = $maxLen; $string = substr($string, 0, $maxLen); } try { $this->...
[ "public", "function", "writeString", "(", "$", "string", ")", "{", "// $maxLen = 2^16 -1 = max val of unsigned short integer.", "$", "maxLen", "=", "65535", ";", "$", "len", "=", "strlen", "(", "$", "string", ")", ";", "if", "(", "$", "len", ">", "$", "maxLe...
Write a string value from in the current binary string. @param string $string @throws \qtism\common\storage\BinaryStreamAccessException
[ "Write", "a", "string", "value", "from", "in", "the", "current", "binary", "string", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/storage/BinaryStreamAccess.php#L236-L252
oat-sa/qti-sdk
src/qtism/common/storage/BinaryStreamAccess.php
BinaryStreamAccess.readDateTime
public function readDateTime() { try { $timeStamp = current(unpack('l', $this->getStream()->read(4))); $date = new DateTime('now', new \DateTimeZone('UTC')); return $date->setTimestamp($timeStamp); } catch (StreamException $e) { $this->handleStreamExc...
php
public function readDateTime() { try { $timeStamp = current(unpack('l', $this->getStream()->read(4))); $date = new DateTime('now', new \DateTimeZone('UTC')); return $date->setTimestamp($timeStamp); } catch (StreamException $e) { $this->handleStreamExc...
[ "public", "function", "readDateTime", "(", ")", "{", "try", "{", "$", "timeStamp", "=", "current", "(", "unpack", "(", "'l'", ",", "$", "this", "->", "getStream", "(", ")", "->", "read", "(", "4", ")", ")", ")", ";", "$", "date", "=", "new", "Dat...
Read a DateTime from the current binary stream. @return \DateTime A DateTime object. @throws \qtism\common\storage\BinaryStreamAccessException
[ "Read", "a", "DateTime", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/storage/BinaryStreamAccess.php#L282-L292
oat-sa/qti-sdk
src/qtism/common/storage/BinaryStreamAccess.php
BinaryStreamAccess.writeDateTime
public function writeDateTime(DateTime $dateTime) { try { $timeStamp = $dateTime->getTimestamp(); $this->getStream()->write(pack('l', $timeStamp)); } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessException::DATETIME, false); ...
php
public function writeDateTime(DateTime $dateTime) { try { $timeStamp = $dateTime->getTimestamp(); $this->getStream()->write(pack('l', $timeStamp)); } catch (StreamException $e) { $this->handleStreamException($e, BinaryStreamAccessException::DATETIME, false); ...
[ "public", "function", "writeDateTime", "(", "DateTime", "$", "dateTime", ")", "{", "try", "{", "$", "timeStamp", "=", "$", "dateTime", "->", "getTimestamp", "(", ")", ";", "$", "this", "->", "getStream", "(", ")", "->", "write", "(", "pack", "(", "'l'"...
Write a DateTime from the current binary stream. @param \DateTime $dateTime A DateTime object. @throws \qtism\common\storage\BinaryStreamAccessException
[ "Write", "a", "DateTime", "from", "the", "current", "binary", "stream", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/storage/BinaryStreamAccess.php#L300-L308
oat-sa/qti-sdk
src/qtism/common/storage/BinaryStreamAccess.php
BinaryStreamAccess.handleStreamException
protected function handleStreamException(StreamException $e, $typeError, $read = true) { $strType = 'unknown datatype'; switch ($typeError) { case BinaryStreamAccessException::BOOLEAN: $strType = 'boolean'; break; case BinaryStreamAccessException...
php
protected function handleStreamException(StreamException $e, $typeError, $read = true) { $strType = 'unknown datatype'; switch ($typeError) { case BinaryStreamAccessException::BOOLEAN: $strType = 'boolean'; break; case BinaryStreamAccessException...
[ "protected", "function", "handleStreamException", "(", "StreamException", "$", "e", ",", "$", "typeError", ",", "$", "read", "=", "true", ")", "{", "$", "strType", "=", "'unknown datatype'", ";", "switch", "(", "$", "typeError", ")", "{", "case", "BinaryStre...
Handle a StreamException in order to throw the relevant BinaryStreamAccessException. @param \qtism\common\storage\StreamException $e The StreamException object to deal with. @param integer $typeError The BinaryStreamAccess exception code to be thrown in case of error. @param boolean $read Wheter or not the error occur...
[ "Handle", "a", "StreamException", "in", "order", "to", "throw", "the", "relevant", "BinaryStreamAccessException", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/common/storage/BinaryStreamAccess.php#L318-L375
oat-sa/qti-sdk
src/qtism/data/QtiComponent.php
QtiComponent.getComponentByIdentifier
public function getComponentByIdentifier($identifier, $recursive = true) { if (gettype($identifier) !== 'string') { $msg = "The QtiComponent::getComponentByIdentifier method only accepts a string as its "; $msg.= "argument. '" . gettype($identifier) . "' given."; throw ne...
php
public function getComponentByIdentifier($identifier, $recursive = true) { if (gettype($identifier) !== 'string') { $msg = "The QtiComponent::getComponentByIdentifier method only accepts a string as its "; $msg.= "argument. '" . gettype($identifier) . "' given."; throw ne...
[ "public", "function", "getComponentByIdentifier", "(", "$", "identifier", ",", "$", "recursive", "=", "true", ")", "{", "if", "(", "gettype", "(", "$", "identifier", ")", "!==", "'string'", ")", "{", "$", "msg", "=", "\"The QtiComponent::getComponentByIdentifier...
Get a QtiComponent object which is contained by this one on the basis of a given $identifier. @param string $identifier The identifier to search for. @param boolean $recursive Whether to search recursively in contained QtiComponent objects. @return \qtism\data\QtiComponent|null A QtiComponent object or null if not fou...
[ "Get", "a", "QtiComponent", "object", "which", "is", "contained", "by", "this", "one", "on", "the", "basis", "of", "a", "given", "$identifier", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/QtiComponent.php#L70-L87
oat-sa/qti-sdk
src/qtism/data/QtiComponent.php
QtiComponent.getComponentsByClassName
public function getComponentsByClassName($classNames, $recursive = true) { if (gettype($classNames) !== 'string' && !is_array($classNames)) { $msg = "The QtiComponent::getComponentsByClassName method only accepts "; $msg.= "a string or an array as its main argument, '" . gettype($cla...
php
public function getComponentsByClassName($classNames, $recursive = true) { if (gettype($classNames) !== 'string' && !is_array($classNames)) { $msg = "The QtiComponent::getComponentsByClassName method only accepts "; $msg.= "a string or an array as its main argument, '" . gettype($cla...
[ "public", "function", "getComponentsByClassName", "(", "$", "classNames", ",", "$", "recursive", "=", "true", ")", "{", "if", "(", "gettype", "(", "$", "classNames", ")", "!==", "'string'", "&&", "!", "is_array", "(", "$", "classNames", ")", ")", "{", "$...
Get QtiComponents object which is contained by this one the basis of a given QTI className. If nothing found, an empty QtiComponentCollection object is returned. Example where we look for all assessmentSection class instances contained in an assessmentTest. <code> $search = $assessmentTest->getComponentByClassName('as...
[ "Get", "QtiComponents", "object", "which", "is", "contained", "by", "this", "one", "the", "basis", "of", "a", "given", "QTI", "className", ".", "If", "nothing", "found", "an", "empty", "QtiComponentCollection", "object", "is", "returned", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/QtiComponent.php#L106-L128
oat-sa/qti-sdk
src/qtism/data/QtiComponent.php
QtiComponent.getIdentifiableComponents
public function getIdentifiableComponents($recursive = true) { $iterator = ($recursive === true) ? $this->getIterator() : $this->getComponents(); $foundComponents = array(); $identifiers = array(); $collision = false; foreach ($iterator as $component) { if ($comp...
php
public function getIdentifiableComponents($recursive = true) { $iterator = ($recursive === true) ? $this->getIterator() : $this->getComponents(); $foundComponents = array(); $identifiers = array(); $collision = false; foreach ($iterator as $component) { if ($comp...
[ "public", "function", "getIdentifiableComponents", "(", "$", "recursive", "=", "true", ")", "{", "$", "iterator", "=", "(", "$", "recursive", "===", "true", ")", "?", "$", "this", "->", "getIterator", "(", ")", ":", "$", "this", "->", "getComponents", "(...
Get the QtiIdentifiableComponent object contained by this QtiComponent. Be carefull, the type of the returned collection depends on the values collected: * If all the objects found have a unique identifier within the retrieved set, a QtiIdentifiableCollection is returned. * If an identifier collision occurs within the...
[ "Get", "the", "QtiIdentifiableComponent", "object", "contained", "by", "this", "QtiComponent", ".", "Be", "carefull", "the", "type", "of", "the", "returned", "collection", "depends", "on", "the", "values", "collected", ":" ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/QtiComponent.php#L140-L161
oat-sa/qti-sdk
src/qtism/data/QtiComponent.php
QtiComponent.containsComponentWithClassName
public function containsComponentWithClassName($classNames, $recursive = true) { if (is_array($classNames) === false) { $classNames = array($classNames); } $iterator = ($recursive === true) ? $this->getIterator($classNames) : $this->getComponents(); foreach ($iterato...
php
public function containsComponentWithClassName($classNames, $recursive = true) { if (is_array($classNames) === false) { $classNames = array($classNames); } $iterator = ($recursive === true) ? $this->getIterator($classNames) : $this->getComponents(); foreach ($iterato...
[ "public", "function", "containsComponentWithClassName", "(", "$", "classNames", ",", "$", "recursive", "=", "true", ")", "{", "if", "(", "is_array", "(", "$", "classNames", ")", "===", "false", ")", "{", "$", "classNames", "=", "array", "(", "$", "classNam...
Whether the component contains child components with class $classNames. @param string|array $classNames @param boolean $recursive Whether to search recursively in contained QtiComponent objects. @return boolean
[ "Whether", "the", "component", "contains", "child", "components", "with", "class", "$classNames", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/QtiComponent.php#L170-L183
oat-sa/qti-sdk
src/qtism/runtime/expressions/operators/IntegerDivideProcessor.php
IntegerDivideProcessor.process
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->exclusivelySingle() === false) { $msg = "The IntegerDivide operator only accepts operands with single cardinality."; ...
php
public function process() { $operands = $this->getOperands(); if ($operands->containsNull() === true) { return null; } if ($operands->exclusivelySingle() === false) { $msg = "The IntegerDivide operator only accepts operands with single cardinality."; ...
[ "public", "function", "process", "(", ")", "{", "$", "operands", "=", "$", "this", "->", "getOperands", "(", ")", ";", "if", "(", "$", "operands", "->", "containsNull", "(", ")", "===", "true", ")", "{", "return", "null", ";", "}", "if", "(", "$", ...
Process the IntegerDivide operator. @return integer|null An integer value that corresponds to the first expression divided by the second rounded down to the greatest integer i such that i <= x / y. If the second expression is 0 or if either of the sub-expressions is NULL, the result is NULL.
[ "Process", "the", "IntegerDivide", "operator", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/runtime/expressions/operators/IntegerDivideProcessor.php#L51-L78
oat-sa/qti-sdk
src/qtism/data/content/interactions/SliderInteraction.php
SliderInteraction.setLowerBound
public function setLowerBound($lowerBound) { if (is_float($lowerBound) === true) { $this->lowerBound = $lowerBound; } else { $msg = "The 'lowerBound' argument must be a float value, '" . gettype($lowerBound) . "' given."; throw new InvalidArgumentException($msg); ...
php
public function setLowerBound($lowerBound) { if (is_float($lowerBound) === true) { $this->lowerBound = $lowerBound; } else { $msg = "The 'lowerBound' argument must be a float value, '" . gettype($lowerBound) . "' given."; throw new InvalidArgumentException($msg); ...
[ "public", "function", "setLowerBound", "(", "$", "lowerBound", ")", "{", "if", "(", "is_float", "(", "$", "lowerBound", ")", "===", "true", ")", "{", "$", "this", "->", "lowerBound", "=", "$", "lowerBound", ";", "}", "else", "{", "$", "msg", "=", "\"...
Get the value of the lowerBound attribute. @param float $lowerBound A float value. @throws \InvalidArgumentException If $lowerBound is not a float value.
[ "Get", "the", "value", "of", "the", "lowerBound", "attribute", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/interactions/SliderInteraction.php#L163-L171
oat-sa/qti-sdk
src/qtism/data/content/interactions/SliderInteraction.php
SliderInteraction.setUpperBound
public function setUpperBound($upperBound) { if (is_float($upperBound) === true) { $this->upperBound = $upperBound; } else { $msg = "The 'upperBound' argument must be a float value, '" . gettype($upperBound) . "' given."; throw new InvalidArgumentException($msg); ...
php
public function setUpperBound($upperBound) { if (is_float($upperBound) === true) { $this->upperBound = $upperBound; } else { $msg = "The 'upperBound' argument must be a float value, '" . gettype($upperBound) . "' given."; throw new InvalidArgumentException($msg); ...
[ "public", "function", "setUpperBound", "(", "$", "upperBound", ")", "{", "if", "(", "is_float", "(", "$", "upperBound", ")", "===", "true", ")", "{", "$", "this", "->", "upperBound", "=", "$", "upperBound", ";", "}", "else", "{", "$", "msg", "=", "\"...
Set the value of the upperBound attribute. @param float $upperBound A float value. @throws \InvalidArgumentException If $upperBound is not a float value.
[ "Set", "the", "value", "of", "the", "upperBound", "attribute", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/interactions/SliderInteraction.php#L189-L197
oat-sa/qti-sdk
src/qtism/data/content/interactions/SliderInteraction.php
SliderInteraction.setStepLabel
public function setStepLabel($stepLabel) { if (is_bool($stepLabel) === true) { $this->stepLabel = $stepLabel; } else { $msg = "The 'stepLabel' argument must be a boolean value, '" . gettype($stepLabel) . "' given."; throw new InvalidArgumentException($msg); ...
php
public function setStepLabel($stepLabel) { if (is_bool($stepLabel) === true) { $this->stepLabel = $stepLabel; } else { $msg = "The 'stepLabel' argument must be a boolean value, '" . gettype($stepLabel) . "' given."; throw new InvalidArgumentException($msg); ...
[ "public", "function", "setStepLabel", "(", "$", "stepLabel", ")", "{", "if", "(", "is_bool", "(", "$", "stepLabel", ")", "===", "true", ")", "{", "$", "this", "->", "stepLabel", "=", "$", "stepLabel", ";", "}", "else", "{", "$", "msg", "=", "\"The 's...
Set whether or not each step on the slider has to be labelled. @param boolean $stepLabel @throws \InvalidArgumentException If $stepLabel is not a boolean value.
[ "Set", "whether", "or", "not", "each", "step", "on", "the", "slider", "has", "to", "be", "labelled", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/interactions/SliderInteraction.php#L252-L260
oat-sa/qti-sdk
src/qtism/data/content/interactions/SliderInteraction.php
SliderInteraction.setOrientation
public function setOrientation($orientation) { if (in_array($orientation, Orientation::asArray(), true) === true) { $this->orientation = $orientation; } else { $msg = "The 'orientation' argument must be a value from the Orientation enumeration."; throw new Invalid...
php
public function setOrientation($orientation) { if (in_array($orientation, Orientation::asArray(), true) === true) { $this->orientation = $orientation; } else { $msg = "The 'orientation' argument must be a value from the Orientation enumeration."; throw new Invalid...
[ "public", "function", "setOrientation", "(", "$", "orientation", ")", "{", "if", "(", "in_array", "(", "$", "orientation", ",", "Orientation", "::", "asArray", "(", ")", ",", "true", ")", "===", "true", ")", "{", "$", "this", "->", "orientation", "=", ...
Set the orientation of the slider (horizontal or vertical). @param integer $orientation A value from the Orientation enumeration. @throws \InvalidArgumentException If $orientation is not a value from the Orientation enumeration.
[ "Set", "the", "orientation", "of", "the", "slider", "(", "horizontal", "or", "vertical", ")", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/interactions/SliderInteraction.php#L278-L286
oat-sa/qti-sdk
src/qtism/data/content/interactions/SliderInteraction.php
SliderInteraction.setReverse
public function setReverse($reverse) { if (is_bool($reverse) === true) { $this->reverse = $reverse; } else { $msg = "The 'reverse' argument must be a boolean value, '" . gettype($reverse) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setReverse($reverse) { if (is_bool($reverse) === true) { $this->reverse = $reverse; } else { $msg = "The 'reverse' argument must be a boolean value, '" . gettype($reverse) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setReverse", "(", "$", "reverse", ")", "{", "if", "(", "is_bool", "(", "$", "reverse", ")", "===", "true", ")", "{", "$", "this", "->", "reverse", "=", "$", "reverse", ";", "}", "else", "{", "$", "msg", "=", "\"The 'reverse' ar...
Set whether or not the upper and lower bounds are reversed. @param boolean $reverse @throws \InvalidArgumentException If $reverse is not a boolean value.
[ "Set", "whether", "or", "not", "the", "upper", "and", "lower", "bounds", "are", "reversed", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/interactions/SliderInteraction.php#L304-L312
oat-sa/qti-sdk
src/qtism/data/content/Stylesheet.php
Stylesheet.setType
public function setType($type) { if (gettype($type) === 'string') { $this->type = $type; } else { $msg = "Type must be a string, '" . gettype($type) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setType($type) { if (gettype($type) === 'string') { $this->type = $type; } else { $msg = "Type must be a string, '" . gettype($type) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setType", "(", "$", "type", ")", "{", "if", "(", "gettype", "(", "$", "type", ")", "===", "'string'", ")", "{", "$", "this", "->", "type", "=", "$", "type", ";", "}", "else", "{", "$", "msg", "=", "\"Type must be a string, '\""...
Set the mime-type of the stylesheet. @param string $type A mime-type. @throws \InvalidArgumentException If $type is not a string.
[ "Set", "the", "mime", "-", "type", "of", "the", "stylesheet", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/Stylesheet.php#L137-L145
oat-sa/qti-sdk
src/qtism/data/content/Stylesheet.php
Stylesheet.setMedia
public function setMedia($media) { if (is_string($media)) { $this->media = $media; } else { $msg = "Media must be a string, '" . gettype($media) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setMedia($media) { if (is_string($media)) { $this->media = $media; } else { $msg = "Media must be a string, '" . gettype($media) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setMedia", "(", "$", "media", ")", "{", "if", "(", "is_string", "(", "$", "media", ")", ")", "{", "$", "this", "->", "media", "=", "$", "media", ";", "}", "else", "{", "$", "msg", "=", "\"Media must be a string, '\"", ".", "get...
Set the media to apply the stylesheet on. @param string $media A media. @throws \InvalidArgumentException If $media is not a string.
[ "Set", "the", "media", "to", "apply", "the", "stylesheet", "on", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/Stylesheet.php#L163-L171
oat-sa/qti-sdk
src/qtism/data/QtiIdentifiableCollection.php
QtiIdentifiableCollection.offsetExists
public function offsetExists($offset) { if (gettype($offset) !== 'string' && empty($offset) === false) { $msg = "The requested offset must be a string."; throw new OutOfRangeException($msg); } $data = &$this->getDataPlaceHolder(); return isset($data[$offset]...
php
public function offsetExists($offset) { if (gettype($offset) !== 'string' && empty($offset) === false) { $msg = "The requested offset must be a string."; throw new OutOfRangeException($msg); } $data = &$this->getDataPlaceHolder(); return isset($data[$offset]...
[ "public", "function", "offsetExists", "(", "$", "offset", ")", "{", "if", "(", "gettype", "(", "$", "offset", ")", "!==", "'string'", "&&", "empty", "(", "$", "offset", ")", "===", "false", ")", "{", "$", "msg", "=", "\"The requested offset must be a strin...
Whether a QtiIdentifiable object with 'identifier' = $offset is in the collection. @return boolean @throws \OutOfRangeException If the request $offset is not a string or is empty.
[ "Whether", "a", "QtiIdentifiable", "object", "with", "identifier", "=", "$offset", "is", "in", "the", "collection", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/QtiIdentifiableCollection.php#L69-L79
oat-sa/qti-sdk
src/qtism/data/QtiIdentifiableCollection.php
QtiIdentifiableCollection.offsetGet
public function offsetGet($offset) { if (gettype($offset) !== 'string') { $msg = "The requested offset must be a non-empty string."; throw new OutOfRangeException($msg); } $returnValue = null; $data = &$this->getDataPlaceHolder(); if (isset($data[$of...
php
public function offsetGet($offset) { if (gettype($offset) !== 'string') { $msg = "The requested offset must be a non-empty string."; throw new OutOfRangeException($msg); } $returnValue = null; $data = &$this->getDataPlaceHolder(); if (isset($data[$of...
[ "public", "function", "offsetGet", "(", "$", "offset", ")", "{", "if", "(", "gettype", "(", "$", "offset", ")", "!==", "'string'", ")", "{", "$", "msg", "=", "\"The requested offset must be a non-empty string.\"", ";", "throw", "new", "OutOfRangeException", "(",...
Retrieve a QtiIdentifiable object from the collection. @return \qtism\data\QtiIdentifiable|null The requested QtiIdentifiable object or null if no object with 'identifier' = $offset is found. @throws \OutOfRangeException If the request $offset is not a string or is empty.
[ "Retrieve", "a", "QtiIdentifiable", "object", "from", "the", "collection", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/QtiIdentifiableCollection.php#L87-L102
oat-sa/qti-sdk
src/qtism/data/QtiIdentifiableCollection.php
QtiIdentifiableCollection.offsetSet
public function offsetSet($offset, $value) { $this->checkType($value); if ($offset !== null) { $msg = "No specific offset can be set in a QtiIdentifiableCollection. "; $msg.= "The offset is always infered from the 'identifier' attribute of "; $msg.= "the given Qt...
php
public function offsetSet($offset, $value) { $this->checkType($value); if ($offset !== null) { $msg = "No specific offset can be set in a QtiIdentifiableCollection. "; $msg.= "The offset is always infered from the 'identifier' attribute of "; $msg.= "the given Qt...
[ "public", "function", "offsetSet", "(", "$", "offset", ",", "$", "value", ")", "{", "$", "this", "->", "checkType", "(", "$", "value", ")", ";", "if", "(", "$", "offset", "!==", "null", ")", "{", "$", "msg", "=", "\"No specific offset can be set in a Qti...
Put a QtiIdentifiable object into the collection. No specific offset must be set because the key associated to $value is always its 'identifier' attribute's value. @param null $offset @param \qtism\data\QtiIdentifiable $value A QtiIdentifiable object. @throws \InvalidArgumentException If $value is not a QtiIdentifiabl...
[ "Put", "a", "QtiIdentifiable", "object", "into", "the", "collection", ".", "No", "specific", "offset", "must", "be", "set", "because", "the", "key", "associated", "to", "$value", "is", "always", "its", "identifier", "attribute", "s", "value", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/QtiIdentifiableCollection.php#L114-L130
oat-sa/qti-sdk
src/qtism/data/QtiIdentifiableCollection.php
QtiIdentifiableCollection.offsetUnset
public function offsetUnset($offset) { if (gettype($offset) === 'string') { $data = &$this->getDataPlaceHolder(); if (isset($data[$offset])) { $data[$offset]->detach($this); unset($data[$offset]); } } else { $msg = "The ...
php
public function offsetUnset($offset) { if (gettype($offset) === 'string') { $data = &$this->getDataPlaceHolder(); if (isset($data[$offset])) { $data[$offset]->detach($this); unset($data[$offset]); } } else { $msg = "The ...
[ "public", "function", "offsetUnset", "(", "$", "offset", ")", "{", "if", "(", "gettype", "(", "$", "offset", ")", "===", "'string'", ")", "{", "$", "data", "=", "&", "$", "this", "->", "getDataPlaceHolder", "(", ")", ";", "if", "(", "isset", "(", "...
Remove a QTIIdentifiable object from the collection that has its 'identifier' attribute equals to $offset. @throws \OutOfRangeException If $offset is not a string.
[ "Remove", "a", "QTIIdentifiable", "object", "from", "the", "collection", "that", "has", "its", "identifier", "attribute", "equals", "to", "$offset", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/QtiIdentifiableCollection.php#L152-L164
oat-sa/qti-sdk
src/qtism/data/QtiIdentifiableCollection.php
QtiIdentifiableCollection.replace
public function replace($object, $replacement) { $this->checkType($object); $this->checkType($replacement); if (($search = array_search($object, $this->dataPlaceHolder, true)) !== false) { $objectKey = $search; $replacementKey = $replacement->getIdentifi...
php
public function replace($object, $replacement) { $this->checkType($object); $this->checkType($replacement); if (($search = array_search($object, $this->dataPlaceHolder, true)) !== false) { $objectKey = $search; $replacementKey = $replacement->getIdentifi...
[ "public", "function", "replace", "(", "$", "object", ",", "$", "replacement", ")", "{", "$", "this", "->", "checkType", "(", "$", "object", ")", ";", "$", "this", "->", "checkType", "(", "$", "replacement", ")", ";", "if", "(", "(", "$", "search", ...
Replace an $object in the collection by another $replacement $object. @param mixed $object An object to be replaced. @param mixed $replacement An object to be used as a replacement. @throws \InvalidArgumentException If $object or $replacement are not compliant with the current collection typing. @throws \UnexpectedVal...
[ "Replace", "an", "$object", "in", "the", "collection", "by", "another", "$replacement", "$object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/QtiIdentifiableCollection.php#L174-L208
oat-sa/qti-sdk
src/qtism/runtime/rendering/qtipl/expressions/operators/StatsOperatorQtiPLRenderer.php
StatsOperatorQtiPLRenderer.render
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); $attributes = []; $attributes['name'] = "\"" . Statistics::getNameByConstant($something->getName()) . "\""; return $something->getQtiClassName() . $renderer->writeAttributes($attributes) ...
php
public function render($something) { $renderer = new QtiPLRenderer($this->getCRO()); $attributes = []; $attributes['name'] = "\"" . Statistics::getNameByConstant($something->getName()) . "\""; return $something->getQtiClassName() . $renderer->writeAttributes($attributes) ...
[ "public", "function", "render", "(", "$", "something", ")", "{", "$", "renderer", "=", "new", "QtiPLRenderer", "(", "$", "this", "->", "getCRO", "(", ")", ")", ";", "$", "attributes", "=", "[", "]", ";", "$", "attributes", "[", "'name'", "]", "=", ...
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/StatsOperatorQtiPLRenderer.php#L47-L55
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/SetTemplateValueMarshaller.php
SetTemplateValueMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { if (($identifier = $this->getDOMElementAttributeAs($element, 'identifier')) !== null) { $expressionElt = self::getFirstChildElement($element); if ($expressionElt !== false) { $marshaller = $this->getMarshallerFacto...
php
protected function unmarshall(DOMElement $element) { if (($identifier = $this->getDOMElementAttributeAs($element, 'identifier')) !== null) { $expressionElt = self::getFirstChildElement($element); if ($expressionElt !== false) { $marshaller = $this->getMarshallerFacto...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "if", "(", "(", "$", "identifier", "=", "$", "this", "->", "getDOMElementAttributeAs", "(", "$", "element", ",", "'identifier'", ")", ")", "!==", "null", ")", "{", "$", "...
Unmarshall a DOMElement object corresponding to a QTI setTemplateValue element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent A SetTemplateValue object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "setTemplateValue", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/SetTemplateValueMarshaller.php#L61-L79
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/AssessmentSectionRefMarshaller.php
AssessmentSectionRefMarshaller.marshall
protected function marshall(QtiComponent $component) { $element = parent::marshall($component); $this->setDOMElementAttribute($element, 'href', $component->getHref()); return $element; }
php
protected function marshall(QtiComponent $component) { $element = parent::marshall($component); $this->setDOMElementAttribute($element, 'href', $component->getHref()); return $element; }
[ "protected", "function", "marshall", "(", "QtiComponent", "$", "component", ")", "{", "$", "element", "=", "parent", "::", "marshall", "(", "$", "component", ")", ";", "$", "this", "->", "setDOMElementAttribute", "(", "$", "element", ",", "'href'", ",", "$...
Marshall an AssessmentSectionRef object into a DOMElement object. @param \qtism\data\QtiComponent $component An AssessmentSectionRef object. @return \DOMElement The according DOMElement object.
[ "Marshall", "an", "AssessmentSectionRef", "object", "into", "a", "DOMElement", "object", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/AssessmentSectionRefMarshaller.php#L43-L50
oat-sa/qti-sdk
src/qtism/data/storage/xml/marshalling/AssessmentSectionRefMarshaller.php
AssessmentSectionRefMarshaller.unmarshall
protected function unmarshall(DOMElement $element) { $baseComponent = parent::unmarshall($element); if (($href = $this->getDOMElementAttributeAs($element, 'href', 'string')) !== null) { $object = new AssessmentSectionRef($baseComponent->getIdentifier(), $href); $object->setR...
php
protected function unmarshall(DOMElement $element) { $baseComponent = parent::unmarshall($element); if (($href = $this->getDOMElementAttributeAs($element, 'href', 'string')) !== null) { $object = new AssessmentSectionRef($baseComponent->getIdentifier(), $href); $object->setR...
[ "protected", "function", "unmarshall", "(", "DOMElement", "$", "element", ")", "{", "$", "baseComponent", "=", "parent", "::", "unmarshall", "(", "$", "element", ")", ";", "if", "(", "(", "$", "href", "=", "$", "this", "->", "getDOMElementAttributeAs", "("...
Unmarshall a DOMElement object corresponding to a QTI assessmentSectionRef element. @param \DOMElement $element A DOMElement object. @return \qtism\data\QtiComponent An AssessmentSectionRef object. @throws \qtism\data\storage\xml\marshalling\UnmarshallingException If the mandatory attribute 'href' is missing.
[ "Unmarshall", "a", "DOMElement", "object", "corresponding", "to", "a", "QTI", "assessmentSectionRef", "element", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/storage/xml/marshalling/AssessmentSectionRefMarshaller.php#L59-L77
oat-sa/qti-sdk
src/qtism/data/content/xhtml/tables/Table.php
Table.setSummary
public function setSummary($summary) { if (is_string($summary) === true) { $this->summary = $summary; } else { $msg = "The 'summary' argument must be a string, '" . gettype($summary) . "' given."; throw new InvalidArgumentException($msg); } }
php
public function setSummary($summary) { if (is_string($summary) === true) { $this->summary = $summary; } else { $msg = "The 'summary' argument must be a string, '" . gettype($summary) . "' given."; throw new InvalidArgumentException($msg); } }
[ "public", "function", "setSummary", "(", "$", "summary", ")", "{", "if", "(", "is_string", "(", "$", "summary", ")", "===", "true", ")", "{", "$", "this", "->", "summary", "=", "$", "summary", ";", "}", "else", "{", "$", "msg", "=", "\"The 'summary' ...
Set the value of the summary attribute. An empty string means there is no summary. @param string $summary @throws \InvalidArgumentException If $summary is not a string.
[ "Set", "the", "value", "of", "the", "summary", "attribute", ".", "An", "empty", "string", "means", "there", "is", "no", "summary", "." ]
train
https://github.com/oat-sa/qti-sdk/blob/fc3568d2a293ae6dbfe9f400dad2b94a0033ddb2/src/qtism/data/content/xhtml/tables/Table.php#L126-L134