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/extension-tao-itemqti | model/portableElement/storage/PortableElementRegistry.php | PortableElementRegistry.getBaseUrl | public function getBaseUrl(PortableElementObject $object)
{
$object = $this->fetch($object->getTypeIdentifier(), $object->getVersion());
return $this->getFileSystem()->getFileUrl($object);
} | php | public function getBaseUrl(PortableElementObject $object)
{
$object = $this->fetch($object->getTypeIdentifier(), $object->getVersion());
return $this->getFileSystem()->getFileUrl($object);
} | [
"public",
"function",
"getBaseUrl",
"(",
"PortableElementObject",
"$",
"object",
")",
"{",
"$",
"object",
"=",
"$",
"this",
"->",
"fetch",
"(",
"$",
"object",
"->",
"getTypeIdentifier",
"(",
")",
",",
"$",
"object",
"->",
"getVersion",
"(",
")",
")",
";"... | Return the absolute url of PCI storage
@param PortableElementObject $object
@return string
@throws PortableElementNotFoundException | [
"Return",
"the",
"absolute",
"url",
"of",
"PCI",
"storage"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/portableElement/storage/PortableElementRegistry.php#L553-L557 |
oat-sa/extension-tao-itemqti | model/Export/Extractor/MetaDataOntologyExtractor.php | MetaDataOntologyExtractor.setMetaDataProperties | protected function setMetaDataProperties(array $config)
{
if (empty($this->metaDataProperties)) {
$itemTypes = $this->item->getTypes();
$classType = reset($itemTypes);
if (!$classType->isClass()) {
throw new ExtractorException('Item class type do not exis... | php | protected function setMetaDataProperties(array $config)
{
if (empty($this->metaDataProperties)) {
$itemTypes = $this->item->getTypes();
$classType = reset($itemTypes);
if (!$classType->isClass()) {
throw new ExtractorException('Item class type do not exis... | [
"protected",
"function",
"setMetaDataProperties",
"(",
"array",
"$",
"config",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"metaDataProperties",
")",
")",
"{",
"$",
"itemTypes",
"=",
"$",
"this",
"->",
"item",
"->",
"getTypes",
"(",
")",
";",
... | Setting the meta data properties available for export.
@param array $config
@throws ExtractorException | [
"Setting",
"the",
"meta",
"data",
"properties",
"available",
"for",
"export",
"."
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/Export/Extractor/MetaDataOntologyExtractor.php#L145-L157 |
oat-sa/extension-tao-itemqti | model/Export/Extractor/MetaDataOntologyExtractor.php | MetaDataOntologyExtractor.getAvailableMetaDataProperties | protected function getAvailableMetaDataProperties($classToExport, array $excludedProperties)
{
$props = tao_helpers_form_GenerisFormFactory::getClassProperties($classToExport);
return array_filter($props, function ($prop) use ($excludedProperties) {
/**@var $prop core_kernel_classes_Res... | php | protected function getAvailableMetaDataProperties($classToExport, array $excludedProperties)
{
$props = tao_helpers_form_GenerisFormFactory::getClassProperties($classToExport);
return array_filter($props, function ($prop) use ($excludedProperties) {
/**@var $prop core_kernel_classes_Res... | [
"protected",
"function",
"getAvailableMetaDataProperties",
"(",
"$",
"classToExport",
",",
"array",
"$",
"excludedProperties",
")",
"{",
"$",
"props",
"=",
"tao_helpers_form_GenerisFormFactory",
"::",
"getClassProperties",
"(",
"$",
"classToExport",
")",
";",
"return",
... | @param core_kernel_classes_Class $classToExport
@param array $excludedProperties
@return array | [
"@param",
"core_kernel_classes_Class",
"$classToExport"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/Export/Extractor/MetaDataOntologyExtractor.php#L165-L173 |
oat-sa/extension-tao-itemqti | model/qti/metadata/importer/MetadataImporter.php | MetadataImporter.inject | public function inject($identifier, $resource)
{
if (! $resource instanceof \core_kernel_classes_Resource) {
throw new MetadataImportException(__('Metadata import requires an instance of core_kernel_classes_Resource to inject metadata'));
}
parent::inject($identifier, $resource);... | php | public function inject($identifier, $resource)
{
if (! $resource instanceof \core_kernel_classes_Resource) {
throw new MetadataImportException(__('Metadata import requires an instance of core_kernel_classes_Resource to inject metadata'));
}
parent::inject($identifier, $resource);... | [
"public",
"function",
"inject",
"(",
"$",
"identifier",
",",
"$",
"resource",
")",
"{",
"if",
"(",
"!",
"$",
"resource",
"instanceof",
"\\",
"core_kernel_classes_Resource",
")",
"{",
"throw",
"new",
"MetadataImportException",
"(",
"__",
"(",
"'Metadata import re... | Inject an identified metadata value to a resource
{@inheritdoc} | [
"Inject",
"an",
"identified",
"metadata",
"value",
"to",
"a",
"resource"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/metadata/importer/MetadataImporter.php#L67-L73 |
oat-sa/extension-tao-itemqti | model/qti/metadata/importer/MetadataImporter.php | MetadataImporter.guard | public function guard($identifier, $context = '')
{
foreach ($this->getGuardians() as $guardian) {
if ($guardian instanceof ContextualMetadataGuardian && $guardian->getContext() !== $context) {
continue;
}
if ($this->hasMetadataVa... | php | public function guard($identifier, $context = '')
{
foreach ($this->getGuardians() as $guardian) {
if ($guardian instanceof ContextualMetadataGuardian && $guardian->getContext() !== $context) {
continue;
}
if ($this->hasMetadataVa... | [
"public",
"function",
"guard",
"(",
"$",
"identifier",
",",
"$",
"context",
"=",
"''",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getGuardians",
"(",
")",
"as",
"$",
"guardian",
")",
"{",
"if",
"(",
"$",
"guardian",
"instanceof",
"ContextualMetadataGu... | Guard a metadata identifier at import
Guard a metadata identifier by calling guard method of each guardians
If guardians have no reason to stop process, true is returned
If a guardian does not allow the import, the target guardian is returned
@param $identifier
@return bool | [
"Guard",
"a",
"metadata",
"identifier",
"at",
"import"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/metadata/importer/MetadataImporter.php#L85-L101 |
oat-sa/extension-tao-itemqti | model/qti/metadata/importer/MetadataImporter.php | MetadataImporter.classLookUp | public function classLookUp($identifier, &$createdClasses)
{
$targetClass = false;
foreach ($this->getClassLookUp() as $classLookup) {
if ($this->hasMetadataValue($identifier)) {
\common_Logger::i(__('Target Class Lookup for resource "%s"...', $identifier));
... | php | public function classLookUp($identifier, &$createdClasses)
{
$targetClass = false;
foreach ($this->getClassLookUp() as $classLookup) {
if ($this->hasMetadataValue($identifier)) {
\common_Logger::i(__('Target Class Lookup for resource "%s"...', $identifier));
... | [
"public",
"function",
"classLookUp",
"(",
"$",
"identifier",
",",
"&",
"$",
"createdClasses",
")",
"{",
"$",
"targetClass",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"getClassLookUp",
"(",
")",
"as",
"$",
"classLookup",
")",
"{",
"if",
"(",
... | Lookup classes for a metadata identifier at import
Lookup classes for a metadata identifier by calling lookup method of each classLookup
If no lookup has been triggered, false is returned
If a lookup has been triggered, classLookup could apply his own process
Specific should be applied here, like get created classes
C... | [
"Lookup",
"classes",
"for",
"a",
"metadata",
"identifier",
"at",
"import"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/metadata/importer/MetadataImporter.php#L116-L135 |
oat-sa/extension-tao-itemqti | model/qti/metadata/importer/MetadataImporter.php | MetadataImporter.register | public function register($key, $name)
{
if (empty($key) || empty($name)) {
throw new \InvalidArgumentException(__('Register method expects $key and $name parameters.'));
}
if (is_object($name)) {
$name = get_class($name);
}
switch ($key) {
... | php | public function register($key, $name)
{
if (empty($key) || empty($name)) {
throw new \InvalidArgumentException(__('Register method expects $key and $name parameters.'));
}
if (is_object($name)) {
$name = get_class($name);
}
switch ($key) {
... | [
"public",
"function",
"register",
"(",
"$",
"key",
",",
"$",
"name",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"key",
")",
"||",
"empty",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"__",
"(",
"'Register meth... | Register an importer instance
Register an instance e.q. Injectors, Extractors, Guardians or LooUpClass
Respective interface is checked
Throw exception if call if not correctly formed
@param $key
@param $name
@return bool
@throws \InvalidArgumentException | [
"Register",
"an",
"importer",
"instance"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/metadata/importer/MetadataImporter.php#L167-L192 |
oat-sa/extension-tao-itemqti | model/qti/metadata/importer/MetadataImporter.php | MetadataImporter.unregister | public function unregister($key, $name)
{
if (empty($key) || empty($name)) {
throw new \common_Exception(__('Unregister method expects $key and $name parameters.'));
}
if (is_object($name)) {
$name = get_class($name);
}
switch ($key) {
ca... | php | public function unregister($key, $name)
{
if (empty($key) || empty($name)) {
throw new \common_Exception(__('Unregister method expects $key and $name parameters.'));
}
if (is_object($name)) {
$name = get_class($name);
}
switch ($key) {
ca... | [
"public",
"function",
"unregister",
"(",
"$",
"key",
",",
"$",
"name",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"key",
")",
"||",
"empty",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"\\",
"common_Exception",
"(",
"__",
"(",
"'Unregister method e... | Unregister an instances
Look for GUARDIAN OR CLASS_LOOKUP key, otherwise fallback to parent
@param string $key
@param string $name
@return bool
@throws \common_Exception | [
"Unregister",
"an",
"instances"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/metadata/importer/MetadataImporter.php#L204-L225 |
oat-sa/extension-tao-itemqti | model/qti/metadata/importer/MetadataImporter.php | MetadataImporter.registerMetadataService | protected function registerMetadataService()
{
if ($this->getServiceLocator()->has(MetadataService::SERVICE_ID)) {
$metadataService = $this->getServiceLocator()->get(MetadataService::SERVICE_ID);
} else {
$metadataService = $this->getServiceManager()->build(MetadataService::c... | php | protected function registerMetadataService()
{
if ($this->getServiceLocator()->has(MetadataService::SERVICE_ID)) {
$metadataService = $this->getServiceLocator()->get(MetadataService::SERVICE_ID);
} else {
$metadataService = $this->getServiceManager()->build(MetadataService::c... | [
"protected",
"function",
"registerMetadataService",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"has",
"(",
"MetadataService",
"::",
"SERVICE_ID",
")",
")",
"{",
"$",
"metadataService",
"=",
"$",
"this",
"->",
"getServic... | Allow to register, into the config, the current importer service | [
"Allow",
"to",
"register",
"into",
"the",
"config",
"the",
"current",
"importer",
"service"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/metadata/importer/MetadataImporter.php#L230-L239 |
oat-sa/extension-tao-itemqti | model/qti/container/ContainerTable.php | ContainerTable.getValidElementTypes | public function getValidElementTypes(){
return array(
'oat\\taoQtiItem\\model\\qti\\Img',
'oat\\taoQtiItem\\model\\qti\\Math',
'oat\\taoQtiItem\\model\\qti\\feedback\\Feedback',
\oat\taoQtiItem\model\qti\QtiObject::class,
'oat\\taoQtiItem\\model\\qti\\... | php | public function getValidElementTypes(){
return array(
'oat\\taoQtiItem\\model\\qti\\Img',
'oat\\taoQtiItem\\model\\qti\\Math',
'oat\\taoQtiItem\\model\\qti\\feedback\\Feedback',
\oat\taoQtiItem\model\qti\QtiObject::class,
'oat\\taoQtiItem\\model\\qti\\... | [
"public",
"function",
"getValidElementTypes",
"(",
")",
"{",
"return",
"array",
"(",
"'oat\\\\taoQtiItem\\\\model\\\\qti\\\\Img'",
",",
"'oat\\\\taoQtiItem\\\\model\\\\qti\\\\Math'",
",",
"'oat\\\\taoQtiItem\\\\model\\\\qti\\\\feedback\\\\Feedback'",
",",
"\\",
"oat",
"\\",
"taoQ... | return the list of available element classes
@access public
@return array | [
"return",
"the",
"list",
"of",
"available",
"element",
"classes"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/container/ContainerTable.php#L40-L53 |
oat-sa/extension-tao-itemqti | controller/QtiPreview.php | QtiPreview.processResponses | protected function processResponses(core_kernel_classes_Resource $item){
$jsonPayload = taoQtiCommon_helpers_Utils::readJsonPayload();
try {
$qtiXmlFileContent = QtiFile::getQtiFileContent($item);
$qtiXmlDoc = new XmlDocument();
$qtiXmlDoc->loadFromString($qtiXmlFil... | php | protected function processResponses(core_kernel_classes_Resource $item){
$jsonPayload = taoQtiCommon_helpers_Utils::readJsonPayload();
try {
$qtiXmlFileContent = QtiFile::getQtiFileContent($item);
$qtiXmlDoc = new XmlDocument();
$qtiXmlDoc->loadFromString($qtiXmlFil... | [
"protected",
"function",
"processResponses",
"(",
"core_kernel_classes_Resource",
"$",
"item",
")",
"{",
"$",
"jsonPayload",
"=",
"taoQtiCommon_helpers_Utils",
"::",
"readJsonPayload",
"(",
")",
";",
"try",
"{",
"$",
"qtiXmlFileContent",
"=",
"QtiFile",
"::",
"getQt... | Item's ResponseProcessing.
@param core_kernel_classes_Resource $item The Item you want to apply ResponseProcessing.
@throws \RuntimeException If an error occurs while processing responses or transmitting results | [
"Item",
"s",
"ResponseProcessing",
"."
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/controller/QtiPreview.php#L84-L147 |
oat-sa/extension-tao-itemqti | controller/QtiPreview.php | QtiPreview.getRenderedItem | protected function getRenderedItem($item) {
//@todo make getRenderedItem language dependent
$lang = \common_session_SessionManager::getSession()->getDataLanguage();
$qtiItem = Service::singleton()->getDataItemByRdfItem($item, $lang, true);
if ($qtiItem) {
$contentVariableEle... | php | protected function getRenderedItem($item) {
//@todo make getRenderedItem language dependent
$lang = \common_session_SessionManager::getSession()->getDataLanguage();
$qtiItem = Service::singleton()->getDataItemByRdfItem($item, $lang, true);
if ($qtiItem) {
$contentVariableEle... | [
"protected",
"function",
"getRenderedItem",
"(",
"$",
"item",
")",
"{",
"//@todo make getRenderedItem language dependent",
"$",
"lang",
"=",
"\\",
"common_session_SessionManager",
"::",
"getSession",
"(",
")",
"->",
"getDataLanguage",
"(",
")",
";",
"$",
"qtiItem",
... | (non-PHPdoc)
@see taoItems_actions_ItemPreview::getRenderedItem() | [
"(",
"non",
"-",
"PHPdoc",
")"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/controller/QtiPreview.php#L179-L214 |
oat-sa/extension-tao-itemqti | model/qti/ManifestParser.php | ManifestParser.load | public function load()
{
$returnValue = array();
//load it using the SimpleXml library
$xml = false;
switch($this->sourceType){
case self::SOURCE_FILE:
$xml = simplexml_load_file($this->source);
break;
case self::SOURCE_URL:
$xmlContent ... | php | public function load()
{
$returnValue = array();
//load it using the SimpleXml library
$xml = false;
switch($this->sourceType){
case self::SOURCE_FILE:
$xml = simplexml_load_file($this->source);
break;
case self::SOURCE_URL:
$xmlContent ... | [
"public",
"function",
"load",
"(",
")",
"{",
"$",
"returnValue",
"=",
"array",
"(",
")",
";",
"//load it using the SimpleXml library",
"$",
"xml",
"=",
"false",
";",
"switch",
"(",
"$",
"this",
"->",
"sourceType",
")",
"{",
"case",
"self",
"::",
"SOURCE_FI... | Extract the resources informations about the items
and build a list a QTI_Resource
@access public
@return array | [
"Extract",
"the",
"resources",
"informations",
"about",
"the",
"items",
"and",
"build",
"a",
"list",
"a",
"QTI_Resource"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/ManifestParser.php#L104-L142 |
oat-sa/extension-tao-itemqti | model/qti/attribute/Attribute.php | Attribute.getValue | public function getValue($returnObject = false){
$returnValue = null;
if(!is_null($this->value)){
$returnValue = ($returnObject) ? $this->value : $this->value->getValue(); //return mixed
}
return $returnValue;
} | php | public function getValue($returnObject = false){
$returnValue = null;
if(!is_null($this->value)){
$returnValue = ($returnObject) ? $this->value : $this->value->getValue(); //return mixed
}
return $returnValue;
} | [
"public",
"function",
"getValue",
"(",
"$",
"returnObject",
"=",
"false",
")",
"{",
"$",
"returnValue",
"=",
"null",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"value",
")",
")",
"{",
"$",
"returnValue",
"=",
"(",
"$",
"returnObject",
")... | Return the value of the attribute in base type int, string, null
@return mixed | [
"Return",
"the",
"value",
"of",
"the",
"attribute",
"in",
"base",
"type",
"int",
"string",
"null"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/attribute/Attribute.php#L192-L201 |
oat-sa/extension-tao-itemqti | model/qti/attribute/Attribute.php | Attribute.setValue | public function setValue($value){
$returnValue = false;
if(!is_null($value)){
try{
$value = new static::$type($value);
if(!is_null($value)){
$this->value = $value;
$returnValue = true;
}
}ca... | php | public function setValue($value){
$returnValue = false;
if(!is_null($value)){
try{
$value = new static::$type($value);
if(!is_null($value)){
$this->value = $value;
$returnValue = true;
}
}ca... | [
"public",
"function",
"setValue",
"(",
"$",
"value",
")",
"{",
"$",
"returnValue",
"=",
"false",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"value",
")",
")",
"{",
"try",
"{",
"$",
"value",
"=",
"new",
"static",
"::",
"$",
"type",
"(",
"$",
"value... | Set the attribute value
@param mixed $value
@return boolean
@throws \oat\taoQtiItem\model\qti\attribute\AttributeException | [
"Set",
"the",
"attribute",
"value"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/attribute/Attribute.php#L210-L231 |
oat-sa/extension-tao-itemqti | model/qti/asset/handler/SharedStimulusAssetHandler.php | SharedStimulusAssetHandler.isApplicable | public function isApplicable($relativePath)
{
$xincluded = array();
/** @var Element $xincludeElement */
foreach ($this->getQtiModel()->getComposingElements('oat\taoQtiItem\model\qti\Xinclude') as $xincludeElement) {
$xincluded[] = $xincludeElement->attr('href');
\com... | php | public function isApplicable($relativePath)
{
$xincluded = array();
/** @var Element $xincludeElement */
foreach ($this->getQtiModel()->getComposingElements('oat\taoQtiItem\model\qti\Xinclude') as $xincludeElement) {
$xincluded[] = $xincludeElement->attr('href');
\com... | [
"public",
"function",
"isApplicable",
"(",
"$",
"relativePath",
")",
"{",
"$",
"xincluded",
"=",
"array",
"(",
")",
";",
"/** @var Element $xincludeElement */",
"foreach",
"(",
"$",
"this",
"->",
"getQtiModel",
"(",
")",
"->",
"getComposingElements",
"(",
"'oat\... | Check if current file.xml is shared stimulus
@param $relativePath
@return bool
@throws FileUploadException | [
"Check",
"if",
"current",
"file",
".",
"xml",
"is",
"shared",
"stimulus"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/asset/handler/SharedStimulusAssetHandler.php#L63-L74 |
oat-sa/extension-tao-itemqti | model/qti/asset/handler/SharedStimulusAssetHandler.php | SharedStimulusAssetHandler.handle | public function handle($absolutePath, $relativePath)
{
$sharedFiles = $this->getSharedFiles();
$md5 = md5_file($absolutePath);
if (isset($sharedFiles[$md5])) {
\common_Logger::i('Auxiliary file \'' . $absolutePath . '\' linked to shared storage.');
return $sharedFile... | php | public function handle($absolutePath, $relativePath)
{
$sharedFiles = $this->getSharedFiles();
$md5 = md5_file($absolutePath);
if (isset($sharedFiles[$md5])) {
\common_Logger::i('Auxiliary file \'' . $absolutePath . '\' linked to shared storage.');
return $sharedFile... | [
"public",
"function",
"handle",
"(",
"$",
"absolutePath",
",",
"$",
"relativePath",
")",
"{",
"$",
"sharedFiles",
"=",
"$",
"this",
"->",
"getSharedFiles",
"(",
")",
";",
"$",
"md5",
"=",
"md5_file",
"(",
"$",
"absolutePath",
")",
";",
"if",
"(",
"isse... | Handle the process to manage shared stimulus files
@param $absolutePath
@param $relativePath
@return array
@throws \qtism\data\storage\xml\XmlStorageException | [
"Handle",
"the",
"process",
"to",
"manage",
"shared",
"stimulus",
"files"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/asset/handler/SharedStimulusAssetHandler.php#L84-L107 |
oat-sa/extension-tao-itemqti | model/qti/asset/handler/SharedStimulusAssetHandler.php | SharedStimulusAssetHandler.addSharedFile | public function addSharedFile($key, $value)
{
$sharedFiles = $this->getSharedFiles();
$sharedFiles[$key] = $value;
$this->setSharedFiles($sharedFiles);
return $this;
} | php | public function addSharedFile($key, $value)
{
$sharedFiles = $this->getSharedFiles();
$sharedFiles[$key] = $value;
$this->setSharedFiles($sharedFiles);
return $this;
} | [
"public",
"function",
"addSharedFile",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"sharedFiles",
"=",
"$",
"this",
"->",
"getSharedFiles",
"(",
")",
";",
"$",
"sharedFiles",
"[",
"$",
"key",
"]",
"=",
"$",
"value",
";",
"$",
"this",
"->",
"... | Add a shared file
@param $key
@param $value
@return $this | [
"Add",
"a",
"shared",
"file"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/asset/handler/SharedStimulusAssetHandler.php#L158-L164 |
oat-sa/extension-tao-itemqti | model/CreatorRegistry.php | CreatorRegistry.getDevImplementations | public function getDevImplementations(){
$returnValue = array();
$hookFileName = $this->getHookFileName();
foreach(glob($this->getBaseDevDir().'*/'.$hookFileName.'.js') as $file){
$dir = str_replace($hookFileName.'.js', '', $file);
$manifestFile = $dir.$hookFileName.'... | php | public function getDevImplementations(){
$returnValue = array();
$hookFileName = $this->getHookFileName();
foreach(glob($this->getBaseDevDir().'*/'.$hookFileName.'.js') as $file){
$dir = str_replace($hookFileName.'.js', '', $file);
$manifestFile = $dir.$hookFileName.'... | [
"public",
"function",
"getDevImplementations",
"(",
")",
"{",
"$",
"returnValue",
"=",
"array",
"(",
")",
";",
"$",
"hookFileName",
"=",
"$",
"this",
"->",
"getHookFileName",
"(",
")",
";",
"foreach",
"(",
"glob",
"(",
"$",
"this",
"->",
"getBaseDevDir",
... | Get PCI Creator hooks directly located at views/js/pciCreator/myCustomInteraction:
@return array | [
"Get",
"PCI",
"Creator",
"hooks",
"directly",
"located",
"at",
"views",
"/",
"js",
"/",
"pciCreator",
"/",
"myCustomInteraction",
":"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/CreatorRegistry.php#L68-L100 |
oat-sa/extension-tao-itemqti | model/CreatorRegistry.php | CreatorRegistry.getDevImplementation | public function getDevImplementation($typeIdentifier){
//@todo : re-implement it to be more optimal
$devImplementations = $this->getDevImplementations();
foreach($devImplementations as $impl){
if($impl['typeIdentifier'] == $typeIdentifier){
return $impl;
... | php | public function getDevImplementation($typeIdentifier){
//@todo : re-implement it to be more optimal
$devImplementations = $this->getDevImplementations();
foreach($devImplementations as $impl){
if($impl['typeIdentifier'] == $typeIdentifier){
return $impl;
... | [
"public",
"function",
"getDevImplementation",
"(",
"$",
"typeIdentifier",
")",
"{",
"//@todo : re-implement it to be more optimal",
"$",
"devImplementations",
"=",
"$",
"this",
"->",
"getDevImplementations",
"(",
")",
";",
"foreach",
"(",
"$",
"devImplementations",
"as"... | Get PCI Creator hook located at views/js/{{hookFileName}}/$typeIdentifier
@param string $typeIdentifier
@return array | [
"Get",
"PCI",
"Creator",
"hook",
"located",
"at",
"views",
"/",
"js",
"/",
"{{",
"hookFileName",
"}}",
"/",
"$typeIdentifier"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/CreatorRegistry.php#L108-L118 |
oat-sa/extension-tao-itemqti | model/CreatorRegistry.php | CreatorRegistry.getDevImplementationDirectory | public function getDevImplementationDirectory($typeIdentifier){
$dir = $this->getBaseDevDir().$typeIdentifier;
if(file_exists($dir)){
return $dir;
}else{
throw new \common_Exception('the type identifier cannot be found');
}
} | php | public function getDevImplementationDirectory($typeIdentifier){
$dir = $this->getBaseDevDir().$typeIdentifier;
if(file_exists($dir)){
return $dir;
}else{
throw new \common_Exception('the type identifier cannot be found');
}
} | [
"public",
"function",
"getDevImplementationDirectory",
"(",
"$",
"typeIdentifier",
")",
"{",
"$",
"dir",
"=",
"$",
"this",
"->",
"getBaseDevDir",
"(",
")",
".",
"$",
"typeIdentifier",
";",
"if",
"(",
"file_exists",
"(",
"$",
"dir",
")",
")",
"{",
"return",... | Get the path to the directory of a the Creator located at views/js/{{hookFileName}}/
@param string $typeIdentifier
@return string
@throws \common_Exception | [
"Get",
"the",
"path",
"to",
"the",
"directory",
"of",
"a",
"the",
"Creator",
"located",
"at",
"views",
"/",
"js",
"/",
"{{",
"hookFileName",
"}}",
"/"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/CreatorRegistry.php#L127-L134 |
oat-sa/extension-tao-itemqti | model/CreatorRegistry.php | CreatorRegistry.addRequiredResources | public function addRequiredResources($typeIdentifier, core_kernel_classes_Resource $item){
//find the interaction in the registry
$implementationData = $this->getImplementatioByTypeIdentifier($typeIdentifier);
if(is_null($implementationData)){
throw new common_exception_Erro... | php | public function addRequiredResources($typeIdentifier, core_kernel_classes_Resource $item){
//find the interaction in the registry
$implementationData = $this->getImplementatioByTypeIdentifier($typeIdentifier);
if(is_null($implementationData)){
throw new common_exception_Erro... | [
"public",
"function",
"addRequiredResources",
"(",
"$",
"typeIdentifier",
",",
"core_kernel_classes_Resource",
"$",
"item",
")",
"{",
"//find the interaction in the registry",
"$",
"implementationData",
"=",
"$",
"this",
"->",
"getImplementatioByTypeIdentifier",
"(",
"$",
... | Add required resources for a custom interaction (css, js) in the item directory
@param string $typeIdentifier
@param \core_kernel_classes_Resource $item
@throws common_exception_Error | [
"Add",
"required",
"resources",
"for",
"a",
"custom",
"interaction",
"(",
"css",
"js",
")",
"in",
"the",
"item",
"directory"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/CreatorRegistry.php#L153-L191 |
oat-sa/extension-tao-itemqti | model/portableElement/PortableElementService.php | PortableElementService.validate | public function validate(PortableElementObject $object, $source=null, $validationGroup=array())
{
$validator = $object->getModel()->getValidator();
Validator::validate($object, $validator, $validationGroup);
if ($source) {
$validator->validateAssets($object, $source);
}
... | php | public function validate(PortableElementObject $object, $source=null, $validationGroup=array())
{
$validator = $object->getModel()->getValidator();
Validator::validate($object, $validator, $validationGroup);
if ($source) {
$validator->validateAssets($object, $source);
}
... | [
"public",
"function",
"validate",
"(",
"PortableElementObject",
"$",
"object",
",",
"$",
"source",
"=",
"null",
",",
"$",
"validationGroup",
"=",
"array",
"(",
")",
")",
"{",
"$",
"validator",
"=",
"$",
"object",
"->",
"getModel",
"(",
")",
"->",
"getVal... | Validate a model using associated validator
@param PortableElementObject $object
@param null $source Directory of portable element, if not null it will be checked
@param array $validationGroup Fields to be checked, empty=$validator->getConstraints()
@return bool
@throws PortableElementInconsistencyModelException | [
"Validate",
"a",
"model",
"using",
"associated",
"validator"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/portableElement/PortableElementService.php#L60-L67 |
oat-sa/extension-tao-itemqti | model/portableElement/PortableElementService.php | PortableElementService.registerModel | public function registerModel(PortableElementObject $object, $source)
{
$validationGroup = array('typeIdentifier', 'version', 'runtime');
$this->validate($object, $source, $validationGroup);
$registry = $object->getModel()->getRegistry();
//enable portable element immediately when ... | php | public function registerModel(PortableElementObject $object, $source)
{
$validationGroup = array('typeIdentifier', 'version', 'runtime');
$this->validate($object, $source, $validationGroup);
$registry = $object->getModel()->getRegistry();
//enable portable element immediately when ... | [
"public",
"function",
"registerModel",
"(",
"PortableElementObject",
"$",
"object",
",",
"$",
"source",
")",
"{",
"$",
"validationGroup",
"=",
"array",
"(",
"'typeIdentifier'",
",",
"'version'",
",",
"'runtime'",
")",
";",
"$",
"this",
"->",
"validate",
"(",
... | Register a $model with $source into registryEntries & filesystem
@param PortableElementObject $object
@param $source
@return bool
@throws PortableElementInvalidModelException
@throws PortableElementVersionIncompatibilityException | [
"Register",
"a",
"$model",
"with",
"$source",
"into",
"registryEntries",
"&",
"filesystem"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/portableElement/PortableElementService.php#L78-L91 |
oat-sa/extension-tao-itemqti | model/portableElement/PortableElementService.php | PortableElementService.unregisterModel | public function unregisterModel(PortableElementObject $object){
$registry = $object->getModel()->getRegistry();
$registry->delete($object);
return true;
} | php | public function unregisterModel(PortableElementObject $object){
$registry = $object->getModel()->getRegistry();
$registry->delete($object);
return true;
} | [
"public",
"function",
"unregisterModel",
"(",
"PortableElementObject",
"$",
"object",
")",
"{",
"$",
"registry",
"=",
"$",
"object",
"->",
"getModel",
"(",
")",
"->",
"getRegistry",
"(",
")",
";",
"$",
"registry",
"->",
"delete",
"(",
"$",
"object",
")",
... | Unregister the portable element
@param PortableElementObject $object
@return bool
@throws PortableElementVersionIncompatibilityException | [
"Unregister",
"the",
"portable",
"element"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/portableElement/PortableElementService.php#L100-L104 |
oat-sa/extension-tao-itemqti | model/portableElement/PortableElementService.php | PortableElementService.export | public function export($type, $identifier, $version=null)
{
$model = $this->getPortableModelRegistry()->getModel($type);
$object = $model->getRegistry()->fetch($identifier, $version);
if (is_null($object)) {
throw new PortableElementNotFoundException(
'Unable to ... | php | public function export($type, $identifier, $version=null)
{
$model = $this->getPortableModelRegistry()->getModel($type);
$object = $model->getRegistry()->fetch($identifier, $version);
if (is_null($object)) {
throw new PortableElementNotFoundException(
'Unable to ... | [
"public",
"function",
"export",
"(",
"$",
"type",
",",
"$",
"identifier",
",",
"$",
"version",
"=",
"null",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getPortableModelRegistry",
"(",
")",
"->",
"getModel",
"(",
"$",
"type",
")",
";",
"$",
"obje... | Export a model with files into a ZIP
@param $type
@param $identifier
@param null $version
@return string
@throws PortableElementNotFoundException
@throws \common_Exception
@throws PortableElementInconsistencyModelException | [
"Export",
"a",
"model",
"with",
"files",
"into",
"a",
"ZIP"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/portableElement/PortableElementService.php#L117-L129 |
oat-sa/extension-tao-itemqti | model/portableElement/PortableElementService.php | PortableElementService.import | public function import($type, $zipFile)
{
/** @var PortableElementPackageParser $parser */
$parser = $this->getPortableModelRegistry()->getModel($type)->getPackageParser();
$source = $parser->extract($zipFile);
$object = $parser->getModel()->createDataObject($parser->getManifestConte... | php | public function import($type, $zipFile)
{
/** @var PortableElementPackageParser $parser */
$parser = $this->getPortableModelRegistry()->getModel($type)->getPackageParser();
$source = $parser->extract($zipFile);
$object = $parser->getModel()->createDataObject($parser->getManifestConte... | [
"public",
"function",
"import",
"(",
"$",
"type",
",",
"$",
"zipFile",
")",
"{",
"/** @var PortableElementPackageParser $parser */",
"$",
"parser",
"=",
"$",
"this",
"->",
"getPortableModelRegistry",
"(",
")",
"->",
"getModel",
"(",
"$",
"type",
")",
"->",
"ge... | Import a Portable element from an uploaded zip file
@param $type
@param $zipFile
@return mixed
@throws PortableElementInconsistencyModelException | [
"Import",
"a",
"Portable",
"element",
"from",
"an",
"uploaded",
"zip",
"file"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/portableElement/PortableElementService.php#L139-L151 |
oat-sa/extension-tao-itemqti | model/portableElement/PortableElementService.php | PortableElementService.getValidPortableElementFromZipSource | public function getValidPortableElementFromZipSource($type, $zipFile)
{
/** @var PortableElementPackageParser $parser */
$parser = $this->getPortableModelRegistry()->getModel($type)->getPackageParser();
$source = $parser->extract($zipFile);
$object = $parser->getModel()->createDataOb... | php | public function getValidPortableElementFromZipSource($type, $zipFile)
{
/** @var PortableElementPackageParser $parser */
$parser = $this->getPortableModelRegistry()->getModel($type)->getPackageParser();
$source = $parser->extract($zipFile);
$object = $parser->getModel()->createDataOb... | [
"public",
"function",
"getValidPortableElementFromZipSource",
"(",
"$",
"type",
",",
"$",
"zipFile",
")",
"{",
"/** @var PortableElementPackageParser $parser */",
"$",
"parser",
"=",
"$",
"this",
"->",
"getPortableModelRegistry",
"(",
")",
"->",
"getModel",
"(",
"$",
... | Extract a valid model from a zip
@param $type
@param $zipFile
@return mixed
@throws PortableElementInconsistencyModelException | [
"Extract",
"a",
"valid",
"model",
"from",
"a",
"zip"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/portableElement/PortableElementService.php#L161-L170 |
oat-sa/extension-tao-itemqti | model/portableElement/PortableElementService.php | PortableElementService.getDirectoryParsers | protected function getDirectoryParsers()
{
$parsers = array();
$models = $this->getPortableModelRegistry()->getModels();
foreach ($models as $key => $model) {
if ($model->getDirectoryParser() instanceof PortableElementDirectoryParser) {
$parsers[] = $model->getDir... | php | protected function getDirectoryParsers()
{
$parsers = array();
$models = $this->getPortableModelRegistry()->getModels();
foreach ($models as $key => $model) {
if ($model->getDirectoryParser() instanceof PortableElementDirectoryParser) {
$parsers[] = $model->getDir... | [
"protected",
"function",
"getDirectoryParsers",
"(",
")",
"{",
"$",
"parsers",
"=",
"array",
"(",
")",
";",
"$",
"models",
"=",
"$",
"this",
"->",
"getPortableModelRegistry",
"(",
")",
"->",
"getModels",
"(",
")",
";",
"foreach",
"(",
"$",
"models",
"as"... | Return all directory parsers from configuration
@return PortableElementDirectoryParser[] | [
"Return",
"all",
"directory",
"parsers",
"from",
"configuration"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/portableElement/PortableElementService.php#L177-L189 |
oat-sa/extension-tao-itemqti | model/portableElement/PortableElementService.php | PortableElementService.getValidPortableElementFromDirectorySource | public function getValidPortableElementFromDirectorySource($directory)
{
$parserMatched = null;
$parsers = $this->getDirectoryParsers();
/** @var PortableElementDirectoryParser $parser */
foreach ($parsers as $parser) {
if ($parser->hasValidPortableElement($directory)) {
... | php | public function getValidPortableElementFromDirectorySource($directory)
{
$parserMatched = null;
$parsers = $this->getDirectoryParsers();
/** @var PortableElementDirectoryParser $parser */
foreach ($parsers as $parser) {
if ($parser->hasValidPortableElement($directory)) {
... | [
"public",
"function",
"getValidPortableElementFromDirectorySource",
"(",
"$",
"directory",
")",
"{",
"$",
"parserMatched",
"=",
"null",
";",
"$",
"parsers",
"=",
"$",
"this",
"->",
"getDirectoryParsers",
"(",
")",
";",
"/** @var PortableElementDirectoryParser $parser */... | Extract a valid model from a directory
@param $directory
@return null|PortableElementObject
@throws PortableElementParserException
@throws \common_Exception | [
"Extract",
"a",
"valid",
"model",
"from",
"a",
"directory"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/portableElement/PortableElementService.php#L199-L229 |
oat-sa/extension-tao-itemqti | model/portableElement/PortableElementService.php | PortableElementService.getPortableElementByIdentifier | public function getPortableElementByIdentifier($type, $identifier, $version=null)
{
$model = $this->getPortableModelRegistry()->getModel($type);
$registry = $model->getRegistry();
if($registry->has($identifier, $version)){
return $registry->fetch($identifier, $version);
... | php | public function getPortableElementByIdentifier($type, $identifier, $version=null)
{
$model = $this->getPortableModelRegistry()->getModel($type);
$registry = $model->getRegistry();
if($registry->has($identifier, $version)){
return $registry->fetch($identifier, $version);
... | [
"public",
"function",
"getPortableElementByIdentifier",
"(",
"$",
"type",
",",
"$",
"identifier",
",",
"$",
"version",
"=",
"null",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getPortableModelRegistry",
"(",
")",
"->",
"getModel",
"(",
"$",
"type",
")... | Get model from identifier & version
@param $type
@param $identifier
@param null $version
@return null|PortableElementObject
@throws PortableElementNotFoundException
@throws PortableElementInconsistencyModelException | [
"Get",
"model",
"from",
"identifier",
"&",
"version"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/portableElement/PortableElementService.php#L241-L250 |
oat-sa/extension-tao-itemqti | model/portableElement/PortableElementService.php | PortableElementService.registerFromDirectorySource | public function registerFromDirectorySource($directory)
{
$object = $this->getValidPortableElementFromDirectorySource($directory);
if (is_null($object)) {
throw new PortableElementNotFoundException('No valid portable element model found in the directory '.$directory);
}
... | php | public function registerFromDirectorySource($directory)
{
$object = $this->getValidPortableElementFromDirectorySource($directory);
if (is_null($object)) {
throw new PortableElementNotFoundException('No valid portable element model found in the directory '.$directory);
}
... | [
"public",
"function",
"registerFromDirectorySource",
"(",
"$",
"directory",
")",
"{",
"$",
"object",
"=",
"$",
"this",
"->",
"getValidPortableElementFromDirectorySource",
"(",
"$",
"directory",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"object",
")",
")",
"{",... | Register a model from a directory based on manifest.json
@param $directory
@return bool
@throws \common_Exception | [
"Register",
"a",
"model",
"from",
"a",
"directory",
"based",
"on",
"manifest",
".",
"json"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/portableElement/PortableElementService.php#L259-L267 |
oat-sa/extension-tao-itemqti | model/portableElement/PortableElementService.php | PortableElementService.retrieve | public function retrieve($type, $identifier, $version=null)
{
$model = $this->getPortableModelRegistry()->getModel($type);
return $model->getRegistry()->fetch($identifier, $version);
} | php | public function retrieve($type, $identifier, $version=null)
{
$model = $this->getPortableModelRegistry()->getModel($type);
return $model->getRegistry()->fetch($identifier, $version);
} | [
"public",
"function",
"retrieve",
"(",
"$",
"type",
",",
"$",
"identifier",
",",
"$",
"version",
"=",
"null",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getPortableModelRegistry",
"(",
")",
"->",
"getModel",
"(",
"$",
"type",
")",
";",
"return",
... | Fill all values of a model based on $object->getTypeIdentifier, $object->getVersion
@param $type
@param $identifier
@param null $version
@return PortableElementObject
@throws PortableElementNotFoundException
@throws PortableElementInconsistencyModelException | [
"Fill",
"all",
"values",
"of",
"a",
"model",
"based",
"on",
"$object",
"-",
">",
"getTypeIdentifier",
"$object",
"-",
">",
"getVersion"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/portableElement/PortableElementService.php#L279-L283 |
oat-sa/extension-tao-itemqti | model/portableElement/PortableElementService.php | PortableElementService.getFileStream | public function getFileStream(PortableElementObject $object, $file)
{
return $object->getModel()->getRegistry()->getFileStream($object, $file);
} | php | public function getFileStream(PortableElementObject $object, $file)
{
return $object->getModel()->getRegistry()->getFileStream($object, $file);
} | [
"public",
"function",
"getFileStream",
"(",
"PortableElementObject",
"$",
"object",
",",
"$",
"file",
")",
"{",
"return",
"$",
"object",
"->",
"getModel",
"(",
")",
"->",
"getRegistry",
"(",
")",
"->",
"getFileStream",
"(",
"$",
"object",
",",
"$",
"file",... | Return the stream of a file model
@param PortableElementObject $object
@param $file
@return bool|false|resource
@throws \tao_models_classes_FileNotFoundException | [
"Return",
"the",
"stream",
"of",
"a",
"file",
"model"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/portableElement/PortableElementService.php#L293-L296 |
oat-sa/extension-tao-itemqti | model/portableElement/PortableElementService.php | PortableElementService.getPortableElementByClass | public function getPortableElementByClass($portableElementClass, Element $qtiItem, $useVersionAlias = false){
$portableElements = [];
$identifiers = array_map(function($portableElement){
return $portableElement->getTypeIdentifier();
}, $qtiItem->getComposingElements($portableElement... | php | public function getPortableElementByClass($portableElementClass, Element $qtiItem, $useVersionAlias = false){
$portableElements = [];
$identifiers = array_map(function($portableElement){
return $portableElement->getTypeIdentifier();
}, $qtiItem->getComposingElements($portableElement... | [
"public",
"function",
"getPortableElementByClass",
"(",
"$",
"portableElementClass",
",",
"Element",
"$",
"qtiItem",
",",
"$",
"useVersionAlias",
"=",
"false",
")",
"{",
"$",
"portableElements",
"=",
"[",
"]",
";",
"$",
"identifiers",
"=",
"array_map",
"(",
"f... | Get the array of portable elements used in qti item object by its php class
@param string $portableElementClass - PORTABLE_CLASS_INTERACTION or PORTABLE_CLASS_INFOCONTROL
@param Element $qtiItem
@return array | [
"Get",
"the",
"array",
"of",
"portable",
"elements",
"used",
"in",
"qti",
"item",
"object",
"by",
"its",
"php",
"class"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/portableElement/PortableElementService.php#L318-L342 |
oat-sa/extension-tao-itemqti | model/portableElement/PortableElementService.php | PortableElementService.setBaseUrlToPortableData | public function setBaseUrlToPortableData(&$data){
$model = $this->getPortableModelRegistry()->getModel($data['model']);
$portableObject = $model->createDataObject($data);
$data['baseUrl'] = $model->getRegistry()->getBaseUrl($portableObject);
return $data;
} | php | public function setBaseUrlToPortableData(&$data){
$model = $this->getPortableModelRegistry()->getModel($data['model']);
$portableObject = $model->createDataObject($data);
$data['baseUrl'] = $model->getRegistry()->getBaseUrl($portableObject);
return $data;
} | [
"public",
"function",
"setBaseUrlToPortableData",
"(",
"&",
"$",
"data",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getPortableModelRegistry",
"(",
")",
"->",
"getModel",
"(",
"$",
"data",
"[",
"'model'",
"]",
")",
";",
"$",
"portableObject",
"=",
... | Set the base url to a portable element data array
@param $data
@return mixed | [
"Set",
"the",
"base",
"url",
"to",
"a",
"portable",
"element",
"data",
"array"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/portableElement/PortableElementService.php#L349-L354 |
oat-sa/extension-tao-itemqti | model/qti/expression/CommonExpression.php | CommonExpression.getRule | public function getRule()
{
$returnValue = (string) '';
// Get subExpressions
$subExpressionsRules = array();
foreach ($this->subExpressions as $subExpression){
$subExpressionsRules[] = $subExpression->getRule();
}
$subExpressionsJSON = implode(',', ... | php | public function getRule()
{
$returnValue = (string) '';
// Get subExpressions
$subExpressionsRules = array();
foreach ($this->subExpressions as $subExpression){
$subExpressionsRules[] = $subExpression->getRule();
}
$subExpressionsJSON = implode(',', ... | [
"public",
"function",
"getRule",
"(",
")",
"{",
"$",
"returnValue",
"=",
"(",
"string",
")",
"''",
";",
"// Get subExpressions",
"$",
"subExpressionsRules",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"subExpressions",
"as",
"$",
"subEx... | Short description of method getRule
@access public
@author Joel Bout, <joel.bout@tudor.lu>
@return string | [
"Short",
"description",
"of",
"method",
"getRule"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/expression/CommonExpression.php#L86-L145 |
oat-sa/extension-tao-itemqti | model/qti/expression/CommonExpression.php | CommonExpression.setValue | public function setValue( $value)
{
// Set the value of the expression and cast it function of the (defined) base type of the variable
if ($this->attributes['baseType']){
switch ($this->attributes['baseType']){
case 'boolean':
if (is_s... | php | public function setValue( $value)
{
// Set the value of the expression and cast it function of the (defined) base type of the variable
if ($this->attributes['baseType']){
switch ($this->attributes['baseType']){
case 'boolean':
if (is_s... | [
"public",
"function",
"setValue",
"(",
"$",
"value",
")",
"{",
"// Set the value of the expression and cast it function of the (defined) base type of the variable",
"if",
"(",
"$",
"this",
"->",
"attributes",
"[",
"'baseType'",
"]",
")",
"{",
"switch",
"(",
"$",
"this",... | Short description of method setValue
@access public
@author Joel Bout, <joel.bout@tudor.lu>
@param value
@return mixed | [
"Short",
"description",
"of",
"method",
"setValue"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/expression/CommonExpression.php#L187-L224 |
oat-sa/extension-tao-itemqti | model/qti/metadata/ontology/GenericLomOntologyClassificationInjector.php | GenericLomOntologyClassificationInjector.inject | public function inject($target, array $values)
{
if (!$target instanceof \core_kernel_classes_Resource) {
$msg = "The given target is not an instance of core_kernel_classes_Resource.";
throw new MetadataInjectionException($msg);
}
/** @var \core_kernel_classes_Class ... | php | public function inject($target, array $values)
{
if (!$target instanceof \core_kernel_classes_Resource) {
$msg = "The given target is not an instance of core_kernel_classes_Resource.";
throw new MetadataInjectionException($msg);
}
/** @var \core_kernel_classes_Class ... | [
"public",
"function",
"inject",
"(",
"$",
"target",
",",
"array",
"$",
"values",
")",
"{",
"if",
"(",
"!",
"$",
"target",
"instanceof",
"\\",
"core_kernel_classes_Resource",
")",
"{",
"$",
"msg",
"=",
"\"The given target is not an instance of core_kernel_classes_Res... | Inject dynamically a metadata to an item property
@param mixed $target
@param array $values
@throws MetadataInjectionException | [
"Inject",
"dynamically",
"a",
"metadata",
"to",
"an",
"item",
"property"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/metadata/ontology/GenericLomOntologyClassificationInjector.php#L39-L73 |
oat-sa/extension-tao-itemqti | model/qti/XInclude.php | XInclude.getTemplateQtiVariables | protected function getTemplateQtiVariables(){
$variables = parent::getTemplateQtiVariables();
$tag = static::$qtiTagName;
//search existing mathML ns declaration:
$ns = $this->getXIncludeNamespace();
if(empty($ns)){
//add one!
$relatedItem = $this->getR... | php | protected function getTemplateQtiVariables(){
$variables = parent::getTemplateQtiVariables();
$tag = static::$qtiTagName;
//search existing mathML ns declaration:
$ns = $this->getXIncludeNamespace();
if(empty($ns)){
//add one!
$relatedItem = $this->getR... | [
"protected",
"function",
"getTemplateQtiVariables",
"(",
")",
"{",
"$",
"variables",
"=",
"parent",
"::",
"getTemplateQtiVariables",
"(",
")",
";",
"$",
"tag",
"=",
"static",
"::",
"$",
"qtiTagName",
";",
"//search existing mathML ns declaration:",
"$",
"ns",
"=",... | Get the variables for the qti template rendering
@return array | [
"Get",
"the",
"variables",
"for",
"the",
"qti",
"template",
"rendering"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/XInclude.php#L76-L100 |
oat-sa/extension-tao-itemqti | model/qti/XInclude.php | XInclude.getXIncludeNamespace | public function getXIncludeNamespace(){
$ns = '';
$relatedItem = $this->getRelatedItem();
if(!is_null($relatedItem)){
foreach($relatedItem->getNamespaces() as $name => $uri){
if(strpos($uri, 'XInclude') > 0){
$ns = $name;
break;... | php | public function getXIncludeNamespace(){
$ns = '';
$relatedItem = $this->getRelatedItem();
if(!is_null($relatedItem)){
foreach($relatedItem->getNamespaces() as $name => $uri){
if(strpos($uri, 'XInclude') > 0){
$ns = $name;
break;... | [
"public",
"function",
"getXIncludeNamespace",
"(",
")",
"{",
"$",
"ns",
"=",
"''",
";",
"$",
"relatedItem",
"=",
"$",
"this",
"->",
"getRelatedItem",
"(",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"relatedItem",
")",
")",
"{",
"foreach",
"(",
"$... | Get the xml namespace of the xinclude
@return string | [
"Get",
"the",
"xml",
"namespace",
"of",
"the",
"xinclude"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/XInclude.php#L107-L119 |
oat-sa/extension-tao-itemqti | model/qti/metadata/imsManifest/classificationMetadata/GenericLomManifestClassificationExtractor.php | GenericLomManifestClassificationExtractor.extract | public function extract($manifest)
{
$values = parent::extract($manifest);
$newValues = array();
foreach ($values as $resourceIdentifier => $metadataValueCollection) {
/** @var ImsManifestMetadataValue $metadataValue */
foreach ($metadataValueCollection as $key => $... | php | public function extract($manifest)
{
$values = parent::extract($manifest);
$newValues = array();
foreach ($values as $resourceIdentifier => $metadataValueCollection) {
/** @var ImsManifestMetadataValue $metadataValue */
foreach ($metadataValueCollection as $key => $... | [
"public",
"function",
"extract",
"(",
"$",
"manifest",
")",
"{",
"$",
"values",
"=",
"parent",
"::",
"extract",
"(",
"$",
"manifest",
")",
";",
"$",
"newValues",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"values",
"as",
"$",
"resourceIdentifier... | @see ImsManifestDataExtractor::extract()
@param mixed $manifest
@return array | [
"@see",
"ImsManifestDataExtractor",
"::",
"extract",
"()"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/metadata/imsManifest/classificationMetadata/GenericLomManifestClassificationExtractor.php#L37-L72 |
oat-sa/extension-tao-itemqti | model/portableElement/parser/element/PortableElementDirectoryParser.php | PortableElementDirectoryParser.validate | public function validate($source)
{
$this->assertSourceAsDirectory($source);
$definitionFiles = $this->getModel()->getDefinitionFiles();
foreach ($definitionFiles as $file) {
if (! file_exists($source . DIRECTORY_SEPARATOR . $file)) {
throw new PortableElementPar... | php | public function validate($source)
{
$this->assertSourceAsDirectory($source);
$definitionFiles = $this->getModel()->getDefinitionFiles();
foreach ($definitionFiles as $file) {
if (! file_exists($source . DIRECTORY_SEPARATOR . $file)) {
throw new PortableElementPar... | [
"public",
"function",
"validate",
"(",
"$",
"source",
")",
"{",
"$",
"this",
"->",
"assertSourceAsDirectory",
"(",
"$",
"source",
")",
";",
"$",
"definitionFiles",
"=",
"$",
"this",
"->",
"getModel",
"(",
")",
"->",
"getDefinitionFiles",
"(",
")",
";",
"... | Validate the source directory
@param string $source Directory path to validate
@return bool
@throws ExtractException
@throws PortableElementParserException
@throws common_Exception | [
"Validate",
"the",
"source",
"directory"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/portableElement/parser/element/PortableElementDirectoryParser.php#L49-L63 |
oat-sa/extension-tao-itemqti | model/portableElement/parser/element/PortableElementDirectoryParser.php | PortableElementDirectoryParser.getManifestContent | public function getManifestContent($source)
{
$content = json_decode(file_get_contents($source . DIRECTORY_SEPARATOR
. $this->getModel()->getManifestName()), true);
if (json_last_error() === JSON_ERROR_NONE) {
return $content;
}
throw new common_Exception('Por... | php | public function getManifestContent($source)
{
$content = json_decode(file_get_contents($source . DIRECTORY_SEPARATOR
. $this->getModel()->getManifestName()), true);
if (json_last_error() === JSON_ERROR_NONE) {
return $content;
}
throw new common_Exception('Por... | [
"public",
"function",
"getManifestContent",
"(",
"$",
"source",
")",
"{",
"$",
"content",
"=",
"json_decode",
"(",
"file_get_contents",
"(",
"$",
"source",
".",
"DIRECTORY_SEPARATOR",
".",
"$",
"this",
"->",
"getModel",
"(",
")",
"->",
"getManifestName",
"(",
... | Return the manifest content found in the source directory as json array
@param string $source Directory path
@return array
@throws PortableElementInconsistencyModelException
@throws common_Exception | [
"Return",
"the",
"manifest",
"content",
"found",
"in",
"the",
"source",
"directory",
"as",
"json",
"array"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/portableElement/parser/element/PortableElementDirectoryParser.php#L86-L94 |
oat-sa/extension-tao-itemqti | model/tasks/ImportQtiItem.php | ImportQtiItem.createTask | public static function createTask($packageFile, \core_kernel_classes_Class $class, ServiceLocatorInterface $serviceManager, $enableMetadataGuardians = true, $enableMetadataValidators = true, $itemMustExist = false, $itemMustBeOverwritten = false)
{
$action = new self();
$action->setServiceLocator($s... | php | public static function createTask($packageFile, \core_kernel_classes_Class $class, ServiceLocatorInterface $serviceManager, $enableMetadataGuardians = true, $enableMetadataValidators = true, $itemMustExist = false, $itemMustBeOverwritten = false)
{
$action = new self();
$action->setServiceLocator($s... | [
"public",
"static",
"function",
"createTask",
"(",
"$",
"packageFile",
",",
"\\",
"core_kernel_classes_Class",
"$",
"class",
",",
"ServiceLocatorInterface",
"$",
"serviceManager",
",",
"$",
"enableMetadataGuardians",
"=",
"true",
",",
"$",
"enableMetadataValidators",
... | Create task in queue
@param string $packageFile uploaded file path
@param \core_kernel_classes_Class $class uploaded file
@param ServiceLocatorInterface $serviceManager
@param boolean $enableMetadataGuardians
@param boolean $enableMetadataValidators
@p... | [
"Create",
"task",
"in",
"queue"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/tasks/ImportQtiItem.php#L95-L117 |
oat-sa/extension-tao-itemqti | model/Export/AbstractQTIItemExporter.php | AbstractQTIItemExporter.export | public function export($options = array())
{
$report = \common_report_Report::createSuccess();
$asApip = isset($options['apip']) && $options['apip'] === true;
$lang = \common_session_SessionManager::getSession()->getDataLanguage();
$basePath = $this->buildBasePath();
if(is_... | php | public function export($options = array())
{
$report = \common_report_Report::createSuccess();
$asApip = isset($options['apip']) && $options['apip'] === true;
$lang = \common_session_SessionManager::getSession()->getDataLanguage();
$basePath = $this->buildBasePath();
if(is_... | [
"public",
"function",
"export",
"(",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"report",
"=",
"\\",
"common_report_Report",
"::",
"createSuccess",
"(",
")",
";",
"$",
"asApip",
"=",
"isset",
"(",
"$",
"options",
"[",
"'apip'",
"]",
")",
... | Overriden export from QTI items.
@see taoItems_models_classes_ItemExporter::export()
@param array $options An array of options.
@return \common_report_Report
@throws ExportException
@throws \common_Exception
@throws \common_exception_Error
@throws \core_kernel_persistence_Exception
@throws PortableElementInvalidAssetE... | [
"Overriden",
"export",
"from",
"QTI",
"items",
"."
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/Export/AbstractQTIItemExporter.php#L80-L202 |
oat-sa/extension-tao-itemqti | model/Export/AbstractQTIItemExporter.php | AbstractQTIItemExporter.getAssets | protected function getAssets(\core_kernel_classes_Resource $item, $lang)
{
$qtiItem = Service::singleton()->getDataItemByRdfItem($item, $lang);
if (is_null($qtiItem)) {
return [];
}
$assetParser = new AssetParser($qtiItem, $this->getStorageDirectory($item, $lang));
... | php | protected function getAssets(\core_kernel_classes_Resource $item, $lang)
{
$qtiItem = Service::singleton()->getDataItemByRdfItem($item, $lang);
if (is_null($qtiItem)) {
return [];
}
$assetParser = new AssetParser($qtiItem, $this->getStorageDirectory($item, $lang));
... | [
"protected",
"function",
"getAssets",
"(",
"\\",
"core_kernel_classes_Resource",
"$",
"item",
",",
"$",
"lang",
")",
"{",
"$",
"qtiItem",
"=",
"Service",
"::",
"singleton",
"(",
")",
"->",
"getDataItemByRdfItem",
"(",
"$",
"item",
",",
"$",
"lang",
")",
";... | Get the item's assets
@param \core_kernel_classes_Resource $item The item
@param string $lang The item lang
@return string[] The assets URLs | [
"Get",
"the",
"item",
"s",
"assets"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/Export/AbstractQTIItemExporter.php#L243-L263 |
oat-sa/extension-tao-itemqti | model/Export/AbstractQTIItemExporter.php | AbstractQTIItemExporter.getStorageDirectory | protected function getStorageDirectory(\core_kernel_classes_Resource $item, $lang)
{
$itemService = \taoItems_models_classes_ItemsService::singleton();
$directory = $itemService->getItemDirectory($item, $lang);
//we should use be language unaware for storage manipulation
$path = str... | php | protected function getStorageDirectory(\core_kernel_classes_Resource $item, $lang)
{
$itemService = \taoItems_models_classes_ItemsService::singleton();
$directory = $itemService->getItemDirectory($item, $lang);
//we should use be language unaware for storage manipulation
$path = str... | [
"protected",
"function",
"getStorageDirectory",
"(",
"\\",
"core_kernel_classes_Resource",
"$",
"item",
",",
"$",
"lang",
")",
"{",
"$",
"itemService",
"=",
"\\",
"taoItems_models_classes_ItemsService",
"::",
"singleton",
"(",
")",
";",
"$",
"directory",
"=",
"$",... | Get the item's directory
@param \core_kernel_classes_Resource $item The item
@param string $lang The item lang
@return Directory The directory | [
"Get",
"the",
"item",
"s",
"directory"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/Export/AbstractQTIItemExporter.php#L285-L293 |
oat-sa/extension-tao-itemqti | model/Export/AbstractQTIItemExporter.php | AbstractQTIItemExporter.getMetadataExporter | protected function getMetadataExporter()
{
if (! $this->metadataExporter) {
$this->metadataExporter = $this->getServiceManager()->get(MetadataService::SERVICE_ID)->getExporter();
}
return $this->metadataExporter;
} | php | protected function getMetadataExporter()
{
if (! $this->metadataExporter) {
$this->metadataExporter = $this->getServiceManager()->get(MetadataService::SERVICE_ID)->getExporter();
}
return $this->metadataExporter;
} | [
"protected",
"function",
"getMetadataExporter",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"metadataExporter",
")",
"{",
"$",
"this",
"->",
"metadataExporter",
"=",
"$",
"this",
"->",
"getServiceManager",
"(",
")",
"->",
"get",
"(",
"MetadataService",... | Get the service to export Metadata
@return MetadataExporter | [
"Get",
"the",
"service",
"to",
"export",
"Metadata"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/Export/AbstractQTIItemExporter.php#L305-L311 |
oat-sa/extension-tao-itemqti | model/qti/response/ResponseRuleParserFactory.php | ResponseRuleParserFactory.buildResponseRule | public static function buildResponseRule( SimpleXMLElement $data)
{
$returnValue = null;
switch ($data->getName()) {
case 'exitResponse' : $returnValue = new ExitResponse();
break;
case 'setOutcomeValue' :
$identifier = (string)$data['identifier'];
$children = array();
foreach ($... | php | public static function buildResponseRule( SimpleXMLElement $data)
{
$returnValue = null;
switch ($data->getName()) {
case 'exitResponse' : $returnValue = new ExitResponse();
break;
case 'setOutcomeValue' :
$identifier = (string)$data['identifier'];
$children = array();
foreach ($... | [
"public",
"static",
"function",
"buildResponseRule",
"(",
"SimpleXMLElement",
"$",
"data",
")",
"{",
"$",
"returnValue",
"=",
"null",
";",
"switch",
"(",
"$",
"data",
"->",
"getName",
"(",
")",
")",
"{",
"case",
"'exitResponse'",
":",
"$",
"returnValue",
"... | Short description of method buildResponseRule
@access public
@author Joel Bout, <joel.bout@tudor.lu>
@param SimpleXMLElement data
@return oat\taoQtiItem\model\qti\response\ResponseRule | [
"Short",
"description",
"of",
"method",
"buildResponseRule"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/response/ResponseRuleParserFactory.php#L51-L75 |
oat-sa/extension-tao-itemqti | model/qti/response/ResponseRuleParserFactory.php | ResponseRuleParserFactory.buildResponseCondition | private static function buildResponseCondition( SimpleXMLElement $data)
{
$responseCondition = new ResponseCondition();
foreach ($data->children() as $child) {
switch ($child->getName()) {
case 'responseIf' :
case 'responseElseIf' :
$subchildren = null;
foreach ($child->children() ... | php | private static function buildResponseCondition( SimpleXMLElement $data)
{
$responseCondition = new ResponseCondition();
foreach ($data->children() as $child) {
switch ($child->getName()) {
case 'responseIf' :
case 'responseElseIf' :
$subchildren = null;
foreach ($child->children() ... | [
"private",
"static",
"function",
"buildResponseCondition",
"(",
"SimpleXMLElement",
"$",
"data",
")",
"{",
"$",
"responseCondition",
"=",
"new",
"ResponseCondition",
"(",
")",
";",
"foreach",
"(",
"$",
"data",
"->",
"children",
"(",
")",
"as",
"$",
"child",
... | Short description of method buildResponseCondition
@access private
@author Joel Bout, <joel.bout@tudor.lu>
@param SimpleXMLElement data
@return oat\taoQtiItem\model\qti\response\ResponseCondition | [
"Short",
"description",
"of",
"method",
"buildResponseCondition"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/response/ResponseRuleParserFactory.php#L85-L127 |
oat-sa/extension-tao-itemqti | model/Export/Extractor/OntologyExtractorRunner.php | OntologyExtractorRunner.run | public static function run(core_kernel_classes_Resource $item, core_kernel_classes_Property $classProperty)
{
$itemProperty = $item->getProperty($classProperty->getUri());
$labelItemProperty = $itemProperty->getLabel();
$extractor = new OntologyExtractor();
$extractor->addColumn($la... | php | public static function run(core_kernel_classes_Resource $item, core_kernel_classes_Property $classProperty)
{
$itemProperty = $item->getProperty($classProperty->getUri());
$labelItemProperty = $itemProperty->getLabel();
$extractor = new OntologyExtractor();
$extractor->addColumn($la... | [
"public",
"static",
"function",
"run",
"(",
"core_kernel_classes_Resource",
"$",
"item",
",",
"core_kernel_classes_Property",
"$",
"classProperty",
")",
"{",
"$",
"itemProperty",
"=",
"$",
"item",
"->",
"getProperty",
"(",
"$",
"classProperty",
"->",
"getUri",
"("... | @param core_kernel_classes_Resource $item
@param core_kernel_classes_Property $classProperty
@return HashEntry
@throws \oat\taoQtiItem\model\flyExporter\extractor\ExtractorException
@throws \Exception | [
"@param",
"core_kernel_classes_Resource",
"$item",
"@param",
"core_kernel_classes_Property",
"$classProperty"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/Export/Extractor/OntologyExtractorRunner.php#L38-L50 |
oat-sa/extension-tao-itemqti | model/qti/response/interactionResponseProcessing/None.php | None.getRule | public function getRule()
{
$returnValue = (string) '';
$returnValue = 'if(isNull(null, getResponse("'.$this->getResponse()->getIdentifier().'"))) { '.
'setOutcomeValue("'.$this->getOutcome()->getIdentifier().'", '.$this->getDefaultValue().'); };';
return (string... | php | public function getRule()
{
$returnValue = (string) '';
$returnValue = 'if(isNull(null, getResponse("'.$this->getResponse()->getIdentifier().'"))) { '.
'setOutcomeValue("'.$this->getOutcome()->getIdentifier().'", '.$this->getDefaultValue().'); };';
return (string... | [
"public",
"function",
"getRule",
"(",
")",
"{",
"$",
"returnValue",
"=",
"(",
"string",
")",
"''",
";",
"$",
"returnValue",
"=",
"'if(isNull(null, getResponse(\"'",
".",
"$",
"this",
"->",
"getResponse",
"(",
")",
"->",
"getIdentifier",
"(",
")",
".",
"'\"... | Short description of method getRule
@access public
@author Joel Bout, <joel.bout@tudor.lu>
@return string | [
"Short",
"description",
"of",
"method",
"getRule"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/response/interactionResponseProcessing/None.php#L100-L110 |
oat-sa/extension-tao-itemqti | model/qti/response/interactionResponseProcessing/None.php | None.toQTI | public function toQTI()
{
$returnValue = (string) '';
$returnValue = '<responseCondition>
<responseIf>
<isNull>
<variable identifier="'.$this->getResponse()->getIdentifier().'" />
</isNull>
<setOutcomeValue identifier="'.$this->getOutcom... | php | public function toQTI()
{
$returnValue = (string) '';
$returnValue = '<responseCondition>
<responseIf>
<isNull>
<variable identifier="'.$this->getResponse()->getIdentifier().'" />
</isNull>
<setOutcomeValue identifier="'.$this->getOutcom... | [
"public",
"function",
"toQTI",
"(",
")",
"{",
"$",
"returnValue",
"=",
"(",
"string",
")",
"''",
";",
"$",
"returnValue",
"=",
"'<responseCondition>\n\t\t <responseIf>\n\t <isNull>\n\t <variable identifier=\"'",
".",
"$",
"this",
"->",
"getRes... | although no ResponseRules are nescessary to have no responseProcessing,
add some rules to associate the interaction response with a sepcific
@access public
@author Joel Bout, <joel.bout@tudor.lu>
@return string | [
"although",
"no",
"ResponseRules",
"are",
"nescessary",
"to",
"have",
"no",
"responseProcessing",
"add",
"some",
"rules",
"to",
"associate",
"the",
"interaction",
"response",
"with",
"a",
"sepcific"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/response/interactionResponseProcessing/None.php#L120-L138 |
oat-sa/extension-tao-itemqti | model/QtiCreatorClientConfigRegistry.php | QtiCreatorClientConfigRegistry.getPlugins | public function getPlugins(){
$config = [];
$registry = self::getRegistry();
if ($registry->isRegistered(self::CREATOR)) {
$config = $registry->get(self::CREATOR);
}
if (!isset($config['plugins'])) {
return [];
}
return $config['plugins'... | php | public function getPlugins(){
$config = [];
$registry = self::getRegistry();
if ($registry->isRegistered(self::CREATOR)) {
$config = $registry->get(self::CREATOR);
}
if (!isset($config['plugins'])) {
return [];
}
return $config['plugins'... | [
"public",
"function",
"getPlugins",
"(",
")",
"{",
"$",
"config",
"=",
"[",
"]",
";",
"$",
"registry",
"=",
"self",
"::",
"getRegistry",
"(",
")",
";",
"if",
"(",
"$",
"registry",
"->",
"isRegistered",
"(",
"self",
"::",
"CREATOR",
")",
")",
"{",
"... | Quick access to the plugins
@return array the registered plugins | [
"Quick",
"access",
"to",
"the",
"plugins"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/QtiCreatorClientConfigRegistry.php#L123-L136 |
oat-sa/extension-tao-itemqti | model/flyExporter/extractor/OntologyExtractor.php | OntologyExtractor.addColumn | public function addColumn($column, array $config)
{
if (!isset($config['property'])) {
throw new ExtractorException('Property config is missing.');
}
$property = new \core_kernel_classes_Property($config['property']);
if (!$property->exists()) {
throw new Ext... | php | public function addColumn($column, array $config)
{
if (!isset($config['property'])) {
throw new ExtractorException('Property config is missing.');
}
$property = new \core_kernel_classes_Property($config['property']);
if (!$property->exists()) {
throw new Ext... | [
"public",
"function",
"addColumn",
"(",
"$",
"column",
",",
"array",
"$",
"config",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"config",
"[",
"'property'",
"]",
")",
")",
"{",
"throw",
"new",
"ExtractorException",
"(",
"'Property config is missing.'",
")... | Add column to export
Check if core_kernel_classes_Property exists into $config
@param $column
@param array $config
@throws ExtractorException
@return Extractor $this | [
"Add",
"column",
"to",
"export",
"Check",
"if",
"core_kernel_classes_Property",
"exists",
"into",
"$config"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/flyExporter/extractor/OntologyExtractor.php#L70-L84 |
oat-sa/extension-tao-itemqti | model/flyExporter/extractor/OntologyExtractor.php | OntologyExtractor.run | public function run()
{
$this->data = [];
if (empty($this->item) || !($this->item instanceof \core_kernel_classes_Resource)) {
throw new ExtractorException('Export item not set.');
}
$properties = [];
foreach ($this->columns as $config) {
$properties... | php | public function run()
{
$this->data = [];
if (empty($this->item) || !($this->item instanceof \core_kernel_classes_Resource)) {
throw new ExtractorException('Export item not set.');
}
$properties = [];
foreach ($this->columns as $config) {
$properties... | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"this",
"->",
"data",
"=",
"[",
"]",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"item",
")",
"||",
"!",
"(",
"$",
"this",
"->",
"item",
"instanceof",
"\\",
"core_kernel_classes_Resource",
")",
... | Get ontology values of requested item properties
@return $this
@throws \Exception | [
"Get",
"ontology",
"values",
"of",
"requested",
"item",
"properties"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/flyExporter/extractor/OntologyExtractor.php#L92-L136 |
oat-sa/extension-tao-itemqti | model/portableElement/parser/element/PortableElementPackageParser.php | PortableElementPackageParser.validate | public function validate($source)
{
try {
$this->assertSourceAsFile($source);
if (! QtiPackage::isValidZip($source)) {
throw new PortableElementParserException('Source package is not a valid zip.');
}
} catch (common_Exception $e) {
th... | php | public function validate($source)
{
try {
$this->assertSourceAsFile($source);
if (! QtiPackage::isValidZip($source)) {
throw new PortableElementParserException('Source package is not a valid zip.');
}
} catch (common_Exception $e) {
th... | [
"public",
"function",
"validate",
"(",
"$",
"source",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"assertSourceAsFile",
"(",
"$",
"source",
")",
";",
"if",
"(",
"!",
"QtiPackage",
"::",
"isValidZip",
"(",
"$",
"source",
")",
")",
"{",
"throw",
"new",
"P... | Validate the zip package
@param string $source Zip package location to validate
@return bool
@throws PortableElementException
@throws PortableElementParserException
@throws PortableElementInconsistencyModelException | [
"Validate",
"the",
"zip",
"package"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/portableElement/parser/element/PortableElementPackageParser.php#L53-L81 |
oat-sa/extension-tao-itemqti | model/portableElement/parser/element/PortableElementPackageParser.php | PortableElementPackageParser.extract | public function extract($source)
{
$tmpDirectory = null;
$this->assertSourceAsFile($source);
$folder = \tao_helpers_File::createTempDir();
$zip = new ZipArchive();
if ($zip->open($source) === true) {
if (\tao_helpers_File::checkWhetherArchiveIsBomb($zip)) {
... | php | public function extract($source)
{
$tmpDirectory = null;
$this->assertSourceAsFile($source);
$folder = \tao_helpers_File::createTempDir();
$zip = new ZipArchive();
if ($zip->open($source) === true) {
if (\tao_helpers_File::checkWhetherArchiveIsBomb($zip)) {
... | [
"public",
"function",
"extract",
"(",
"$",
"source",
")",
"{",
"$",
"tmpDirectory",
"=",
"null",
";",
"$",
"this",
"->",
"assertSourceAsFile",
"(",
"$",
"source",
")",
";",
"$",
"folder",
"=",
"\\",
"tao_helpers_File",
"::",
"createTempDir",
"(",
")",
";... | Extract zip package into temp directory
@param string $source Zip path
@return string Tmp directory to find extracted zip
@throws PortableElementExtractException
@throws common_Exception | [
"Extract",
"zip",
"package",
"into",
"temp",
"directory"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/portableElement/parser/element/PortableElementPackageParser.php#L91-L113 |
oat-sa/extension-tao-itemqti | model/portableElement/parser/element/PortableElementPackageParser.php | PortableElementPackageParser.getManifestContent | public function getManifestContent($source)
{
$zip = new ZipArchive();
if($zip->open($source) === false ) {
throw new PortableElementParserException('Unable to open the ZIP file located at: ' . $source);
}
$manifestName = $this->getModel()->getManifestName();
if ... | php | public function getManifestContent($source)
{
$zip = new ZipArchive();
if($zip->open($source) === false ) {
throw new PortableElementParserException('Unable to open the ZIP file located at: ' . $source);
}
$manifestName = $this->getModel()->getManifestName();
if ... | [
"public",
"function",
"getManifestContent",
"(",
"$",
"source",
")",
"{",
"$",
"zip",
"=",
"new",
"ZipArchive",
"(",
")",
";",
"if",
"(",
"$",
"zip",
"->",
"open",
"(",
"$",
"source",
")",
"===",
"false",
")",
"{",
"throw",
"new",
"PortableElementParse... | Extract JSON representation of $source package e.q. Manifest
@param string $source Zip path
@return string JSON representation of $this->source
@throws PortableElementException
@throws PortableElementParserException | [
"Extract",
"JSON",
"representation",
"of",
"$source",
"package",
"e",
".",
"q",
".",
"Manifest"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/portableElement/parser/element/PortableElementPackageParser.php#L123-L149 |
oat-sa/extension-tao-itemqti | model/qti/expression/ExpressionParserFactory.php | ExpressionParserFactory.build | public static function build( SimpleXMLElement $data)
{
$returnValue = null;
$expression = null;
$expressionName = $data->getName();
//retrieve the expression attributes
$attributes = array();
foreach($data->attributes() as $key => $value){
... | php | public static function build( SimpleXMLElement $data)
{
$returnValue = null;
$expression = null;
$expressionName = $data->getName();
//retrieve the expression attributes
$attributes = array();
foreach($data->attributes() as $key => $value){
... | [
"public",
"static",
"function",
"build",
"(",
"SimpleXMLElement",
"$",
"data",
")",
"{",
"$",
"returnValue",
"=",
"null",
";",
"$",
"expression",
"=",
"null",
";",
"$",
"expressionName",
"=",
"$",
"data",
"->",
"getName",
"(",
")",
";",
"//retrieve the exp... | Short description of method build
@access public
@author Joel Bout, <joel.bout@tudor.lu>
@param SimpleXMLElement data
@return oat\taoQtiItem\model\qti\expression\Expression | [
"Short",
"description",
"of",
"method",
"build"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/expression/ExpressionParserFactory.php#L52-L94 |
oat-sa/extension-tao-itemqti | model/qti/Tooltip.php | Tooltip.getTemplateQtiVariables | protected function getTemplateQtiVariables(){
// this is necessary because the QTI template gets a serialized string for attributes and cannot address a specific attribute
$tooltipId = $this->getAttributeValue('aria-describedby');
$variables = parent::getTemplateQtiVariables();
$variabl... | php | protected function getTemplateQtiVariables(){
// this is necessary because the QTI template gets a serialized string for attributes and cannot address a specific attribute
$tooltipId = $this->getAttributeValue('aria-describedby');
$variables = parent::getTemplateQtiVariables();
$variabl... | [
"protected",
"function",
"getTemplateQtiVariables",
"(",
")",
"{",
"// this is necessary because the QTI template gets a serialized string for attributes and cannot address a specific attribute",
"$",
"tooltipId",
"=",
"$",
"this",
"->",
"getAttributeValue",
"(",
"'aria-describedby'",
... | Add tooltip id & content to template variables | [
"Add",
"tooltip",
"id",
"&",
"content",
"to",
"template",
"variables"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/Tooltip.php#L69-L77 |
oat-sa/extension-tao-itemqti | model/qti/Value.php | Value.toArray | public function toArray($filterVariableContent = false, &$filtered = array())
{
return [
'value' => $this->value,
'fieldIdentifier' => (string) $this->getAttribute('fieldIdentifier'),
'baseType' => (string) $this->getAttribute('baseType'),
'cardinality' => 'si... | php | public function toArray($filterVariableContent = false, &$filtered = array())
{
return [
'value' => $this->value,
'fieldIdentifier' => (string) $this->getAttribute('fieldIdentifier'),
'baseType' => (string) $this->getAttribute('baseType'),
'cardinality' => 'si... | [
"public",
"function",
"toArray",
"(",
"$",
"filterVariableContent",
"=",
"false",
",",
"&",
"$",
"filtered",
"=",
"array",
"(",
")",
")",
"{",
"return",
"[",
"'value'",
"=>",
"$",
"this",
"->",
"value",
",",
"'fieldIdentifier'",
"=>",
"(",
"string",
")",... | Get the array representation of the Qti Element.
Particularly helpful for data transformation, e.g. json
@param bool $filterVariableContent
@param array $filtered
@return array | [
"Get",
"the",
"array",
"representation",
"of",
"the",
"Qti",
"Element",
".",
"Particularly",
"helpful",
"for",
"data",
"transformation",
"e",
".",
"g",
".",
"json"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/Value.php#L88-L96 |
oat-sa/extension-tao-itemqti | controller/AbstractPortableElementManager.php | AbstractPortableElementManager.getFile | public function getFile()
{
if ($this->hasRequestParameter('file')) {
$file = urldecode($this->getRequestParameter('file'));
$filePathTokens = explode('/', $file);
$typeIdentifier = array_shift($filePathTokens);
$relPath = implode(DIRECTORY_SEPARATOR, $filePat... | php | public function getFile()
{
if ($this->hasRequestParameter('file')) {
$file = urldecode($this->getRequestParameter('file'));
$filePathTokens = explode('/', $file);
$typeIdentifier = array_shift($filePathTokens);
$relPath = implode(DIRECTORY_SEPARATOR, $filePat... | [
"public",
"function",
"getFile",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasRequestParameter",
"(",
"'file'",
")",
")",
"{",
"$",
"file",
"=",
"urldecode",
"(",
"$",
"this",
"->",
"getRequestParameter",
"(",
"'file'",
")",
")",
";",
"$",
"filePat... | Get a file of a custom interaction | [
"Get",
"a",
"file",
"of",
"a",
"custom",
"interaction"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/controller/AbstractPortableElementManager.php#L57-L66 |
oat-sa/extension-tao-itemqti | controller/AbstractPortableElementManager.php | AbstractPortableElementManager.renderFile | private function renderFile($typeIdentifier, $relPath)
{
if (tao_helpers_File::securityCheck($relPath, true)) {
$folder = $this->getImplementationDirectory($typeIdentifier);
$filename = $folder.$relPath;
//@todo : find better way to to this
//load... | php | private function renderFile($typeIdentifier, $relPath)
{
if (tao_helpers_File::securityCheck($relPath, true)) {
$folder = $this->getImplementationDirectory($typeIdentifier);
$filename = $folder.$relPath;
//@todo : find better way to to this
//load... | [
"private",
"function",
"renderFile",
"(",
"$",
"typeIdentifier",
",",
"$",
"relPath",
")",
"{",
"if",
"(",
"tao_helpers_File",
"::",
"securityCheck",
"(",
"$",
"relPath",
",",
"true",
")",
")",
"{",
"$",
"folder",
"=",
"$",
"this",
"->",
"getImplementation... | Render the file to the browser
@param string $typeIdentifier
@param string $relPath
@throws common_exception_Error | [
"Render",
"the",
"file",
"to",
"the",
"browser"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/controller/AbstractPortableElementManager.php#L86-L101 |
oat-sa/extension-tao-itemqti | model/qti/PackageParser.php | PackageParser.validate | public function validate($schema = '')
{
$forced = $this->valid;
$this->valid = true;
try{
switch($this->sourceType){
case self::SOURCE_FILE:
//check file
if(!file_exists($this->source)){
throw new Exception("File {$this->sourc... | php | public function validate($schema = '')
{
$forced = $this->valid;
$this->valid = true;
try{
switch($this->sourceType){
case self::SOURCE_FILE:
//check file
if(!file_exists($this->source)){
throw new Exception("File {$this->sourc... | [
"public",
"function",
"validate",
"(",
"$",
"schema",
"=",
"''",
")",
"{",
"$",
"forced",
"=",
"$",
"this",
"->",
"valid",
";",
"$",
"this",
"->",
"valid",
"=",
"true",
";",
"try",
"{",
"switch",
"(",
"$",
"this",
"->",
"sourceType",
")",
"{",
"c... | Short description of method validate
@access public
@author Jerome Bogaerts, <jerome.bogaerts@tudor.lu>
@param string schema
@throws Exception if file or archive is not valid
@return boolean | [
"Short",
"description",
"of",
"method",
"validate"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/PackageParser.php#L56-L146 |
oat-sa/extension-tao-itemqti | model/qti/PackageParser.php | PackageParser.extract | public function extract()
{
if ($this->extracted === null) {
if ($this->source instanceof File) {
$archiveFolder = tao_helpers_File::createTempDir();
if (!is_dir($archiveFolder)) {
mkdir($archiveFolder);
}
$filen... | php | public function extract()
{
if ($this->extracted === null) {
if ($this->source instanceof File) {
$archiveFolder = tao_helpers_File::createTempDir();
if (!is_dir($archiveFolder)) {
mkdir($archiveFolder);
}
$filen... | [
"public",
"function",
"extract",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"extracted",
"===",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"source",
"instanceof",
"File",
")",
"{",
"$",
"archiveFolder",
"=",
"tao_helpers_File",
"::",
"createTempDi... | Short description of method extract
@access public
@throws \common_exception_Error
@throws \common_exception
@author Jerome Bogaerts, <jerome.bogaerts@tudor.lu>
@return string|null | [
"Short",
"description",
"of",
"method",
"extract"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/PackageParser.php#L157-L192 |
oat-sa/extension-tao-itemqti | model/update/ItemUpdater.php | ItemUpdater.update | public function update($changeItemContent = false)
{
$returnValue = array();
$objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->itemPath), RecursiveIteratorIterator::SELF_FIRST);
$i = 0;
$fixed = 0;
foreach ($objects as $itemFile => $c... | php | public function update($changeItemContent = false)
{
$returnValue = array();
$objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->itemPath), RecursiveIteratorIterator::SELF_FIRST);
$i = 0;
$fixed = 0;
foreach ($objects as $itemFile => $c... | [
"public",
"function",
"update",
"(",
"$",
"changeItemContent",
"=",
"false",
")",
"{",
"$",
"returnValue",
"=",
"array",
"(",
")",
";",
"$",
"objects",
"=",
"new",
"RecursiveIteratorIterator",
"(",
"new",
"RecursiveDirectoryIterator",
"(",
"$",
"this",
"->",
... | Update all the item files found within the $itemRootPath
@param boolean $changeItemContent - tells if the item files will be written with the updated content or not
@return array of modified item instances | [
"Update",
"all",
"the",
"item",
"files",
"found",
"within",
"the",
"$itemRootPath"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/update/ItemUpdater.php#L52-L91 |
oat-sa/extension-tao-itemqti | model/qti/ResponseDeclaration.php | ResponseDeclaration.getMapping | public function getMapping($type = ''){
$returnValue = array();
if($type == 'area'){
$returnValue = $this->areaMapping;
}else{
$returnValue = $this->mapping;
}
return (array) $returnValue;
} | php | public function getMapping($type = ''){
$returnValue = array();
if($type == 'area'){
$returnValue = $this->areaMapping;
}else{
$returnValue = $this->mapping;
}
return (array) $returnValue;
} | [
"public",
"function",
"getMapping",
"(",
"$",
"type",
"=",
"''",
")",
"{",
"$",
"returnValue",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"type",
"==",
"'area'",
")",
"{",
"$",
"returnValue",
"=",
"$",
"this",
"->",
"areaMapping",
";",
"}",
"else... | Short description of method getMapping
@access public
@author Joel Bout, <joel.bout@tudor.lu>
@param string type
@return array | [
"Short",
"description",
"of",
"method",
"getMapping"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/ResponseDeclaration.php#L238-L248 |
oat-sa/extension-tao-itemqti | model/qti/ResponseDeclaration.php | ResponseDeclaration.setMapping | public function setMapping($map, $type = ''){
if($type == 'area'){
$this->areaMapping = $map;
}else{
$this->mapping = $map;
}
} | php | public function setMapping($map, $type = ''){
if($type == 'area'){
$this->areaMapping = $map;
}else{
$this->mapping = $map;
}
} | [
"public",
"function",
"setMapping",
"(",
"$",
"map",
",",
"$",
"type",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"'area'",
")",
"{",
"$",
"this",
"->",
"areaMapping",
"=",
"$",
"map",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"mapping",
... | Short description of method setMapping
@access public
@author Joel Bout, <joel.bout@tudor.lu>
@param array map
@param type
@return mixed | [
"Short",
"description",
"of",
"method",
"setMapping"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/ResponseDeclaration.php#L259-L265 |
oat-sa/extension-tao-itemqti | model/qti/ResponseDeclaration.php | ResponseDeclaration.correctToJSON | public function correctToJSON(){
$returnValue = null;
try{
$correctResponses = $this->getCorrectResponses();
if(count($correctResponses)){
$returnValue = taoQTI_models_classes_Matching_VariableFactory::createJSONVariableFromQTIData(
$this->get... | php | public function correctToJSON(){
$returnValue = null;
try{
$correctResponses = $this->getCorrectResponses();
if(count($correctResponses)){
$returnValue = taoQTI_models_classes_Matching_VariableFactory::createJSONVariableFromQTIData(
$this->get... | [
"public",
"function",
"correctToJSON",
"(",
")",
"{",
"$",
"returnValue",
"=",
"null",
";",
"try",
"{",
"$",
"correctResponses",
"=",
"$",
"this",
"->",
"getCorrectResponses",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"correctResponses",
")",
")",
"{"... | get the correct response in JSON format. If no correct response defined
null.
@deprecated now use the new qtism lib for response evaluation
@access public
@author Joel Bout, <joel.bout@tudor.lu> | [
"get",
"the",
"correct",
"response",
"in",
"JSON",
"format",
".",
"If",
"no",
"correct",
"response",
"defined",
"null",
"."
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/ResponseDeclaration.php#L302-L320 |
oat-sa/extension-tao-itemqti | model/qti/ResponseDeclaration.php | ResponseDeclaration.areaMapToJson | public function areaMapToJson(){
$returnValue = null;
// Get the stored area mapping
$mapping = $this->getMapping('area');
if(count($mapping)){
$returnValue = Array();
$returnValue['identifier'] = $this->getIdentifier();
$returnValue['defaultValue'] ... | php | public function areaMapToJson(){
$returnValue = null;
// Get the stored area mapping
$mapping = $this->getMapping('area');
if(count($mapping)){
$returnValue = Array();
$returnValue['identifier'] = $this->getIdentifier();
$returnValue['defaultValue'] ... | [
"public",
"function",
"areaMapToJson",
"(",
")",
"{",
"$",
"returnValue",
"=",
"null",
";",
"// Get the stored area mapping",
"$",
"mapping",
"=",
"$",
"this",
"->",
"getMapping",
"(",
"'area'",
")",
";",
"if",
"(",
"count",
"(",
"$",
"mapping",
")",
")",
... | Short description of method areaMapToJson
@deprecated now use the new qtism lib for response evaluation
@access public
@author Joel Bout, <joel.bout@tudor.lu> | [
"Short",
"description",
"of",
"method",
"areaMapToJson"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/ResponseDeclaration.php#L329-L359 |
oat-sa/extension-tao-itemqti | model/qti/ResponseDeclaration.php | ResponseDeclaration.mapToJSON | public function mapToJSON(){
$returnValue = null;
$mapping = $this->getMapping();
if(count($mapping)){
$returnValue = Array();
$returnValue['identifier'] = $this->getIdentifier();
$returnValue['defaultValue'] = $this->mappingDefaultValue;
if($this... | php | public function mapToJSON(){
$returnValue = null;
$mapping = $this->getMapping();
if(count($mapping)){
$returnValue = Array();
$returnValue['identifier'] = $this->getIdentifier();
$returnValue['defaultValue'] = $this->mappingDefaultValue;
if($this... | [
"public",
"function",
"mapToJSON",
"(",
")",
"{",
"$",
"returnValue",
"=",
"null",
";",
"$",
"mapping",
"=",
"$",
"this",
"->",
"getMapping",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"mapping",
")",
")",
"{",
"$",
"returnValue",
"=",
"Array",
"... | get the mapping in JSON format. If no mapping defined return null.
@deprecated now use the new qtism lib for response evaluation
@access public
@author Joel Bout, <joel.bout@tudor.lu> | [
"get",
"the",
"mapping",
"in",
"JSON",
"format",
".",
"If",
"no",
"mapping",
"defined",
"return",
"null",
"."
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/ResponseDeclaration.php#L368-L397 |
oat-sa/extension-tao-itemqti | model/qti/ResponseDeclaration.php | ResponseDeclaration.toForm | public function toForm(){
$returnValue = null;
$interaction = $this->getAssociatedInteraction();
if($interaction instanceof Interaction){
$responseFormClass = '\\oat\\taoQtiItem\\controller\\QTIform\\response\\'.ucfirst(strtolower($interaction->getType())).'Interaction';
... | php | public function toForm(){
$returnValue = null;
$interaction = $this->getAssociatedInteraction();
if($interaction instanceof Interaction){
$responseFormClass = '\\oat\\taoQtiItem\\controller\\QTIform\\response\\'.ucfirst(strtolower($interaction->getType())).'Interaction';
... | [
"public",
"function",
"toForm",
"(",
")",
"{",
"$",
"returnValue",
"=",
"null",
";",
"$",
"interaction",
"=",
"$",
"this",
"->",
"getAssociatedInteraction",
"(",
")",
";",
"if",
"(",
"$",
"interaction",
"instanceof",
"Interaction",
")",
"{",
"$",
"response... | Short description of method toForm
@access public
@author Joel Bout, <joel.bout@tudor.lu>
@return tao_helpers_form_xhtml_Form | [
"Short",
"description",
"of",
"method",
"toForm"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/ResponseDeclaration.php#L455-L471 |
oat-sa/extension-tao-itemqti | helpers/Authoring.php | Authoring.validateQtiXml | public static function validateQtiXml($qti)
{
$dom = self::loadQtiXml($qti);
$returnValue = $dom->saveXML();
$parserValidator = new Parser($returnValue);
$parserValidator->validate();
if(!$parserValidator->isValid()) {
common_Logger::w('Invalid QTI outpu... | php | public static function validateQtiXml($qti)
{
$dom = self::loadQtiXml($qti);
$returnValue = $dom->saveXML();
$parserValidator = new Parser($returnValue);
$parserValidator->validate();
if(!$parserValidator->isValid()) {
common_Logger::w('Invalid QTI outpu... | [
"public",
"static",
"function",
"validateQtiXml",
"(",
"$",
"qti",
")",
"{",
"$",
"dom",
"=",
"self",
"::",
"loadQtiXml",
"(",
"$",
"qti",
")",
";",
"$",
"returnValue",
"=",
"$",
"dom",
"->",
"saveXML",
"(",
")",
";",
"$",
"parserValidator",
"=",
"ne... | Validate a QTI XML string.
@param string $qti File path or XML string
@throws QtiModelException | [
"Validate",
"a",
"QTI",
"XML",
"string",
"."
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/helpers/Authoring.php#L51-L63 |
oat-sa/extension-tao-itemqti | helpers/Authoring.php | Authoring.checkEmptyMedia | public static function checkEmptyMedia($qti){
$doc = new DOMDocument();
$doc->loadHTML(self::loadQtiXml($qti)->saveXML());
$imgs = $doc->getElementsByTagName('img');
foreach ($imgs as $img) {
if(empty($img->getAttribute('src'))){
throw new QtiModelException('... | php | public static function checkEmptyMedia($qti){
$doc = new DOMDocument();
$doc->loadHTML(self::loadQtiXml($qti)->saveXML());
$imgs = $doc->getElementsByTagName('img');
foreach ($imgs as $img) {
if(empty($img->getAttribute('src'))){
throw new QtiModelException('... | [
"public",
"static",
"function",
"checkEmptyMedia",
"(",
"$",
"qti",
")",
"{",
"$",
"doc",
"=",
"new",
"DOMDocument",
"(",
")",
";",
"$",
"doc",
"->",
"loadHTML",
"(",
"self",
"::",
"loadQtiXml",
"(",
"$",
"qti",
")",
"->",
"saveXML",
"(",
")",
")",
... | Simple function to check if the item is not missing any of the required asset configuration path
@param string $qti
@throws QtiModelException
@throws common_exception_Error | [
"Simple",
"function",
"to",
"check",
"if",
"the",
"item",
"is",
"not",
"missing",
"any",
"of",
"the",
"required",
"asset",
"configuration",
"path"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/helpers/Authoring.php#L71-L95 |
oat-sa/extension-tao-itemqti | helpers/Authoring.php | Authoring.addRequiredResources | public static function addRequiredResources($sourceDirectory, $relativeSourceFiles, $prefix, core_kernel_classes_Resource $item, $lang)
{
$returnValue = array();
$directory = taoItems_models_classes_ItemsService::singleton()->getItemDirectory($item, $lang);
foreach ($relativeSourc... | php | public static function addRequiredResources($sourceDirectory, $relativeSourceFiles, $prefix, core_kernel_classes_Resource $item, $lang)
{
$returnValue = array();
$directory = taoItems_models_classes_ItemsService::singleton()->getItemDirectory($item, $lang);
foreach ($relativeSourc... | [
"public",
"static",
"function",
"addRequiredResources",
"(",
"$",
"sourceDirectory",
",",
"$",
"relativeSourceFiles",
",",
"$",
"prefix",
",",
"core_kernel_classes_Resource",
"$",
"item",
",",
"$",
"lang",
")",
"{",
"$",
"returnValue",
"=",
"array",
"(",
")",
... | Add a list of required resources files to an RDF item and keeps the relative path structure
For instances, required css, js etc.
@param string $sourceDirectory
@param array $relativeSourceFiles
@param core_kernel_classes_Resource $item
@param string $lang
@return array
@throws common_exception_Error | [
"Add",
"a",
"list",
"of",
"required",
"resources",
"files",
"to",
"an",
"RDF",
"item",
"and",
"keeps",
"the",
"relative",
"path",
"structure",
"For",
"instances",
"required",
"css",
"js",
"etc",
"."
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/helpers/Authoring.php#L108-L142 |
oat-sa/extension-tao-itemqti | helpers/Authoring.php | Authoring.sanitizeQtiXml | public static function sanitizeQtiXml($qti)
{
$doc = self::loadQtiXml($qti);
$xpath = new \DOMXpath($doc);
foreach ($xpath->query("//*[local-name() = 'itemBody']//*[@style]") as $elementWithStyle) {
$elementWithStyle->removeAttribute('style');
}
... | php | public static function sanitizeQtiXml($qti)
{
$doc = self::loadQtiXml($qti);
$xpath = new \DOMXpath($doc);
foreach ($xpath->query("//*[local-name() = 'itemBody']//*[@style]") as $elementWithStyle) {
$elementWithStyle->removeAttribute('style');
}
... | [
"public",
"static",
"function",
"sanitizeQtiXml",
"(",
"$",
"qti",
")",
"{",
"$",
"doc",
"=",
"self",
"::",
"loadQtiXml",
"(",
"$",
"qti",
")",
";",
"$",
"xpath",
"=",
"new",
"\\",
"DOMXpath",
"(",
"$",
"doc",
")",
";",
"foreach",
"(",
"$",
"xpath"... | Remove invalid elements and attributes from QTI XML.
@param string $qti File path or XML string
@return string sanitized XML | [
"Remove",
"invalid",
"elements",
"and",
"attributes",
"from",
"QTI",
"XML",
"."
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/helpers/Authoring.php#L149-L171 |
oat-sa/extension-tao-itemqti | helpers/Authoring.php | Authoring.loadQtiXml | public static function loadQtiXml($file)
{
if ($file instanceof File) {
$qti = $file->read();
} else if (preg_match("/^<\?xml(.*)?/m", trim($file))) {
$qti = $file;
} else if (is_file($file)) {
$qti = file_get_contents($file);
} else {
... | php | public static function loadQtiXml($file)
{
if ($file instanceof File) {
$qti = $file->read();
} else if (preg_match("/^<\?xml(.*)?/m", trim($file))) {
$qti = $file;
} else if (is_file($file)) {
$qti = file_get_contents($file);
} else {
... | [
"public",
"static",
"function",
"loadQtiXml",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"$",
"file",
"instanceof",
"File",
")",
"{",
"$",
"qti",
"=",
"$",
"file",
"->",
"read",
"(",
")",
";",
"}",
"else",
"if",
"(",
"preg_match",
"(",
"\"/^<\\?xml(.*)?/... | Load QTI xml and return DOMDocument instance.
If string is not valid xml then QtiModelException will be thrown.
@param string|File $file If it's a string it can be a file path or an XML string
@throws QtiModelException
@throws common_exception_Error
@return DOMDocument | [
"Load",
"QTI",
"xml",
"and",
"return",
"DOMDocument",
"instance",
".",
"If",
"string",
"is",
"not",
"valid",
"xml",
"then",
"QtiModelException",
"will",
"be",
"thrown",
"."
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/helpers/Authoring.php#L182-L228 |
oat-sa/extension-tao-itemqti | model/qti/response/SetOutcomeVariable.php | SetOutcomeVariable.getRule | public function getRule()
{
$returnValue = (string) '';
$returnValue = 'setOutcomeValue("'.$this->outcomeVariableIdentifier.'", '.$this->expression->getRule().');';
return (string) $returnValue;
} | php | public function getRule()
{
$returnValue = (string) '';
$returnValue = 'setOutcomeValue("'.$this->outcomeVariableIdentifier.'", '.$this->expression->getRule().');';
return (string) $returnValue;
} | [
"public",
"function",
"getRule",
"(",
")",
"{",
"$",
"returnValue",
"=",
"(",
"string",
")",
"''",
";",
"$",
"returnValue",
"=",
"'setOutcomeValue(\"'",
".",
"$",
"this",
"->",
"outcomeVariableIdentifier",
".",
"'\", '",
".",
"$",
"this",
"->",
"expression",... | Short description of method getRule
@access public
@author Joel Bout, <joel.bout@tudor.lu>
@return string | [
"Short",
"description",
"of",
"method",
"getRule"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/response/SetOutcomeVariable.php#L85-L94 |
oat-sa/extension-tao-itemqti | model/qti/response/Summation.php | Summation.getCompositionRules | public function getCompositionRules()
{
$subExpressions = array();
foreach ($this->components as $irp) {
$subExpressions[] = new CommonExpression('variable', array('identifier' => $irp->getOutcome()->getIdentifier()));
}
$sum = new CommonExpression('sum', array());
$... | php | public function getCompositionRules()
{
$subExpressions = array();
foreach ($this->components as $irp) {
$subExpressions[] = new CommonExpression('variable', array('identifier' => $irp->getOutcome()->getIdentifier()));
}
$sum = new CommonExpression('sum', array());
$... | [
"public",
"function",
"getCompositionRules",
"(",
")",
"{",
"$",
"subExpressions",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"components",
"as",
"$",
"irp",
")",
"{",
"$",
"subExpressions",
"[",
"]",
"=",
"new",
"CommonExpression",
... | Short description of method getCompositionRules
@access public
@author Joel Bout, <joel.bout@tudor.lu>
@return array | [
"Short",
"description",
"of",
"method",
"getCompositionRules"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/response/Summation.php#L48-L61 |
oat-sa/extension-tao-itemqti | model/qti/response/Summation.php | Summation.getCompositionQTI | public function getCompositionQTI()
{
$returnValue = (string) '';
$returnValue .= '<setOutcomeValue identifier="'.$this->outcomeIdentifier.'"><sum>';
foreach ($this->components as $irp) {
$returnValue .= '<variable identifier="'.$irp->getOutcome()->getIdentifier().'" />';
}... | php | public function getCompositionQTI()
{
$returnValue = (string) '';
$returnValue .= '<setOutcomeValue identifier="'.$this->outcomeIdentifier.'"><sum>';
foreach ($this->components as $irp) {
$returnValue .= '<variable identifier="'.$irp->getOutcome()->getIdentifier().'" />';
}... | [
"public",
"function",
"getCompositionQTI",
"(",
")",
"{",
"$",
"returnValue",
"=",
"(",
"string",
")",
"''",
";",
"$",
"returnValue",
".=",
"'<setOutcomeValue identifier=\"'",
".",
"$",
"this",
"->",
"outcomeIdentifier",
".",
"'\"><sum>'",
";",
"foreach",
"(",
... | Short description of method getCompositionQTI
@access public
@author Joel Bout, <joel.bout@tudor.lu>
@return string | [
"Short",
"description",
"of",
"method",
"getCompositionQTI"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/response/Summation.php#L70-L81 |
oat-sa/extension-tao-itemqti | model/qti/XIncludeLoader.php | XIncludeLoader.load | public function load($removeUnfoundHref = false){
$xincludes = $this->getXIncludes();
//load xincludes in standard element
foreach($xincludes as $xinclude){
//retrive the xinclude from href
$href = $xinclude->attr('href');
if(!empty($href)){
... | php | public function load($removeUnfoundHref = false){
$xincludes = $this->getXIncludes();
//load xincludes in standard element
foreach($xincludes as $xinclude){
//retrive the xinclude from href
$href = $xinclude->attr('href');
if(!empty($href)){
... | [
"public",
"function",
"load",
"(",
"$",
"removeUnfoundHref",
"=",
"false",
")",
"{",
"$",
"xincludes",
"=",
"$",
"this",
"->",
"getXIncludes",
"(",
")",
";",
"//load xincludes in standard element",
"foreach",
"(",
"$",
"xincludes",
"as",
"$",
"xinclude",
")",
... | Load parse the item and resolve all xinclude
@param boolean $removeUnfoundHref
@return array
@throws XIncludeException when the href cannot be resolved | [
"Load",
"parse",
"the",
"item",
"and",
"resolve",
"all",
"xinclude"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/XIncludeLoader.php#L58-L88 |
oat-sa/extension-tao-itemqti | model/qti/XIncludeLoader.php | XIncludeLoader.parseCustomElementMarkup | private function parseCustomElementMarkup(CustomInteraction $customElement){
$xincludes = array();
$xml = new DOMDocument();
$xml->formatOutput = true;
$loadSuccess = $xml->loadXML($customElement->getMarkup());
$node = $xml->documentElement;
if($loadSucc... | php | private function parseCustomElementMarkup(CustomInteraction $customElement){
$xincludes = array();
$xml = new DOMDocument();
$xml->formatOutput = true;
$loadSuccess = $xml->loadXML($customElement->getMarkup());
$node = $xml->documentElement;
if($loadSucc... | [
"private",
"function",
"parseCustomElementMarkup",
"(",
"CustomInteraction",
"$",
"customElement",
")",
"{",
"$",
"xincludes",
"=",
"array",
"(",
")",
";",
"$",
"xml",
"=",
"new",
"DOMDocument",
"(",
")",
";",
"$",
"xml",
"->",
"formatOutput",
"=",
"true",
... | Parse and load xinclude located in custom element markup
@param CustomInteraction $customElement
@return array
@throws XIncludeException when the file in href cannot be resolved
@throws ParsingException when the markup cannot be loaded as xml document | [
"Parse",
"and",
"load",
"xinclude",
"located",
"in",
"custom",
"element",
"markup"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/XIncludeLoader.php#L98-L135 |
oat-sa/extension-tao-itemqti | model/qti/XIncludeLoader.php | XIncludeLoader.loadXInclude | private function loadXInclude(XInclude $xinclude, $filePath){
//load DOMDocument
$xml = new DOMDocument();
$loadSuccess = $xml->load($filePath);
$node = $xml->documentElement;
if($loadSuccess && !is_null($node)){
//parse the href content
$parser = new Pars... | php | private function loadXInclude(XInclude $xinclude, $filePath){
//load DOMDocument
$xml = new DOMDocument();
$loadSuccess = $xml->load($filePath);
$node = $xml->documentElement;
if($loadSuccess && !is_null($node)){
//parse the href content
$parser = new Pars... | [
"private",
"function",
"loadXInclude",
"(",
"XInclude",
"$",
"xinclude",
",",
"$",
"filePath",
")",
"{",
"//load DOMDocument",
"$",
"xml",
"=",
"new",
"DOMDocument",
"(",
")",
";",
"$",
"loadSuccess",
"=",
"$",
"xml",
"->",
"load",
"(",
"$",
"filePath",
... | load an xml string into the body of the XInclude
@param \oat\taoQtiItem\model\qti\XInclude $xinclude
@param string $filePath
@throws XIncludeException | [
"load",
"an",
"xml",
"string",
"into",
"the",
"body",
"of",
"the",
"XInclude"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/XIncludeLoader.php#L144-L156 |
oat-sa/extension-tao-itemqti | model/qti/XIncludeLoader.php | XIncludeLoader.getXIncludes | private function getXIncludes(){
$xincludes = array();
foreach($this->qtiItem->getComposingElements() as $element){
if($element instanceof XInclude){
$xincludes[] = $element;
}
}
return $xincludes;
} | php | private function getXIncludes(){
$xincludes = array();
foreach($this->qtiItem->getComposingElements() as $element){
if($element instanceof XInclude){
$xincludes[] = $element;
}
}
return $xincludes;
} | [
"private",
"function",
"getXIncludes",
"(",
")",
"{",
"$",
"xincludes",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"qtiItem",
"->",
"getComposingElements",
"(",
")",
"as",
"$",
"element",
")",
"{",
"if",
"(",
"$",
"element",
"insta... | Find the xinclude elements in the qti item
@return \oat\taoQtiItem\model\qti\XInclude[] | [
"Find",
"the",
"xinclude",
"elements",
"in",
"the",
"qti",
"item"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/XIncludeLoader.php#L163-L171 |
oat-sa/extension-tao-itemqti | model/qti/XIncludeLoader.php | XIncludeLoader.getCustomElements | private function getCustomElements(){
$customElements = array();
foreach($this->qtiItem->getComposingElements() as $element){
if($element instanceof PortableCustomInteraction){
$customElements[] = $element;
}
}
return $customElements;
} | php | private function getCustomElements(){
$customElements = array();
foreach($this->qtiItem->getComposingElements() as $element){
if($element instanceof PortableCustomInteraction){
$customElements[] = $element;
}
}
return $customElements;
} | [
"private",
"function",
"getCustomElements",
"(",
")",
"{",
"$",
"customElements",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"qtiItem",
"->",
"getComposingElements",
"(",
")",
"as",
"$",
"element",
")",
"{",
"if",
"(",
"$",
"element"... | Find the custom elements in the qti item
@return \oat\taoQtiItem\model\qti\interaction\PortableCustomInteraction[] | [
"Find",
"the",
"custom",
"elements",
"in",
"the",
"qti",
"item"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/XIncludeLoader.php#L178-L186 |
oat-sa/extension-tao-itemqti | model/qti/exception/UnsupportedQtiElement.php | UnsupportedQtiElement.getUserMessage | public function getUserMessage() {
$name = $this->getElement()->localName;
$line = $this->getElement()->getLineNo();
return sprintf(__('The QTI class "%1$s" located at line "%2$d" is currently not supported.'), $name, $line);
} | php | public function getUserMessage() {
$name = $this->getElement()->localName;
$line = $this->getElement()->getLineNo();
return sprintf(__('The QTI class "%1$s" located at line "%2$d" is currently not supported.'), $name, $line);
} | [
"public",
"function",
"getUserMessage",
"(",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"getElement",
"(",
")",
"->",
"localName",
";",
"$",
"line",
"=",
"$",
"this",
"->",
"getElement",
"(",
")",
"->",
"getLineNo",
"(",
")",
";",
"return",
"spri... | Returns a human-readable message describing the error that occurred.
@return string | [
"Returns",
"a",
"human",
"-",
"readable",
"message",
"describing",
"the",
"error",
"that",
"occurred",
"."
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/exception/UnsupportedQtiElement.php#L80-L84 |
oat-sa/extension-tao-itemqti | model/ItemCategoriesService.php | ItemCategoriesService.getCategories | public function getCategories(array $items)
{
$categories = array();
$lookupProperties = $this->getOption('properties');
if (!empty($lookupProperties)) {
foreach ($items as $item) {
$itemCategories = array();
if($item instanceof \core_kernel_classe... | php | public function getCategories(array $items)
{
$categories = array();
$lookupProperties = $this->getOption('properties');
if (!empty($lookupProperties)) {
foreach ($items as $item) {
$itemCategories = array();
if($item instanceof \core_kernel_classe... | [
"public",
"function",
"getCategories",
"(",
"array",
"$",
"items",
")",
"{",
"$",
"categories",
"=",
"array",
"(",
")",
";",
"$",
"lookupProperties",
"=",
"$",
"this",
"->",
"getOption",
"(",
"'properties'",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",... | Get the categories link to the list of items in parameter.
Theses categories come from a configurable list of properties.
The category label is also set in a configurable list
@param \core_kernel_classes_Resource[] $items
@return array of categories for specified items
['itemUri' => ['CATEGORY1', 'CATEGORY2']] | [
"Get",
"the",
"categories",
"link",
"to",
"the",
"list",
"of",
"items",
"in",
"parameter",
".",
"Theses",
"categories",
"come",
"from",
"a",
"configurable",
"list",
"of",
"properties",
".",
"The",
"category",
"label",
"is",
"also",
"set",
"in",
"a",
"confi... | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/ItemCategoriesService.php#L46-L69 |
oat-sa/extension-tao-itemqti | helpers/QtiSerializer.php | QtiSerializer.parseElementXml | public static function parseElementXml(SimpleXMLElement $xml){
$attributes = array();
foreach($xml->attributes() as $name => $value){
$attributes[$name] = (string) $value;
}
$returnValue = array(
'qtiClass' => $xml->getName()
);
if(count($attrib... | php | public static function parseElementXml(SimpleXMLElement $xml){
$attributes = array();
foreach($xml->attributes() as $name => $value){
$attributes[$name] = (string) $value;
}
$returnValue = array(
'qtiClass' => $xml->getName()
);
if(count($attrib... | [
"public",
"static",
"function",
"parseElementXml",
"(",
"SimpleXMLElement",
"$",
"xml",
")",
"{",
"$",
"attributes",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"xml",
"->",
"attributes",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",... | Parse a generic QTI element node into an array
@param SimpleXMLElement $xml
@return array | [
"Parse",
"a",
"generic",
"QTI",
"element",
"node",
"into",
"an",
"array"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/helpers/QtiSerializer.php#L38-L54 |
oat-sa/extension-tao-itemqti | helpers/QtiSerializer.php | QtiSerializer.parseExpressionXml | public static function parseExpressionXml(SimpleXMLElement $xml){
$returnValue = self::parseElementXml($xml);
$value = trim($xml);
$expressions = array();
foreach($xml->children() as $child){
$expressions[] = self::parseExpressionXml($child);
}
if(count($expre... | php | public static function parseExpressionXml(SimpleXMLElement $xml){
$returnValue = self::parseElementXml($xml);
$value = trim($xml);
$expressions = array();
foreach($xml->children() as $child){
$expressions[] = self::parseExpressionXml($child);
}
if(count($expre... | [
"public",
"static",
"function",
"parseExpressionXml",
"(",
"SimpleXMLElement",
"$",
"xml",
")",
"{",
"$",
"returnValue",
"=",
"self",
"::",
"parseElementXml",
"(",
"$",
"xml",
")",
";",
"$",
"value",
"=",
"trim",
"(",
"$",
"xml",
")",
";",
"$",
"expressi... | Parse a QTI expression node into an array
@see http://www.imsglobal.org/question/qtiv2p1/imsqti_infov2p1.html#element10569
@param SimpleXMLElement $xml
@return array | [
"Parse",
"a",
"QTI",
"expression",
"node",
"into",
"an",
"array"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/helpers/QtiSerializer.php#L63-L77 |
oat-sa/extension-tao-itemqti | helpers/QtiSerializer.php | QtiSerializer.parseResponseRuleXml | public static function parseResponseRuleXml(SimpleXMLElement $xml){
$returnValue = self::parseElementXml($xml);
foreach($xml->children() as $child){
$returnValue['expression'] = self::parseExpressionXml($child);
break;
}
return $returnValue;
} | php | public static function parseResponseRuleXml(SimpleXMLElement $xml){
$returnValue = self::parseElementXml($xml);
foreach($xml->children() as $child){
$returnValue['expression'] = self::parseExpressionXml($child);
break;
}
return $returnValue;
} | [
"public",
"static",
"function",
"parseResponseRuleXml",
"(",
"SimpleXMLElement",
"$",
"xml",
")",
"{",
"$",
"returnValue",
"=",
"self",
"::",
"parseElementXml",
"(",
"$",
"xml",
")",
";",
"foreach",
"(",
"$",
"xml",
"->",
"children",
"(",
")",
"as",
"$",
... | Parse a QTI responseRule node into an array
@see http://www.imsglobal.org/question/qtiv2p1/imsqti_infov2p1.html#element10408
@param SimpleXMLElement $xml
@return array | [
"Parse",
"a",
"QTI",
"responseRule",
"node",
"into",
"an",
"array"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/helpers/QtiSerializer.php#L86-L93 |
oat-sa/extension-tao-itemqti | helpers/QtiSerializer.php | QtiSerializer.parseResponseRulesContainerXml | private static function parseResponseRulesContainerXml(SimpleXMLElement $xml){
$returnValue = self::parseElementXml($xml);
$responseRules = array();
foreach($xml->children() as $child){
$name = $child->getName();
$methodName = 'parse'.ucfirst($name).'Xml';
if... | php | private static function parseResponseRulesContainerXml(SimpleXMLElement $xml){
$returnValue = self::parseElementXml($xml);
$responseRules = array();
foreach($xml->children() as $child){
$name = $child->getName();
$methodName = 'parse'.ucfirst($name).'Xml';
if... | [
"private",
"static",
"function",
"parseResponseRulesContainerXml",
"(",
"SimpleXMLElement",
"$",
"xml",
")",
"{",
"$",
"returnValue",
"=",
"self",
"::",
"parseElementXml",
"(",
"$",
"xml",
")",
";",
"$",
"responseRules",
"=",
"array",
"(",
")",
";",
"foreach",... | Parse a generic QTI element node that contains responseRules as children into an array
@param SimpleXMLElement $xml
@return array | [
"Parse",
"a",
"generic",
"QTI",
"element",
"node",
"that",
"contains",
"responseRules",
"as",
"children",
"into",
"an",
"array"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/helpers/QtiSerializer.php#L101-L116 |
oat-sa/extension-tao-itemqti | helpers/QtiSerializer.php | QtiSerializer.parseResponseIfXml | public static function parseResponseIfXml(SimpleXMLElement $xml){
$returnValue = self::parseElementXml($xml);
$i = 0;
$expression = null;
$responseRules = array();
foreach($xml->children() as $child){
if($i){
$name = $child->getName();
... | php | public static function parseResponseIfXml(SimpleXMLElement $xml){
$returnValue = self::parseElementXml($xml);
$i = 0;
$expression = null;
$responseRules = array();
foreach($xml->children() as $child){
if($i){
$name = $child->getName();
... | [
"public",
"static",
"function",
"parseResponseIfXml",
"(",
"SimpleXMLElement",
"$",
"xml",
")",
"{",
"$",
"returnValue",
"=",
"self",
"::",
"parseElementXml",
"(",
"$",
"xml",
")",
";",
"$",
"i",
"=",
"0",
";",
"$",
"expression",
"=",
"null",
";",
"$",
... | Parse a QTI responseProcessing node into an array
@see http://www.imsglobal.org/question/qtiv2p1/imsqti_infov2p1.html#element10413
@param SimpleXMLElement $xml
@return array | [
"Parse",
"a",
"QTI",
"responseProcessing",
"node",
"into",
"an",
"array"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/helpers/QtiSerializer.php#L136-L159 |
oat-sa/extension-tao-itemqti | helpers/QtiSerializer.php | QtiSerializer.parseResponseConditionXml | public static function parseResponseConditionXml(SimpleXMLElement $xml){
$returnValue = self::parseElementXml($xml);
foreach($xml->responseIf as $responseIfXml){
$returnValue['responseIf'] = self::parseResponseIfXml($responseIfXml);
break;
}
foreach($xml->response... | php | public static function parseResponseConditionXml(SimpleXMLElement $xml){
$returnValue = self::parseElementXml($xml);
foreach($xml->responseIf as $responseIfXml){
$returnValue['responseIf'] = self::parseResponseIfXml($responseIfXml);
break;
}
foreach($xml->response... | [
"public",
"static",
"function",
"parseResponseConditionXml",
"(",
"SimpleXMLElement",
"$",
"xml",
")",
"{",
"$",
"returnValue",
"=",
"self",
"::",
"parseElementXml",
"(",
"$",
"xml",
")",
";",
"foreach",
"(",
"$",
"xml",
"->",
"responseIf",
"as",
"$",
"respo... | Parse a QTI responseProcessing node into an array
@see http://www.imsglobal.org/question/qtiv2p1/imsqti_infov2p1.html#element10409
@param SimpleXMLElement $xml
@return array | [
"Parse",
"a",
"QTI",
"responseProcessing",
"node",
"into",
"an",
"array"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/helpers/QtiSerializer.php#L179-L196 |
oat-sa/extension-tao-itemqti | model/qti/response/interactionResponseProcessing/InteractionResponseProcessing.php | InteractionResponseProcessing.create | public static function create($classID, ResponseDeclaration $response, Item $item){
switch($classID){
case None::CLASS_ID :
$className = 'oat\\taoQtiItem\\model\\qti\\response\\interactionResponseProcessing\\None';
break;
case MatchCorrectTemplate::CLASS_I... | php | public static function create($classID, ResponseDeclaration $response, Item $item){
switch($classID){
case None::CLASS_ID :
$className = 'oat\\taoQtiItem\\model\\qti\\response\\interactionResponseProcessing\\None';
break;
case MatchCorrectTemplate::CLASS_I... | [
"public",
"static",
"function",
"create",
"(",
"$",
"classID",
",",
"ResponseDeclaration",
"$",
"response",
",",
"Item",
"$",
"item",
")",
"{",
"switch",
"(",
"$",
"classID",
")",
"{",
"case",
"None",
"::",
"CLASS_ID",
":",
"$",
"className",
"=",
"'oat\\... | Short description of method create
@access public
@author Joel Bout, <joel.bout@tudor.lu>
@param int classID
@param Response response
@param Item item
@return oat\taoQtiItem\model\qti\response\interactionResponseProcessing\InteractionResponseProcessing | [
"Short",
"description",
"of",
"method",
"create"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/response/interactionResponseProcessing/InteractionResponseProcessing.php#L99-L126 |
oat-sa/extension-tao-itemqti | model/update/ItemFixGhostResponse.php | ItemFixGhostResponse.updateItem | protected function updateItem(\oat\taoQtiItem\model\qti\Item $item, $itemFile)
{
$changed = false;
$responses = $item->getResponses();
$interactions = $item->getInteractions();
$usedResponses = [];
foreach($interactions as $interaction){
$usedResponses[] = $intera... | php | protected function updateItem(\oat\taoQtiItem\model\qti\Item $item, $itemFile)
{
$changed = false;
$responses = $item->getResponses();
$interactions = $item->getInteractions();
$usedResponses = [];
foreach($interactions as $interaction){
$usedResponses[] = $intera... | [
"protected",
"function",
"updateItem",
"(",
"\\",
"oat",
"\\",
"taoQtiItem",
"\\",
"model",
"\\",
"qti",
"\\",
"Item",
"$",
"item",
",",
"$",
"itemFile",
")",
"{",
"$",
"changed",
"=",
"false",
";",
"$",
"responses",
"=",
"$",
"item",
"->",
"getRespons... | Remove unused response declaration from the items and rp template misuse
@param oat\taoQtiItem\modal\Item $item
@param string $itemFile
@return boolean | [
"Remove",
"unused",
"response",
"declaration",
"from",
"the",
"items",
"and",
"rp",
"template",
"misuse"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/update/ItemFixGhostResponse.php#L44-L78 |
oat-sa/extension-tao-itemqti | model/qti/response/interactionResponseProcessing/Template.php | Template.createByTemplate | public static function createByTemplate($templateUri, ResponseDeclaration $response, Item $item)
{
$returnValue = null;
switch ($templateUri) {
case ResponseTemplate::MATCH_CORRECT :
$returnValue = self::create(MatchCorrectTemplate::CLASS_ID, $response, $item);
break;
case Resp... | php | public static function createByTemplate($templateUri, ResponseDeclaration $response, Item $item)
{
$returnValue = null;
switch ($templateUri) {
case ResponseTemplate::MATCH_CORRECT :
$returnValue = self::create(MatchCorrectTemplate::CLASS_ID, $response, $item);
break;
case Resp... | [
"public",
"static",
"function",
"createByTemplate",
"(",
"$",
"templateUri",
",",
"ResponseDeclaration",
"$",
"response",
",",
"Item",
"$",
"item",
")",
"{",
"$",
"returnValue",
"=",
"null",
";",
"switch",
"(",
"$",
"templateUri",
")",
"{",
"case",
"Response... | Short description of method createByTemplate
@access public
@author Joel Bout, <joel.bout@tudor.lu>
@param string templateUri
@param Response response
@param Item item
@return oat\taoQtiItem\model\qti\response\interactionResponseProcessing\InteractionResponseProcessing | [
"Short",
"description",
"of",
"method",
"createByTemplate"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/response/interactionResponseProcessing/Template.php#L57-L78 |
oat-sa/extension-tao-itemqti | model/qti/metadata/ontology/GenericLomOntologyClassificationExtractor.php | GenericLomOntologyClassificationExtractor.extract | public function extract($resource)
{
if (! $resource instanceof \core_kernel_classes_Resource) {
throw new MetadataExtractionException(__('The given target is not an instance of core_kernel_classes_Resource'));
}
$identifier = \tao_helpers_Uri::getUniqueId($resource->getUri());
... | php | public function extract($resource)
{
if (! $resource instanceof \core_kernel_classes_Resource) {
throw new MetadataExtractionException(__('The given target is not an instance of core_kernel_classes_Resource'));
}
$identifier = \tao_helpers_Uri::getUniqueId($resource->getUri());
... | [
"public",
"function",
"extract",
"(",
"$",
"resource",
")",
"{",
"if",
"(",
"!",
"$",
"resource",
"instanceof",
"\\",
"core_kernel_classes_Resource",
")",
"{",
"throw",
"new",
"MetadataExtractionException",
"(",
"__",
"(",
"'The given target is not an instance of core... | Extract resource metadata and transform it to ClassificationMetadataValue
@param \core_kernel_classes_Resource $resource
@return array
@throws MetadataExtractionException
@throws \oat\tao\model\metadata\exception\writer\MetadataWriterException | [
"Extract",
"resource",
"metadata",
"and",
"transform",
"it",
"to",
"ClassificationMetadataValue"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/model/qti/metadata/ontology/GenericLomOntologyClassificationExtractor.php#L56-L91 |
oat-sa/extension-tao-itemqti | helpers/CssHelper.php | CssHelper.saveCssFile | public static function saveCssFile(\core_kernel_classes_resource $item, $lang, $styleSheetPath, $cssArr)
{
$directory = \taoItems_models_classes_ItemsService::singleton()->getItemDirectory($item, $lang);
$file = $directory->getFile($styleSheetPath);
// make sure that 'no custom css' means ... | php | public static function saveCssFile(\core_kernel_classes_resource $item, $lang, $styleSheetPath, $cssArr)
{
$directory = \taoItems_models_classes_ItemsService::singleton()->getItemDirectory($item, $lang);
$file = $directory->getFile($styleSheetPath);
// make sure that 'no custom css' means ... | [
"public",
"static",
"function",
"saveCssFile",
"(",
"\\",
"core_kernel_classes_resource",
"$",
"item",
",",
"$",
"lang",
",",
"$",
"styleSheetPath",
",",
"$",
"cssArr",
")",
"{",
"$",
"directory",
"=",
"\\",
"taoItems_models_classes_ItemsService",
"::",
"singleton... | Stores an css array in the file
@param \core_kernel_classes_resource $item
@param string $lang
@param string $styleSheetPath
@param array $cssArr
@return boolean true on success | [
"Stores",
"an",
"css",
"array",
"in",
"the",
"file"
] | train | https://github.com/oat-sa/extension-tao-itemqti/blob/a55b73c7894523bde169ba520d5001ce7b5bb88c/helpers/CssHelper.php#L40-L53 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.