47 global $ilObjDataCache, $ilDB;
50 $this->obj_id = $a_obj_id;
54 $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
56 include_once
"Services/Object/classes/class.ilObjectLP.php";
58 $this->obj_mode = $olp->getDefaultMode();
73 $query =
"INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) ".
75 $this->db->quote($a_new_obj_id ,
'integer').
", ".
76 $this->db->quote($this->
getObjType() ,
'text').
", ".
77 $this->db->quote($this->
getMode() ,
'integer').
", ".
78 $this->db->quote($this->
getVisits() ,
'integer').
91 $this->visits = $a_visits;
96 $this->obj_mode = $a_mode;
116 $res = $this->db->query(
"SELECT * FROM ut_lp_settings WHERE obj_id = ".
117 $this->db->quote($this->obj_id ,
'integer'));
120 $this->is_stored =
true;
121 $this->obj_type =
$row->obj_type;
122 $this->obj_mode =
$row->u_mode;
123 $this->visits =
$row->visits;
135 if(!$this->is_stored)
139 $query =
"UPDATE ut_lp_settings SET u_mode = ".$ilDB->quote($this->
getMode() ,
'integer').
", ".
140 "visits = ".$ilDB->quote($this->
getVisits() ,
'integer').
" ".
141 "WHERE obj_id = ".$ilDB->quote($this->
getObjId() ,
'integer');
159 $query =
"INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) ".
161 $ilDB->quote($this->
getObjId() ,
'integer').
", ".
162 $ilDB->quote($this->
getObjType(),
'text').
", ".
163 $ilDB->quote($this->
getMode(),
'integer').
", ".
164 $ilDB->quote($this->
getVisits(),
'integer').
177 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
185 $query =
"DELETE FROM ut_lp_settings WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
198 $query =
"SELECT visits FROM ut_lp_settings ".
199 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
217 $query =
"SELECT obj_id, u_mode FROM ut_lp_settings".
218 " WHERE ".$ilDB->in(
"obj_id", $a_obj_ids,
"",
"integer");
219 $set = $ilDB->query(
$query);
234 $query =
"SELECT u_mode FROM ut_lp_settings".
235 " WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer");
236 $set = $ilDB->query(
$query);
237 $row = $ilDB->fetchAssoc($set);
240 return $row[
'u_mode'];
250 case self::LP_MODE_DEACTIVATED:
251 return $lng->txt(
'trac_mode_deactivated');
253 case self::LP_MODE_TLT:
254 return $lng->txt(
'trac_mode_tlt');
256 case self::LP_MODE_VISITS:
257 return $lng->txt(
'trac_mode_visits');
259 case self::LP_MODE_MANUAL:
260 return $lng->txt(
'trac_mode_manual');
262 case self::LP_MODE_MANUAL_BY_TUTOR:
263 return $lng->txt(
'trac_mode_manual_by_tutor');
265 case self::LP_MODE_OBJECTIVES:
266 return $lng->txt(
'trac_mode_objectives');
268 case self::LP_MODE_COLLECTION:
269 return $lng->txt(
'trac_mode_collection');
271 case self::LP_MODE_SCORM:
272 return $lng->txt(
'trac_mode_scorm');
274 case self::LP_MODE_TEST_FINISHED:
275 return $lng->txt(
'trac_mode_test_finished');
277 case self::LP_MODE_TEST_PASSED:
278 return $lng->txt(
'trac_mode_test_passed');
280 case self::LP_MODE_EXERCISE_RETURNED:
281 return $lng->txt(
'trac_mode_exercise_returned');
283 case self::LP_MODE_SCORM_PACKAGE:
284 return $lng->txt(
'trac_mode_scorm_package');
286 case self::LP_MODE_EVENT:
287 return $lng->txt(
'trac_mode_event');
289 case self::LP_MODE_PLUGIN:
290 return $lng->txt(
'trac_mode_plugin');
292 case self::LP_MODE_COLLECTION_MANUAL:
293 return $lng->txt(
'trac_mode_collection_manual');
295 case self::LP_MODE_COLLECTION_TLT:
296 return $lng->txt(
'trac_mode_collection_tlt');
306 case self::LP_MODE_DEACTIVATED:
307 return $lng->txt(
'trac_mode_deactivated_info_new');
309 case self::LP_MODE_TLT:
310 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
313 case self::LP_MODE_VISITS:
314 return $lng->txt(
'trac_mode_visits_info');
316 case self::LP_MODE_MANUAL:
317 return $lng->txt(
'trac_mode_manual_info');
319 case self::LP_MODE_MANUAL_BY_TUTOR:
320 return $lng->txt(
'trac_mode_manual_by_tutor_info');
322 case self::LP_MODE_OBJECTIVES:
323 return $lng->txt(
'trac_mode_objectives_info');
325 case self::LP_MODE_COLLECTION:
326 return $lng->txt(
'trac_mode_collection_info');
328 case self::LP_MODE_SCORM:
329 return $lng->txt(
'trac_mode_scorm_info');
331 case self::LP_MODE_TEST_FINISHED:
332 return $lng->txt(
'trac_mode_test_finished_info');
334 case self::LP_MODE_TEST_PASSED:
335 return $lng->txt(
'trac_mode_test_passed_info');
337 case self::LP_MODE_EXERCISE_RETURNED:
338 return $lng->txt(
'trac_mode_exercise_returned_info');
340 case self::LP_MODE_SCORM_PACKAGE:
341 return $lng->txt(
'trac_mode_scorm_package_info');
343 case self::LP_MODE_EVENT:
344 return $lng->txt(
'trac_mode_event_info');
346 case self::LP_MODE_COLLECTION_MANUAL:
347 return $lng->txt(
'trac_mode_collection_manual_info');
349 case self::LP_MODE_COLLECTION_TLT:
350 return $lng->txt(
'trac_mode_collection_tlt_info');