ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilIndividualAssessmentDataSet Class Reference

Individual Assessment dataset class. More...

+ Inheritance diagram for ilIndividualAssessmentDataSet:
+ Collaboration diagram for ilIndividualAssessmentDataSet:

Public Member Functions

 getSupportedVersions ()
 
 readData (string $a_entity, string $a_version, array $a_ids)
 Read data from Cache for a given entity and ID(s) More...
 
 importRecord (string $a_entity, array $a_types, array $a_rec, ilImportMapping $a_mapping, string $a_schema_version)
 Import record. More...
 
- Public Member Functions inherited from ilDataSet
 __construct ()
 
 init (string $a_entity, string $a_schema_version)
 Init. More...
 
 getSupportedVersions ()
 
 readData (string $a_entity, string $a_version, array $a_ids)
 Read data from DB. More...
 
 setExportDirectories (string $a_relative, string $a_absolute)
 
 setImportDirectory (string $a_val)
 
 getImportDirectory ()
 
 setDSPrefix (string $a_val)
 
 getDSPrefix ()
 
 getDSPrefixString ()
 
 getDirectDataFromQuery (string $a_query, bool $a_convert_to_leading_upper=true, bool $a_set=true)
 Get data from query.This is a standard procedure, all db field names are directly mapped to abstract fields. More...
 
 convertToLeadingUpper (string $a_str)
 Make xyz_abc a XyzAbc string. More...
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, ?array $a_ids, string $a_field="", bool $a_omit_header=false, bool $a_omit_types=false)
 Get xml representation <dataset install_id="123" install_url="..."> <types entity="table_name" version="4.0.1"> <ftype name="field_1" type="text"> <ftype name="field_2" type="date"> <ftype name="field_3" type="integer"> </types> <types ...> ... More...
 
 addRecordsXml (ilXmlWriter $a_writer, array $a_prefixes, string $a_entity, string $a_schema_version, array $a_ids, ?string $a_field="")
 
 afterXmlRecordWriting (string $a_entity, string $a_version, array $a_set)
 
 getNamespaces (array &$namespaces, string $a_entity, string $a_schema_version)
 
 getXmlRecord (string $a_entity, string $a_version, array $a_set)
 Get xml record for version. More...
 
 getXmlTypes (string $a_entity, string $a_version)
 Get xml types. More...
 
 getXMLEntityName (string $a_entity, string $a_version)
 Get entity name for xml (may be overwritten) More...
 
 getXMLEntityTag (string $a_entity, string $a_schema_version)
 Get entity tag. More...
 
 setImport (ilSurveyImporter $a_val)
 
 getImport ()
 
 setCurrentInstallationId (string $a_val)
 
 getCurrentInstallationId ()
 
 importRecord (string $a_entity, array $a_types, array $a_rec, ilImportMapping $a_mapping, string $a_schema_version)
 Needs to be overwritten for import use case. More...
 

Protected Member Functions

 getXmlNamespace (string $a_entity, string $a_schema_version)
 
 getTypes (string $a_entity, string $a_version)
 Map XML attributes of entities to data types (text, integer...) More...
 
 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) More...
 
 _readData (string $entity, array $ids)
 Build data array, data is read from cache except iass object itself. More...
 
- Protected Member Functions inherited from ilDataSet
 getTypes (string $a_entity, string $a_version)
 Get (abstract) types for (abstract) field names. More...
 
 getXmlNamespace (string $a_entity, string $a_schema_version)
 
 getDependencies (string $a_entity, string $a_version, ?array $a_rec=null, ?array $a_ids=null)
 
 createObjectExportId (string $a_type, string $a_id)
 Build ilias export id. More...
 
 parseObjectExportId (string $a_id, ?string $a_fallback_id=null)
 Parse export id. More...
 
 stripTags (array $rec, array $omit_keys=[])
 

Additional Inherited Members

- Data Fields inherited from ilDataSet
const EXPORT_NO_INST_ID = 1
 
const EXPORT_ID_ILIAS_LOCAL = 2
 
const EXPORT_ID_ILIAS_LOCAL_INVALID = 3
 
const EXPORT_ID_ILIAS_REMOTE = 4
 
const EXPORT_ID_ILIAS_REMOTE_INVALID = 5
 
const EXPORT_ID = 6
 
const EXPORT_ID_INVALID = 7
 
int $dircnt = 0
 
- Protected Attributes inherited from ilDataSet
string $current_installation_id = ""
 
array $data = []
 
ilDBInterface $db
 
ilLogger $ds_log
 
string $import_directory = ""
 
string $entity = ""
 
string $schema_version = ""
 
string $relative_export_dir = ""
 
string $absolute_export_dir = ""
 
string $ds_prefix = "ds"
 
string $version = ""
 
ilSurveyImporter $import
 

Detailed Description

Individual Assessment dataset class.

Definition at line 24 of file class.ilIndividualAssessmentDataSet.php.

Member Function Documentation

◆ _readData()

ilIndividualAssessmentDataSet::_readData ( string  $entity,
array  $ids 
)
protected

Build data array, data is read from cache except iass object itself.

Definition at line 86 of file class.ilIndividualAssessmentDataSet.php.

References ilDataSet\$data, ILIAS\LTI\ToolProvider\$settings, ilObject\_lookupType(), and ILIAS\Repository\int().

Referenced by readData().

86  : 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  }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
string $entity
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDependencies()

ilIndividualAssessmentDataSet::getDependencies ( string  $a_entity,
string  $a_version,
?array  $a_rec = null,
?array  $a_ids = null 
)
protected

Return dependencies form entities to other entities (in our case these are all the DB relations)

Definition at line 65 of file class.ilIndividualAssessmentDataSet.php.

70  : array {
71  return [];
72  }

◆ getSupportedVersions()

ilIndividualAssessmentDataSet::getSupportedVersions ( )

Definition at line 26 of file class.ilIndividualAssessmentDataSet.php.

26  : array
27  {
28  return ['5.2.0', '5.3.0'];
29  }

◆ getTypes()

ilIndividualAssessmentDataSet::getTypes ( string  $a_entity,
string  $a_version 
)
protected

Map XML attributes of entities to data types (text, integer...)

Definition at line 39 of file class.ilIndividualAssessmentDataSet.php.

Referenced by ilIndividualAssessmentDataSetWrapper\getTypesWrapper().

39  : 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  }
+ Here is the caller graph for this function:

◆ getXmlNamespace()

ilIndividualAssessmentDataSet::getXmlNamespace ( string  $a_entity,
string  $a_schema_version 
)
protected

Definition at line 31 of file class.ilIndividualAssessmentDataSet.php.

Referenced by ilIndividualAssessmentDataSetWrapper\getXmlNamespaceWrapper().

31  : string
32  {
33  return 'http://www.ilias.de/xml/Modules/IndividualAssessment/' . $a_entity;
34  }
+ Here is the caller graph for this function:

◆ importRecord()

ilIndividualAssessmentDataSet::importRecord ( string  $a_entity,
array  $a_types,
array  $a_rec,
ilImportMapping  $a_mapping,
string  $a_schema_version 
)

Import record.

Definition at line 121 of file class.ilIndividualAssessmentDataSet.php.

References ILIAS\LTI\ToolProvider\$settings, ilImportMapping\addMapping(), ilObjectFactory\getInstanceByObjId(), and ilImportMapping\getMapping().

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  }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
An object carrying settings of an Individual Assessment obj beyond the standard information.
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)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
+ Here is the call graph for this function:

◆ readData()

ilIndividualAssessmentDataSet::readData ( string  $a_entity,
string  $a_version,
array  $a_ids 
)

Read data from Cache for a given entity and ID(s)

Definition at line 77 of file class.ilIndividualAssessmentDataSet.php.

References _readData().

77  : void
78  {
79  $this->data = array();
80  $this->_readData($a_entity, $a_ids);
81  }
_readData(string $entity, array $ids)
Build data array, data is read from cache except iass object itself.
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: