35 define(
"LP_MODE_DEACTIVATED",0);
36 define(
"LP_MODE_TLT",1);
37 define(
"LP_MODE_VISITS",2);
38 define(
"LP_MODE_MANUAL",3);
39 define(
"LP_MODE_OBJECTIVES",4);
40 define(
"LP_MODE_COLLECTION",5);
41 define(
"LP_MODE_SCORM",6);
42 define(
"LP_MODE_TEST_FINISHED",7);
43 define(
"LP_MODE_TEST_PASSED",8);
44 define(
"LP_MODE_EXERCISE_RETURNED",9);
45 define(
"LP_MODE_EVENT",10);
46 define(
"LP_MODE_MANUAL_BY_TUTOR",11);
47 define(
"LP_MODE_SCORM_PACKAGE",12);
49 define(
"LP_DEFAULT_VISITS",30);
65 global $ilObjDataCache,$ilDB;
69 $this->obj_id = $a_obj_id;
73 $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
87 $query =
"INSERT INTO ut_lp_settings ".
88 "SET obj_id = ".$this->db->quote($a_new_obj_id).
", ".
89 "obj_type = ".$this->db->quote($this->
getObjType()).
", ".
90 "mode = ".$this->db->quote($this->
getMode()).
", ".
91 "visits = ".$this->db->quote($this->
getVisits());
93 $this->db->query($query);
104 $this->visits = $a_visits;
109 $this->obj_mode = $a_mode;
127 if(!$this->is_stored)
131 $query =
"UPDATE ut_lp_settings SET mode = '".$this->obj_mode.
132 "', visits = '".$this->visits.
"' ".
133 "WHERE obj_id = '".$this->getObjId().
"'";
134 $this->db->query($query);
141 $query =
"INSERT INTO ut_lp_settings SET obj_id = '".$this->obj_id.
"', ".
142 "obj_type = '".$this->obj_type.
"', ".
143 "mode = '".$this->obj_mode.
"'";
144 $this->db->query($query);
157 $query =
"SELECT visits FROM ut_lp_settings ".
158 "WHERE obj_id = '".$a_obj_id.
"'";
160 $res = $ilDB->query($query);
181 $query =
"DELETE FROM ut_lp_settings WHERE obj_id = '".$a_obj_id.
"'";
182 $ilDB->query($query);
189 global $ilDB,$ilObjDataCache;
200 $query =
"SELECT mode FROM ut_lp_settings ".
201 "WHERE obj_id = '".$a_obj_id.
"'";
203 $res = $ilDB->query($query);
217 switch($this->obj_type)
243 include_once
'./Services/Tracking/classes/class.ilLPCollections.php';
244 include_once
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
247 if ($subtype !=
"scorm2004")
251 return array(
LP_MODE_SCORM => $lng->txt(
'trac_mode_scorm_aicc'));
264 return array(
LP_MODE_SCORM => $lng->txt(
'trac_mode_scorm_aicc'),
297 return array(
LP_MODE_EVENT => $this->lng->txt(
'trac_mode_event'));
311 return $lng->txt(
'trac_mode_deactivated');
314 return $lng->txt(
'trac_mode_tlt');
317 return $lng->txt(
'trac_mode_visits');
320 return $lng->txt(
'trac_mode_manual');
323 return $lng->txt(
'trac_mode_manual_by_tutor');
326 return $lng->txt(
'trac_mode_objectives');
329 return $lng->txt(
'trac_mode_collection');
332 return $lng->txt(
'trac_mode_scorm');
335 return $lng->txt(
'trac_mode_test_finished');
338 return $lng->txt(
'trac_mode_test_passed');
341 return $lng->txt(
'trac_mode_exercise_returned');
344 return $lng->txt(
'trac_mode_scorm_package');
347 return $lng->txt(
'trac_mode_event');
368 return $lng->txt(
'trac_mode_deactivated_info');
371 return $lng->txt(
'trac_mode_tlt_info');
374 return $lng->txt(
'trac_mode_visits_info');
377 return $lng->txt(
'trac_mode_manual_info');
380 return $lng->txt(
'trac_mode_manual_by_tutor_info');
383 return $lng->txt(
'trac_mode_objectives_info');
386 return $lng->txt(
'trac_mode_collection_info');
389 return $lng->txt(
'trac_mode_scorm_info');
392 return $lng->txt(
'trac_mode_test_finished_info');
395 return $lng->txt(
'trac_mode_test_passed_info');
398 return $lng->txt(
'trac_mode_exercise_returned_info');
401 return $lng->txt(
'trac_mode_scorm_package_info');
404 return $lng->txt(
'trac_mode_event_info');
415 global $ilDB,$ilObjDataCache;
418 if($ilObjDataCache->lookupType($a_obj_id) ==
'crs')
420 include_once
'Modules/Course/classes/class.ilObjCourse.php';
432 global $ilObjDataCache;
434 if($ilObjDataCache->lookupType($a_obj_id) !=
'sahs')
438 include_once(
'classes/class.ilConditionHandler.php');
450 $res = $this->db->query(
"SELECT * FROM ut_lp_settings WHERE obj_id = ".$this->db->quote($this->obj_id).
" ");
453 $this->is_stored =
true;
454 $this->obj_type = $row->obj_type;
455 $this->obj_mode = $row->mode;
456 $this->visits = $row->visits;
477 #$type = strlen($a_type) ? $a_type : $this->obj_type;
516 return LP_MODE_UNDEFINED;