ILIAS  release_8 Revision v8.24
class.ilIndividualAssessmentDataSet.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
25{
26 public function getSupportedVersions(): array
27 {
28 return ['5.2.0', '5.3.0'];
29 }
30
31 protected function getXmlNamespace(string $a_entity, string $a_schema_version): string
32 {
33 return 'http://www.ilias.de/xml/Modules/IndividualAssessment/' . $a_entity;
34 }
35
39 protected function getTypes(string $a_entity, string $a_version): array
40 {
41 switch ($a_entity) {
42 case 'iass':
43 return array(
44 "id" => "integer",
45 "title" => "text",
46 "description" => "text",
47 "content" => "text",
48 "recordTemplate" => "text",
49 "eventTimePlaceRequired" => "integer",
50 "file_required" => "integer",
51 "contact" => "text",
52 "responsibility" => "text",
53 "phone" => "text",
54 "mails" => "text",
55 "consultation_hours" => "text"
56 );
57 default:
58 return array();
59 }
60 }
61
65 protected function getDependencies(
66 string $a_entity,
67 string $a_version,
68 ?array $a_rec = null,
69 ?array $a_ids = null
70 ): array {
71 return [];
72 }
73
77 public function readData(string $a_entity, string $a_version, array $a_ids): void
78 {
79 $this->data = array();
80 $this->_readData($a_entity, $a_ids);
81 }
82
86 protected function _readData(string $entity, array $ids): void
87 {
88 switch ($entity) {
89 case 'iass':
90 foreach ($ids as $iass_id) {
91 $iass_id = (int) $iass_id;
92 if (ilObject::_lookupType($iass_id) == 'iass') {
93 $obj = new ilObjIndividualAssessment($iass_id, false);
94 $settings = $obj->getSettings();
95 $info = $obj->getInfoSettings();
96 $data = array(
97 'id' => $iass_id,
98 'title' => $obj->getTitle(),
99 'description' => $obj->getDescription(),
100 'content' => $settings->getContent(),
101 'recordTemplate' => $settings->getRecordTemplate(),
102 'eventTimePlaceRequired' => (int) $settings->isEventTimePlaceRequired(),
103 'file_required' => (int) $settings->isFileRequired(),
104 "contact" => $info->getContact(),
105 "responsibility" => $info->getResponsibility(),
106 "phone" => $info->getPhone(),
107 "mails" => $info->getMails(),
108 "consultation_hours" => $info->getConsultationHours()
109 );
110 $this->data[] = $data;
111 }
112 }
113 break;
114 default:
115 }
116 }
117
121 public function importRecord(
122 string $a_entity,
123 array $a_types,
124 array $a_rec,
125 ilImportMapping $a_mapping,
126 string $a_schema_version
127 ): void {
128 if ($a_entity == "iass") {
129 if ($new_id = $a_mapping->getMapping('Services/Container', 'objs', $a_rec['id'])) {
130 $newObj = ilObjectFactory::getInstanceByObjId((int) $new_id, false);
131 } else {
132 $newObj = new ilObjIndividualAssessment();
133 $newObj->create();
134 }
135
136 $newObj->setTitle($a_rec["title"]);
137 $newObj->setDescription($a_rec["description"]);
138
140 $newObj->getId(),
141 $newObj->getTitle(),
142 $newObj->getDescription(),
143 $a_rec["content"],
144 $a_rec["recordTemplate"],
145 $a_rec['eventTimePlaceRequired'] == 1,
146 $a_rec['file_required'] == 1
147 );
148
150 $newObj->getId(),
151 $a_rec['contact'],
152 $a_rec['responsibility'],
153 $a_rec['phone'],
154 $a_rec['mails'],
155 $a_rec['consultation_hours']
156 );
157
158 $newObj->setSettings($settings);
159 $newObj->setInfoSettings($info);
160 $newObj->update();
161 $newObj->updateInfo();
162 $a_mapping->addMapping("Modules/IndividualAssessment", "iass", $a_rec["id"], (string) $newObj->getId());
163 }
164 }
165}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
getMapping(string $a_comp, string $a_entity, string $a_old_id)
Individual Assessment dataset class.
getDependencies(string $a_entity, string $a_version, ?array $a_rec=null, ?array $a_ids=null)
Return dependencies form entities to other entities (in our case these are all the DB relations)
importRecord(string $a_entity, array $a_types, array $a_rec, ilImportMapping $a_mapping, string $a_schema_version)
Import record.
getTypes(string $a_entity, string $a_version)
Map XML attributes of entities to data types (text, integer...)
_readData(string $entity, array $ids)
Build data array, data is read from cache except iass object itself.
readData(string $a_entity, string $a_version, array $a_ids)
Read data from Cache for a given entity and ID(s)
getXmlNamespace(string $a_entity, string $a_schema_version)
An object carrying settings of an Individual Assessment obj beyond the standard information.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
static _lookupType(int $id, bool $reference=false)
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: confirmReg.php:20
return['3gp', '7z', 'ai', 'aif', 'aifc', 'aiff', 'au', 'arw', 'avi', 'backup', 'bak', 'bas', 'bpmn', 'bpmn2', 'bmp', 'bib', 'bibtex', 'bz', 'bz2', 'c', 'c++', 'cc', 'cct', 'cdf', 'cer', 'class', 'cls', 'conf', 'cpp', 'crt', 'crs', 'crw', 'cr2', 'css', 'cst', 'csv', 'cur', 'db', 'dcr', 'des', 'dng', 'doc', 'docx', 'dot', 'dotx', 'dtd', 'dvi', 'el', 'eps', 'epub', 'f', 'f77', 'f90', 'flv', 'for', 'g3', 'gif', 'gl', 'gan', 'ggb', 'gsd', 'gsm', 'gtar', 'gz', 'gzip', 'h', 'hpp', 'htm', 'html', 'htmls', 'ibooks', 'ico', 'ics', 'ini', 'ipynb', 'java', 'jbf', 'jpeg', 'jpg', 'js', 'jsf', 'jso', 'json', 'latex', 'lang', 'less', 'log', 'lsp', 'ltx', 'm1v', 'm2a', 'm2v', 'm3u', 'm4a', 'm4v', 'markdown', 'm', 'mat', 'md', 'mdl', 'mdown', 'mid', 'min', 'midi', 'mobi', 'mod', 'mov', 'movie', 'mp2', 'mp3', 'mp4', 'mpa', 'mpeg', 'mpg', 'mph', 'mpga', 'mpp', 'mpt', 'mpv', 'mpx', 'mv', 'mw', 'mv4', 'nb', 'nbp', 'nef', 'nif', 'niff', 'obj', 'obm', 'odt', 'ods', 'odp', 'odg', 'odf', 'oga', 'ogg', 'ogv', 'old', 'p', 'pas', 'pbm', 'pcl', 'pct', 'pcx', 'pdf', 'pgm', 'pic', 'pict', 'png', 'por', 'pov', 'project', 'properties', 'ppa', 'ppm', 'pps', 'ppsx', 'ppt', 'pptx', 'ppz', 'ps', 'psd', 'pwz', 'qt', 'qtc', 'qti', 'qtif', 'r', 'ra', 'ram', 'rar', 'rast', 'rda', 'rev', 'rexx', 'ris', 'rf', 'rgb', 'rm', 'rmd', 'rmi', 'rmm', 'rmp', 'rt', 'rtf', 'rtx', 'rv', 's', 's3m', 'sav', 'sbs', 'sec', 'sdml', 'sgm', 'sgml', 'smi', 'smil', 'srt', 'sps', 'spv', 'stl', 'svg', 'swa', 'swf', 'swz', 'tar', 'tex', 'texi', 'texinfo', 'text', 'tgz', 'tif', 'tiff', 'ttf', 'txt', 'tmp', 'uvproj', 'vdf', 'vimeo', 'viv', 'vivo', 'vrml', 'vsdx', 'wav', 'webm', 'wmv', 'wmx', 'wmz', 'woff', 'wwd', 'xhtml', 'xif', 'xls', 'xlsx', 'xmind', 'xml', 'xsl', 'xsd', 'zip']
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200