52 protected static $map = array(
54 self::LP_MODE_DEACTIVATED => array(
'ilLPStatus',
55 'trac_mode_deactivated',
'trac_mode_deactivated_info_new')
57 ,self::LP_MODE_TLT => array(
'ilLPStatusTypicalLearningTime',
58 'trac_mode_tlt',
'trac_mode_tlt_info')
60 ,self::LP_MODE_VISITS => array(
'ilLPStatusVisits',
61 'trac_mode_visits',
'trac_mode_visits_info')
63 ,self::LP_MODE_MANUAL => array(
'ilLPStatusManual',
64 'trac_mode_manual',
'trac_mode_manual_info')
66 ,self::LP_MODE_OBJECTIVES => array(
'ilLPStatusObjectives',
67 'trac_mode_objectives',
'trac_mode_objectives_info')
69 ,self::LP_MODE_COLLECTION => array(
'ilLPStatusCollection',
70 'trac_mode_collection',
'trac_mode_collection_info')
72 ,self::LP_MODE_SCORM => array(
'ilLPStatusSCORM',
73 'trac_mode_scorm',
'trac_mode_scorm_info')
75 ,self::LP_MODE_TEST_FINISHED => array(
'ilLPStatusTestFinished',
76 'trac_mode_test_finished',
'trac_mode_test_finished_info')
78 ,self::LP_MODE_TEST_PASSED => array(
'ilLPStatusTestPassed',
79 'trac_mode_test_passed',
'trac_mode_test_passed_info')
81 ,self::LP_MODE_EXERCISE_RETURNED => array(
'ilLPStatusExerciseReturned',
82 'trac_mode_exercise_returned',
'trac_mode_exercise_returned_info')
84 ,self::LP_MODE_EVENT => array(
'ilLPStatusEvent',
85 'trac_mode_event',
'trac_mode_event_info')
87 ,self::LP_MODE_MANUAL_BY_TUTOR => array(
'ilLPStatusManualByTutor',
88 'trac_mode_manual_by_tutor',
'trac_mode_manual_by_tutor_info')
90 ,self::LP_MODE_SCORM_PACKAGE => array(
'ilLPStatusSCORMPackage',
91 'trac_mode_scorm_package',
'trac_mode_scorm_package_info')
93 ,self::LP_MODE_UNDEFINED => null
95 ,self::LP_MODE_PLUGIN => array(
'ilLPStatusPlugin',
96 'trac_mode_plugin',
'')
98 ,self::LP_MODE_COLLECTION_TLT => array(
'ilLPStatusCollectionTLT',
99 'trac_mode_collection_tlt',
'trac_mode_collection_tlt_info')
101 ,self::LP_MODE_COLLECTION_MANUAL => array(
'ilLPStatusCollectionManual',
102 'trac_mode_collection_manual',
'trac_mode_collection_manual_info')
104 ,self::LP_MODE_QUESTIONS => array(
'ilLPStatusQuestions',
105 'trac_mode_questions',
'trac_mode_questions_info')
107 ,self::LP_MODE_SURVEY_FINISHED => array(
'ilLPStatusSurveyFinished',
108 'trac_mode_survey_finished',
'trac_mode_survey_finished_info')
110 ,self::LP_MODE_VISITED_PAGES => array(
'ilLPStatusVisitedPages',
111 'trac_mode_visited_pages',
'trac_mode_visited_pages_info')
113 ,self::LP_MODE_CONTENT_VISITED => array(
'ilLPStatusContentVisited',
114 'trac_mode_content_visited',
'trac_mode_content_visited_info')
116 ,self::LP_MODE_COLLECTION_MOBS => array(
'ilLPStatusCollectionMobs',
117 'trac_mode_collection_mobs',
'trac_mode_collection_mobs_info')
119 ,self::LP_MODE_STUDY_PROGRAMME => array(
'ilLPStatusStudyProgramme',
120 'trac_mode_study_programme',
'')
122 ,self::LP_MODE_INDIVIDUAL_ASSESSMENT => array(
'ilLPStatusIndividualAssessment',
123 'trac_mode_individual_assessment',
'trac_mode_individual_assessment_info')
130 $ilObjDataCache = $DIC[
'ilObjDataCache'];
131 $ilDB = $DIC[
'ilDB'];
134 $this->obj_id = $a_obj_id;
137 $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
139 include_once
"Services/Object/classes/class.ilObjectLP.php";
141 $this->obj_mode = $olp->getDefaultMode();
156 $ilDB = $DIC[
'ilDB'];
158 $query =
"INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) " .
160 $this->db->quote($a_new_obj_id,
'integer') .
", " .
161 $this->db->quote($this->
getObjType(),
'text') .
", " .
162 $this->db->quote($this->
getMode(),
'integer') .
", " .
163 $this->db->quote($this->
getVisits(),
'integer') .
171 return (
int) $this->visits ? $this->visits : self::LP_DEFAULT_VISITS;
176 $this->visits = $a_visits;
181 $this->obj_mode = $a_mode;
201 $res = $this->db->query(
"SELECT * FROM ut_lp_settings WHERE obj_id = " .
202 $this->db->quote($this->obj_id,
'integer'));
204 $this->is_stored =
true;
205 $this->obj_type =
$row->obj_type;
206 $this->obj_mode =
$row->u_mode;
207 $this->visits =
$row->visits;
215 public function update($a_refresh_lp =
true)
219 $ilDB = $DIC[
'ilDB'];
221 if (!$this->is_stored) {
224 $query =
"UPDATE ut_lp_settings SET u_mode = " .
$ilDB->quote($this->
getMode(),
'integer') .
", " .
226 "WHERE obj_id = " .
$ilDB->quote($this->
getObjId(),
'integer');
241 $ilDB = $DIC[
'ilDB'];
243 $query =
"INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) " .
261 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
269 $ilDB = $DIC[
'ilDB'];
271 $query =
"DELETE FROM ut_lp_settings WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer');
284 $ilDB = $DIC[
'ilDB'];
286 $query =
"SELECT visits FROM ut_lp_settings " .
287 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer');
293 return self::LP_DEFAULT_VISITS;
300 $ilDB = $DIC[
'ilDB'];
306 $query =
"SELECT obj_id, u_mode FROM ut_lp_settings" .
307 " WHERE " .
$ilDB->in(
"obj_id", $a_obj_ids,
"",
"integer");
320 $ilDB = $DIC[
'ilDB'];
324 $query =
"SELECT u_mode FROM ut_lp_settings" .
325 " WHERE obj_id = " .
$ilDB->quote($a_obj_id,
"integer");
328 if (is_array(
$row)) {
329 return $row[
'u_mode'];
355 if ($a_mode == self::LP_MODE_TLT) {
357 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
369 $res[$mode] = $item[0];
378 $ilDB = $DIC[
'ilDB'];
384 $ilDB->manipulate(
"DELETE FROM ut_lp_settings" .
385 " WHERE obj_id = " .
$ilDB->quote($a_obj_id,
"integer"));
const LP_MODE_MANUAL_BY_TUTOR
static _delete($a_obj_id)
const LP_MODE_COLLECTION_MANUAL
const LP_MODE_INDIVIDUAL_ASSESSMENT
const LP_MODE_COLLECTION_TLT
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.
const LP_MODE_TEST_FINISHED
update($a_refresh_lp=true)
const LP_MODE_SCORM_PACKAGE
const LP_MODE_EXERCISE_RETURNED
const LP_MODE_VISITED_PAGES
static _lookupDBMode($a_obj_id)
foreach($_POST as $key=> $value) $res
const LP_MODE_STUDY_PROGRAMME
const LP_MODE_TEST_PASSED
const LP_MODE_SURVEY_FINISHED
static _lookupDBModeForObjects(array $a_obj_ids)
static _mode2InfoText($a_mode)
const LP_MODE_DEACTIVATED
static _lookupVisits($a_obj_id)
const LP_MODE_COLLECTION_MOBS
const LP_MODE_CONTENT_VISITED
static _deleteByObjId($a_obj_id)
cloneSettings($a_new_obj_id)
Clone settings.
static getInstance($a_obj_id)
static _getValidTimeSpan()
static _mode2Text($a_mode)