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);
89 $query =
"INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) ".
91 $this->db->quote($a_new_obj_id ,
'integer').
", ".
92 $this->db->quote($this->
getObjType() ,
'text').
", ".
93 $this->db->quote($this->
getMode() ,
'integer').
", ".
94 $this->db->quote($this->
getVisits() ,
'integer').
107 $this->visits = $a_visits;
112 $this->obj_mode = $a_mode;
132 if(!$this->is_stored)
136 $query =
"UPDATE ut_lp_settings SET u_mode = ".$ilDB->quote($this->
getMode() ,
'integer').
", ".
137 "visits = ".$ilDB->quote($this->
getVisits() ,
'integer').
" ".
138 "WHERE obj_id = ".$ilDB->quote($this->
getObjId() ,
'integer');
150 $query =
"INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) ".
152 $ilDB->quote($this->
getObjId() ,
'integer').
", ".
153 $ilDB->quote($this->
getObjType(),
'text').
", ".
154 $ilDB->quote($this->
getMode(),
'integer').
", ".
155 $ilDB->quote(0,
'integer').
168 $query =
"SELECT visits FROM ut_lp_settings ".
169 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
192 $query =
"DELETE FROM ut_lp_settings WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
200 global
$ilDB,$ilObjDataCache;
211 $query =
"SELECT u_mode FROM ut_lp_settings ".
212 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
228 switch($this->obj_type)
245 LP_MODE_DEACTIVATE => $lng->txt(
'trac_mode_deactivated')
258 include_once
'./Services/Tracking/classes/class.ilLPCollections.php';
259 include_once
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
262 if ($subtype !=
"scorm2004")
266 return array(
LP_MODE_SCORM => $lng->txt(
'trac_mode_scorm_aicc'));
279 return array(
LP_MODE_SCORM => $lng->txt(
'trac_mode_scorm_aicc'),
312 return array(
LP_MODE_EVENT => $this->lng->txt(
'trac_mode_event'));
326 return $lng->txt(
'trac_mode_deactivated');
329 return $lng->txt(
'trac_mode_tlt');
332 return $lng->txt(
'trac_mode_visits');
335 return $lng->txt(
'trac_mode_manual');
338 return $lng->txt(
'trac_mode_manual_by_tutor');
341 return $lng->txt(
'trac_mode_objectives');
344 return $lng->txt(
'trac_mode_collection');
347 return $lng->txt(
'trac_mode_scorm');
350 return $lng->txt(
'trac_mode_test_finished');
353 return $lng->txt(
'trac_mode_test_passed');
356 return $lng->txt(
'trac_mode_exercise_returned');
359 return $lng->txt(
'trac_mode_scorm_package');
362 return $lng->txt(
'trac_mode_event');
383 return $lng->txt(
'trac_mode_deactivated_info');
386 return $lng->txt(
'trac_mode_tlt_info');
389 return $lng->txt(
'trac_mode_visits_info');
392 return $lng->txt(
'trac_mode_manual_info');
395 return $lng->txt(
'trac_mode_manual_by_tutor_info');
398 return $lng->txt(
'trac_mode_objectives_info');
401 return $lng->txt(
'trac_mode_collection_info');
404 return $lng->txt(
'trac_mode_scorm_info');
407 return $lng->txt(
'trac_mode_test_finished_info');
410 return $lng->txt(
'trac_mode_test_passed_info');
413 return $lng->txt(
'trac_mode_exercise_returned_info');
416 return $lng->txt(
'trac_mode_scorm_package_info');
419 return $lng->txt(
'trac_mode_event_info');
430 global
$ilDB,$ilObjDataCache;
433 if($ilObjDataCache->lookupType($a_obj_id) ==
'crs')
435 include_once
'Modules/Course/classes/class.ilObjCourse.php';
447 global $ilObjDataCache;
449 if($ilObjDataCache->lookupType($a_obj_id) !=
'sahs')
453 include_once(
'classes/class.ilConditionHandler.php');
465 $res = $this->db->query(
"SELECT * FROM ut_lp_settings WHERE obj_id = ".
466 $this->db->quote($this->obj_id ,
'integer'));
469 $this->is_stored =
true;
470 $this->obj_type =
$row->obj_type;
471 $this->obj_mode =
$row->u_mode;
472 $this->visits =
$row->visits;
493 #$type = strlen($a_type) ? $a_type : $this->obj_type;
532 return LP_MODE_UNDEFINED;