31 include_once
'class.ilMDBase.php';
38 include_once
'Services/MetaData/classes/class.ilMDTypicalAgeRange.php';
44 include_once
'Services/MetaData/classes/class.ilMDTypicalAgeRange.php';
46 if (!$a_typical_age_range_id) {
50 $typ->setMetaId($a_typical_age_range_id);
56 include_once
'Services/MetaData/classes/class.ilMDTypicalAgeRange.php';
60 $typ->setParentType(
'meta_educational');
66 include_once
'Services/MetaData/classes/class.ilMDDescription.php';
72 include_once
'Services/MetaData/classes/class.ilMDDescription.php';
74 if (!$a_description_id) {
78 $des->setMetaId($a_description_id);
84 include_once
'Services/MetaData/classes/class.ilMDDescription.php';
88 $des->setParentType(
'meta_educational');
94 include_once
'Services/MetaData/classes/class.ilMDLanguage.php';
100 include_once
'Services/MetaData/classes/class.ilMDLanguage.php';
102 if (!$a_language_id) {
106 $lan->setMetaId($a_language_id);
112 include_once
'Services/MetaData/classes/class.ilMDLanguage.php';
116 $lan->setParentType(
'meta_educational');
128 $this->interactivity_type = $a_iat;
137 return $this->interactivity_type;
144 case 'Questionnaire':
151 case 'NarrativeText':
154 case 'ProblemStatement':
155 case 'SelfAssessment':
157 $this->learning_resource_type = $a_lrt;
166 return $this->learning_resource_type;
176 $this->interactivity_level = $a_iat;
185 return $this->interactivity_level;
195 $this->semantic_density = $a_sd;
204 return $this->semantic_density;
213 $this->intended_end_user_role = $a_ieur;
222 return $this->intended_end_user_role;
226 switch ($a_context) {
228 case 'HigherEducation':
231 $this->context = $a_context;
240 return $this->context;
244 switch ($a_difficulty) {
249 case 'VeryDifficult':
250 $this->difficulty = $a_difficulty;
259 return $this->difficulty;
264 if (!$months and !$days and !$hours and !$minutes and !$seconds) {
270 $tlt .= ($months .
'M');
273 $tlt .= ($days .
'D');
275 if ($hours or $minutes or $seconds) {
279 $tlt .= ($hours .
'H');
282 $tlt .= ($minutes .
'M');
285 $tlt .= ($seconds .
'S');
294 $this->typical_learning_time = $a_tlt;
298 return $this->typical_learning_time;
303 include_once
'./Services/MetaData/classes/class.ilMDUtils.php';
307 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];
315 $fields[
'meta_educational_id'] =
array(
'integer',$next_id = $ilDB->nextId(
'il_meta_educational'));
317 if ($this->db->insert(
'il_meta_educational', $fields)) {
329 if ($this->db->update(
330 'il_meta_educational',
331 $this->__getFields(),
340 public function delete()
345 $query =
"DELETE FROM il_meta_educational " .
346 "WHERE meta_educational_id = " . $ilDB->quote($this->
getMetaId());
389 $query =
"SELECT * FROM il_meta_educational " .
390 "WHERE meta_educational_id = " . $ilDB->quote($this->
getMetaId(),
'integer');
419 $writer->xmlStartTag(
446 foreach ($typ_ages as
$id) {
450 if (is_object(
$key)) {
451 $key->toXML($writer);
454 if (!count($typ_ages)) {
455 include_once
'Services/MetaData/classes/class.ilMDTypicalAgeRange.php';
457 $typ->toXML($writer);
466 $key->toXML($writer);
471 $lang->toXML($writer);
473 $writer->xmlEndTag(
'Educational');
476 public static function _getId($a_rbac_id, $a_obj_id)
480 $query =
"SELECT meta_educational_id FROM il_meta_educational " .
481 "WHERE rbac_id = " . $ilDB->quote($a_rbac_id,
'integer') .
" " .
482 "AND obj_id = " . $ilDB->quote($a_obj_id,
'integer');
486 return $row->meta_educational_id;
495 $a_obj_id = $a_obj_id ? $a_obj_id : $a_rbac_id;
497 $query =
"SELECT typical_learning_time FROM il_meta_educational " .
498 "WHERE rbac_id = " . $ilDB->quote($a_rbac_id,
'integer') .
" " .
499 "AND obj_id = " . $ilDB->quote($a_obj_id,
'integer');
502 include_once
'./Services/MetaData/classes/class.ilMDUtils.php';
506 return 60 * 60 * 24 * 30 * $time_arr[0] +
507 60 * 60 * 24 * $time_arr[1] +
508 60 * 60 * $time_arr[2] +
setInteractivityType($a_iat)
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
& getLanguage($a_language_id)
& getTypicalAgeRangeIds()
static _getTypicalLearningTimeSeconds($a_rbac_id, $a_obj_id=0)
setDifficulty($a_difficulty)
& getDescription($a_description_id)
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
if(!array_key_exists('StateId', $_REQUEST)) $id
getTypicalLearningTimeSeconds()
setInteractivityLevel($a_iat)
getLearningResourceType()
& getTypicalAgeRange($a_typical_age_range_id)
static _LOMDurationToArray($a_string)
LOM datatype duration is a string like P2M4DT7H18M2S (2 months 4 days 7 hours 18 minutes 2 seconds) T...
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
setMetaId($a_meta_id, $a_read_data=true)
foreach($_POST as $key=> $value) $res
setLearningResourceType($a_lrt)
setTypicalLearningTime($a_tlt)
static _getId($a_rbac_id, $a_obj_id)
Create styles array
The data for the language used.
setSemanticDensity($a_sd)
setPhysicalTypicalLearningTime($months, $days, $hours, $minutes, $seconds)
setIntendedEndUserRole($a_ieur)