31 include_once
'class.ilMDBase.php';
45 include_once
'Services/MetaData/classes/class.ilMDTypicalAgeRange.php';
51 include_once
'Services/MetaData/classes/class.ilMDTypicalAgeRange.php';
53 if(!$a_typical_age_range_id)
58 $typ->setMetaId($a_typical_age_range_id);
64 include_once
'Services/MetaData/classes/class.ilMDTypicalAgeRange.php';
68 $typ->setParentType(
'meta_educational');
74 include_once
'Services/MetaData/classes/class.ilMDDescription.php';
80 include_once
'Services/MetaData/classes/class.ilMDDescription.php';
82 if(!$a_description_id)
87 $des->setMetaId($a_description_id);
93 include_once
'Services/MetaData/classes/class.ilMDDescription.php';
97 $des->setParentType(
'meta_educational');
103 include_once
'Services/MetaData/classes/class.ilMDLanguage.php';
109 include_once
'Services/MetaData/classes/class.ilMDLanguage.php';
116 $lan->setMetaId($a_language_id);
122 include_once
'Services/MetaData/classes/class.ilMDLanguage.php';
126 $lan->setParentType(
'meta_educational');
139 $this->interactivity_type = $a_iat;
148 return $this->interactivity_type;
156 case 'Questionnaire':
163 case 'NarrativeText':
166 case 'ProblemStatement':
167 case 'SelfAssessment':
169 $this->learning_resource_type = $a_lrt;
178 return $this->learning_resource_type;
189 $this->interactivity_level = $a_iat;
198 return $this->interactivity_level;
209 $this->semantic_density = $a_sd;
218 return $this->semantic_density;
228 $this->intended_end_user_role = $a_ieur;
237 return $this->intended_end_user_role;
244 case 'HigherEducation':
247 $this->context = $a_context;
256 return $this->context;
260 switch($a_difficulty)
266 case 'VeryDifficult':
267 $this->difficulty = $a_difficulty;
276 return $this->difficulty;
281 if(!$months and !$days and !$hours and !$minutes and !$seconds)
289 $tlt .= ($months.
'M');
295 if($hours or $minutes or $seconds)
301 $tlt .= ($hours.
'H');
305 $tlt .= ($minutes.
'M');
309 $tlt .= ($seconds.
'S');
318 $this->typical_learning_time = $a_tlt;
322 return $this->typical_learning_time;
327 include_once
'./Services/MetaData/classes/class.ilMDUtils.php';
331 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];
339 $fields[
'meta_educational_id'] = array(
'integer',$next_id = $ilDB->nextId(
'il_meta_educational'));
341 if($this->db->insert(
'il_meta_educational',$fields))
355 if($this->db->update(
'il_meta_educational',
356 $this->__getFields(),
357 array(
"meta_educational_id" => array(
'integer',$this->
getMetaId()))))
371 $query =
"DELETE FROM il_meta_educational ".
372 "WHERE meta_educational_id = ".$ilDB->quote($this->
getMetaId());
400 return array(
'rbac_id' => array(
'integer',$this->
getRBACId()),
401 'obj_id' => array(
'integer',$this->
getObjId()),
402 'obj_type' => array(
'text',$this->
getObjType()),
408 'context' => array(
'text',$this->
getContext()),
420 $query =
"SELECT * FROM il_meta_educational ".
421 "WHERE meta_educational_id = ".$ilDB->quote($this->
getMetaId() ,
'integer');
451 $writer->xmlStartTag(
'Educational',
476 foreach($typ_ages as $id)
483 $key->toXML($writer);
486 if(!count($typ_ages))
488 include_once
'Services/MetaData/classes/class.ilMDTypicalAgeRange.php';
490 $typ->toXML($writer);
500 $key->toXML($writer);
506 $lang->toXML($writer);
508 $writer->xmlEndTag(
'Educational');
515 $query =
"SELECT meta_educational_id FROM il_meta_educational ".
516 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,
'integer').
" ".
517 "AND obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
522 return $row->meta_educational_id;
531 $a_obj_id = $a_obj_id ? $a_obj_id : $a_rbac_id;
533 $query =
"SELECT typical_learning_time FROM il_meta_educational ".
534 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,
'integer').
" ".
535 "AND obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
539 include_once
'./Services/MetaData/classes/class.ilMDUtils.php';
543 return 60 * 60 * 24 * 30 * $time_arr[0] +
544 60 * 60 * 24 * $time_arr[1] +
545 60 * 60 * $time_arr[2] +