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;
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];
314 $ilDB = $DIC[
'ilDB'];
317 $fields[
'meta_educational_id'] = array(
'integer',$next_id =
$ilDB->nextId(
'il_meta_educational'));
319 if ($this->db->insert(
'il_meta_educational', $fields)) {
330 $ilDB = $DIC[
'ilDB'];
333 if ($this->db->update(
334 'il_meta_educational',
335 $this->__getFields(),
336 array(
"meta_educational_id" => array(
'integer',$this->
getMetaId()))
344 public function delete()
348 $ilDB = $DIC[
'ilDB'];
351 $query =
"DELETE FROM il_meta_educational " .
352 "WHERE meta_educational_id = " .
$ilDB->quote($this->
getMetaId());
377 return array(
'rbac_id' => array(
'integer',$this->
getRBACId()),
378 'obj_id' => array(
'integer',$this->
getObjId()),
379 'obj_type' => array(
'text',$this->
getObjType()),
385 'context' => array(
'text',$this->
getContext()),
394 $ilDB = $DIC[
'ilDB'];
397 $query =
"SELECT * FROM il_meta_educational " .
398 "WHERE meta_educational_id = " .
$ilDB->quote($this->
getMetaId(),
'integer');
427 $writer->xmlStartTag(
454 foreach ($typ_ages as
$id) {
458 if (is_object(
$key)) {
459 $key->toXML($writer);
462 if (!count($typ_ages)) {
463 include_once
'Services/MetaData/classes/class.ilMDTypicalAgeRange.php';
465 $typ->toXML($writer);
474 $key->toXML($writer);
479 $lang->toXML($writer);
481 $writer->xmlEndTag(
'Educational');
484 public static function _getId($a_rbac_id, $a_obj_id)
488 $ilDB = $DIC[
'ilDB'];
490 $query =
"SELECT meta_educational_id FROM il_meta_educational " .
491 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
492 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer');
496 return $row->meta_educational_id;
505 $ilDB = $DIC[
'ilDB'];
507 $a_obj_id = $a_obj_id ? $a_obj_id : $a_rbac_id;
509 $query =
"SELECT typical_learning_time FROM il_meta_educational " .
510 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
511 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer');
514 include_once
'./Services/MetaData/classes/class.ilMDUtils.php';
518 return 60 * 60 * 24 * 30 * $time_arr[0] +
519 60 * 60 * 24 * $time_arr[1] +
520 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)
setSemanticDensity($a_sd)
setPhysicalTypicalLearningTime($months, $days, $hours, $minutes, $seconds)
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
setIntendedEndUserRole($a_ieur)