3 declare(strict_types=1);
52 if (!$a_typical_age_range_id) {
56 $typ->setMetaId($a_typical_age_range_id);
65 $typ->setParentType(
'meta_educational');
80 if (!$a_description_id) {
84 $des->setMetaId($a_description_id);
93 $des->setParentType(
'meta_educational');
108 if (!$a_language_id) {
112 $lan->setMetaId($a_language_id);
121 $lan->setParentType(
'meta_educational');
133 $this->interactivity_type = $a_iat;
151 case 'Questionnaire':
158 case 'NarrativeText':
161 case 'ProblemStatement':
162 case 'SelfAssessment':
164 $this->learning_resource_type = $a_lrt;
185 $this->interactivity_level = $a_iat;
206 $this->semantic_density = $a_sd;
226 $this->intended_end_user_role = $a_ieur;
241 switch ($a_context) {
243 case 'HigherEducation':
246 $this->context = $a_context;
261 switch ($a_difficulty) {
266 case 'VeryDifficult':
267 $this->difficulty = $a_difficulty;
287 if (!$months && !$days && !$hours && !$minutes && !$seconds) {
293 $tlt .= ($months .
'M');
296 $tlt .= ($days .
'D');
298 if ($hours || $minutes || $seconds) {
302 $tlt .= ($hours .
'H');
305 $tlt .= ($minutes .
'M');
308 $tlt .= ($seconds .
'S');
316 $this->typical_learning_time = $a_tlt;
327 if ($time_arr === []) {
330 return 60 * 60 * 24 * 30 * $time_arr[0] + 60 * 60 * 24 * $time_arr[1] + 60 * 60 * $time_arr[2] + 60 * $time_arr[3] + $time_arr[4];
336 $fields[
'meta_educational_id'] = array(
'integer', $next_id = $this->db->nextId(
'il_meta_educational'));
338 if ($this->db->insert(
'il_meta_educational', $fields)) {
347 return $this->
getMetaId() && $this->db->update(
348 'il_meta_educational',
350 array(
"meta_educational_id" => array(
'integer', $this->
getMetaId()))
354 public function delete():
bool 357 $query =
"DELETE FROM il_meta_educational " .
385 'rbac_id' => array(
'integer', $this->
getRBACId()),
386 'obj_id' => array(
'integer', $this->
getObjId()),
387 'obj_type' => array(
'text', $this->
getObjType()),
393 'context' => array(
'text', $this->
getContext()),
402 $query =
"SELECT * FROM il_meta_educational " .
403 "WHERE meta_educational_id = " . $this->db->quote($this->
getMetaId(),
'integer');
408 $this->
setObjId((
int) $row->obj_id);
441 foreach ($typ_ages as
$id) {
445 if (is_object(
$key)) {
446 $key->toXML($writer);
449 if (!count($typ_ages)) {
451 $typ->toXML($writer);
460 $key->toXML($writer);
465 $lang->toXML($writer);
471 public static function _getId(
int $a_rbac_id,
int $a_obj_id):
int 475 $ilDB = $DIC->database();
477 $query =
"SELECT meta_educational_id FROM il_meta_educational " .
478 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
479 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer');
483 return (
int) $row->meta_educational_id;
492 $ilDB = $DIC->database();
494 $a_obj_id = $a_obj_id ?: $a_rbac_id;
496 $query =
"SELECT typical_learning_time FROM il_meta_educational " .
497 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
498 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer');
502 if (!count($time_arr)) {
505 return 60 * 60 * 24 * 30 * $time_arr[0] +
506 60 * 60 * 24 * $time_arr[1] +
507 60 * 60 * $time_arr[2] +
string $intended_end_user_role
static _LOMDurationToArray(string $a_string)
LOM datatype duration is a string like P2M4DT7H18M2S (2 months 4 days 7 hours 18 minutes 2 seconds) T...
setTypicalLearningTime(string $a_tlt)
getTypicalAgeRange(int $a_typical_age_range_id)
setIntendedEndUserRole(string $a_ieur)
getDescription(int $a_description_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getTypicalLearningTimeSeconds()
setInteractivityLevel(string $a_iat)
string $interactivity_type
static _getIds(int $a_rbac_id, int $a_obj_id, int $a_parent_id, string $a_parent_type)
static _getIds(int $a_rbac_id, int $a_obj_id, int $a_parent_id, string $a_parent_type)
getLearningResourceType()
static _getId(int $a_rbac_id, int $a_obj_id)
xmlEndTag(string $tag)
Writes an endtag.
static _getTypicalLearningTimeSeconds(int $a_rbac_id, int $a_obj_id=0)
setInteractivityType(string $a_iat)
setContext(string $a_context)
setDifficulty(string $a_difficulty)
string $typical_learning_time
static _getIds(int $a_rbac_id, int $a_obj_id, int $a_parent_id, string $a_parent_type)
getLanguage(int $a_language_id)
setLearningResourceType(string $a_lrt)
string $learning_resource_type
setSemanticDensity(string $a_sd)
string $interactivity_level
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
setMetaId(int $a_meta_id, bool $a_read_data=true)
toXML(ilXmlWriter $writer)
setObjType(string $a_type)
setPhysicalTypicalLearningTime(int $months, int $days, int $hours, int $minutes, int $seconds)