ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilLPObjSettings Class Reference
+ Collaboration diagram for ilLPObjSettings:

Public Member Functions

 __construct ($a_obj_id)
 
 cloneSettings ($a_new_obj_id)
 Clone settings. More...
 
 getVisits ()
 
 setVisits ($a_visits)
 
 setMode ($a_mode)
 
 getMode ()
 
 getObjId ()
 
 getObjType ()
 
 __read ()
 
 update ($a_refresh_lp=true)
 
 insert ()
 

Static Public Member Functions

static _delete ($a_obj_id)
 
static _lookupVisits ($a_obj_id)
 
static _lookupDBModeForObjects (array $a_obj_ids)
 
static _lookupDBMode ($a_obj_id)
 
static _mode2Text ($a_mode)
 
static _mode2InfoText ($a_mode)
 
static getClassMap ()
 
static _deleteByObjId ($a_obj_id)
 

Data Fields

 $db = null
 
 $obj_id = null
 
 $obj_type = null
 
 $obj_mode = null
 
 $visits = null
 
 $is_stored = false
 
const LP_MODE_DEACTIVATED = 0
 
const LP_MODE_TLT = 1
 
const LP_MODE_VISITS = 2
 
const LP_MODE_MANUAL = 3
 
const LP_MODE_OBJECTIVES = 4
 
const LP_MODE_COLLECTION = 5
 
const LP_MODE_SCORM = 6
 
const LP_MODE_TEST_FINISHED = 7
 
const LP_MODE_TEST_PASSED = 8
 
const LP_MODE_EXERCISE_RETURNED = 9
 
const LP_MODE_EVENT = 10
 
const LP_MODE_MANUAL_BY_TUTOR = 11
 
const LP_MODE_SCORM_PACKAGE = 12
 
const LP_MODE_UNDEFINED = 13
 
const LP_MODE_PLUGIN = 14
 
const LP_MODE_COLLECTION_TLT = 15
 
const LP_MODE_COLLECTION_MANUAL = 16
 
const LP_MODE_QUESTIONS = 17
 
const LP_MODE_SURVEY_FINISHED = 18
 
const LP_MODE_VISITED_PAGES = 19
 
const LP_MODE_CONTENT_VISITED = 20
 
const LP_MODE_COLLECTION_MOBS = 21
 
const LP_MODE_STUDY_PROGRAMME = 22
 
const LP_MODE_INDIVIDUAL_ASSESSMENT = 23
 
const LP_DEFAULT_VISITS = 30
 

Protected Member Functions

 doLPRefresh ()
 

Static Protected Attributes

static $map
 

Detailed Description

Definition at line 14 of file class.ilLPObjSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilLPObjSettings::__construct (   $a_obj_id)

Definition at line 126 of file class.ilLPObjSettings.php.

References $DIC, $ilDB, __read(), and ilObjectLP\getInstance().

127  {
128  global $DIC;
129 
130  $ilObjDataCache = $DIC['ilObjDataCache'];
131  $ilDB = $DIC['ilDB'];
132 
133  $this->db = $ilDB;
134  $this->obj_id = $a_obj_id;
135 
136  if (!$this->__read()) {
137  $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
138 
139  include_once "Services/Object/classes/class.ilObjectLP.php";
140  $olp = ilObjectLP::getInstance($this->obj_id);
141  $this->obj_mode = $olp->getDefaultMode();
142  }
143  }
global $DIC
Definition: saml.php:7
global $ilDB
static getInstance($a_obj_id)
+ Here is the call graph for this function:

Member Function Documentation

◆ __read()

ilLPObjSettings::__read ( )

Definition at line 199 of file class.ilLPObjSettings.php.

References $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by __construct(), insert(), and update().

200  {
201  $res = $this->db->query("SELECT * FROM ut_lp_settings WHERE obj_id = " .
202  $this->db->quote($this->obj_id, 'integer'));
203  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
204  $this->is_stored = true;
205  $this->obj_type = $row->obj_type;
206  $this->obj_mode = $row->u_mode;
207  $this->visits = $row->visits;
208 
209  return true;
210  }
211 
212  return false;
213  }
foreach($_POST as $key=> $value) $res
$row
+ Here is the caller graph for this function:

◆ _delete()

static ilLPObjSettings::_delete (   $a_obj_id)
static

Definition at line 265 of file class.ilLPObjSettings.php.

References $DIC, $ilDB, $query, and $res.

266  {
267  global $DIC;
268 
269  $ilDB = $DIC['ilDB'];
270 
271  $query = "DELETE FROM ut_lp_settings WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer');
272  $res = $ilDB->manipulate($query);
273 
274  return true;
275  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
global $ilDB

◆ _deleteByObjId()

static ilLPObjSettings::_deleteByObjId (   $a_obj_id)
static

Definition at line 374 of file class.ilLPObjSettings.php.

References $DIC, and $ilDB.

Referenced by ilObject\countReferences().

375  {
376  global $DIC;
377 
378  $ilDB = $DIC['ilDB'];
379 
380  // we are only removing settings for now
381  // invalid ut_lp_collections-entries are filtered
382  // ut_lp_marks is deemed private user data
383 
384  $ilDB->manipulate("DELETE FROM ut_lp_settings" .
385  " WHERE obj_id = " . $ilDB->quote($a_obj_id, "integer"));
386  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupDBMode()

static ilLPObjSettings::_lookupDBMode (   $a_obj_id)
static

Definition at line 316 of file class.ilLPObjSettings.php.

References $DIC, $ilDB, $query, and $row.

Referenced by ilObjectLP\getCurrentMode().

317  {
318  global $DIC;
319 
320  $ilDB = $DIC['ilDB'];
321 
322  // this does NOT handle default mode!
323 
324  $query = "SELECT u_mode FROM ut_lp_settings" .
325  " WHERE obj_id = " . $ilDB->quote($a_obj_id, "integer");
326  $set = $ilDB->query($query);
327  $row = $ilDB->fetchAssoc($set);
328  if (is_array($row)) {
329  return $row['u_mode'];
330  }
331  }
global $DIC
Definition: saml.php:7
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupDBModeForObjects()

static ilLPObjSettings::_lookupDBModeForObjects ( array  $a_obj_ids)
static

Definition at line 296 of file class.ilLPObjSettings.php.

References $DIC, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilLPStatus\checkLPModesForObjects(), and ilTimingsUser\getObjectsWithInactiveLP().

297  {
298  global $DIC;
299 
300  $ilDB = $DIC['ilDB'];
301 
302  // this does NOT handle default mode!
303 
304  $res = array();
305 
306  $query = "SELECT obj_id, u_mode FROM ut_lp_settings" .
307  " WHERE " . $ilDB->in("obj_id", $a_obj_ids, "", "integer");
308  $set = $ilDB->query($query);
309  while ($row = $set->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
310  $res[$row->obj_id] = $row->u_mode;
311  }
312 
313  return $res;
314  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupVisits()

static ilLPObjSettings::_lookupVisits (   $a_obj_id)
static

Definition at line 280 of file class.ilLPObjSettings.php.

References $DIC, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilLearningProgressBaseGUI\__readItemStatusInfo(), ilLearningProgressBaseGUI\__showObjectDetails(), ilLPStatusVisits\_getStatusInfo(), and ilLPStatusVisits\determinePercentage().

281  {
282  global $DIC;
283 
284  $ilDB = $DIC['ilDB'];
285 
286  $query = "SELECT visits FROM ut_lp_settings " .
287  "WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer');
288 
289  $res = $ilDB->query($query);
290  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
291  return $row->visits;
292  }
293  return self::LP_DEFAULT_VISITS;
294  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ _mode2InfoText()

static ilLPObjSettings::_mode2InfoText (   $a_mode)
static

Definition at line 345 of file class.ilLPObjSettings.php.

References $DIC, $info, $lng, $map, and ilObjUserTracking\_getValidTimeSpan().

Referenced by ilObjectLP\getModeInfoText().

346  {
347  global $DIC;
348 
349  $lng = $DIC['lng'];
350 
351  if (array_key_exists($a_mode, self::$map) &&
352  is_array(self::$map[$a_mode])) {
353  $info = $lng->txt(self::$map[$a_mode][2]);
354 
355  if ($a_mode == self::LP_MODE_TLT) {
356  // dynamic content
357  include_once 'Services/Tracking/classes/class.ilObjUserTracking.php';
359  }
360 
361  return $info;
362  }
363  }
global $DIC
Definition: saml.php:7
$lng
$info
Definition: index.php:5
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _mode2Text()

static ilLPObjSettings::_mode2Text (   $a_mode)
static

Definition at line 333 of file class.ilLPObjSettings.php.

References $DIC, $lng, and $map.

Referenced by ilLPProgressTableGUI\fillRowCSV(), ilLPProgressTableGUI\fillRowExcel(), ilObjectLP\getModeText(), ilObjUserTrackingGUI\initLPDefaultsForm(), and ilConditionHandlerGUI\translateOperator().

334  {
335  global $DIC;
336 
337  $lng = $DIC['lng'];
338 
339  if (array_key_exists($a_mode, self::$map) &&
340  is_array(self::$map[$a_mode])) {
341  return $lng->txt(self::$map[$a_mode][1]);
342  }
343  }
global $DIC
Definition: saml.php:7
$lng
+ Here is the caller graph for this function:

◆ cloneSettings()

ilLPObjSettings::cloneSettings (   $a_new_obj_id)

Clone settings.

public

Parameters
intnew obj id

Definition at line 152 of file class.ilLPObjSettings.php.

References $DIC, $ilDB, $query, $res, getMode(), getObjType(), and getVisits().

153  {
154  global $DIC;
155 
156  $ilDB = $DIC['ilDB'];
157 
158  $query = "INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) " .
159  "VALUES( " .
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') .
164  ")";
165  $res = $ilDB->manipulate($query);
166  return true;
167  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:

◆ doLPRefresh()

ilLPObjSettings::doLPRefresh ( )
protected

Definition at line 258 of file class.ilLPObjSettings.php.

References ilLPStatusWrapper\_refreshStatus(), and getObjId().

Referenced by insert(), and update().

259  {
260  // refresh learning progress
261  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
263  }
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getClassMap()

static ilLPObjSettings::getClassMap ( )
static

Definition at line 365 of file class.ilLPObjSettings.php.

References $map, and $res.

Referenced by ilLPStatusFactory\_getClassById(), and ilLPStatusFactory\_getInstance().

366  {
367  $res = array();
368  foreach (self::$map as $mode => $item) {
369  $res[$mode] = $item[0];
370  }
371  return $res;
372  }
foreach($_POST as $key=> $value) $res
+ Here is the caller graph for this function:

◆ getMode()

ilLPObjSettings::getMode ( )

Definition at line 184 of file class.ilLPObjSettings.php.

References $obj_mode.

Referenced by cloneSettings(), ilCertificateSettingsCourseFormRepository\createForm(), insert(), and update().

185  {
186  return $this->obj_mode;
187  }
+ Here is the caller graph for this function:

◆ getObjId()

ilLPObjSettings::getObjId ( )

Definition at line 189 of file class.ilLPObjSettings.php.

References $obj_id.

Referenced by doLPRefresh(), insert(), and update().

190  {
191  return (int) $this->obj_id;
192  }
+ Here is the caller graph for this function:

◆ getObjType()

ilLPObjSettings::getObjType ( )

Definition at line 194 of file class.ilLPObjSettings.php.

References $obj_type.

Referenced by cloneSettings(), and insert().

195  {
196  return $this->obj_type;
197  }
+ Here is the caller graph for this function:

◆ getVisits()

ilLPObjSettings::getVisits ( )

Definition at line 169 of file class.ilLPObjSettings.php.

Referenced by cloneSettings(), insert(), and update().

170  {
171  return (int) $this->visits ? $this->visits : self::LP_DEFAULT_VISITS;
172  }
+ Here is the caller graph for this function:

◆ insert()

ilLPObjSettings::insert ( )

Definition at line 237 of file class.ilLPObjSettings.php.

References $DIC, $ilDB, $query, $res, __read(), doLPRefresh(), getMode(), getObjId(), getObjType(), and getVisits().

Referenced by update().

238  {
239  global $DIC;
240 
241  $ilDB = $DIC['ilDB'];
242 
243  $query = "INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) " .
244  "VALUES(" .
245  $ilDB->quote($this->getObjId(), 'integer') . ", " .
246  $ilDB->quote($this->getObjType(), 'text') . ", " .
247  $ilDB->quote($this->getMode(), 'integer') . ", " .
248  $ilDB->quote($this->getVisits(), 'integer') . // #12482
249  ")";
250  $res = $ilDB->manipulate($query);
251  $this->__read();
252 
253  $this->doLPRefresh();
254 
255  return true;
256  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMode()

ilLPObjSettings::setMode (   $a_mode)

Definition at line 179 of file class.ilLPObjSettings.php.

Referenced by ilLearningSequenceImporter\buildLPSettings(), ilObjSessionGUI\createRecurringSessions(), and ilObjSessionGUI\saveObject().

180  {
181  $this->obj_mode = $a_mode;
182  }
+ Here is the caller graph for this function:

◆ setVisits()

ilLPObjSettings::setVisits (   $a_visits)

Definition at line 174 of file class.ilLPObjSettings.php.

175  {
176  $this->visits = $a_visits;
177  }

◆ update()

ilLPObjSettings::update (   $a_refresh_lp = true)

Definition at line 215 of file class.ilLPObjSettings.php.

References $DIC, $ilDB, $query, $res, __read(), doLPRefresh(), getMode(), getObjId(), getVisits(), and insert().

216  {
217  global $DIC;
218 
219  $ilDB = $DIC['ilDB'];
220 
221  if (!$this->is_stored) {
222  return $this->insert();
223  }
224  $query = "UPDATE ut_lp_settings SET u_mode = " . $ilDB->quote($this->getMode(), 'integer') . ", " .
225  "visits = " . $ilDB->quote($this->getVisits(), 'integer') . " " .
226  "WHERE obj_id = " . $ilDB->quote($this->getObjId(), 'integer');
227  $res = $ilDB->manipulate($query);
228  $this->__read();
229 
230  if ($a_refresh_lp) {
231  $this->doLPRefresh();
232  }
233 
234  return true;
235  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilLPObjSettings::$db = null

Definition at line 16 of file class.ilLPObjSettings.php.

◆ $is_stored

ilLPObjSettings::$is_stored = false

Definition at line 23 of file class.ilLPObjSettings.php.

◆ $map

ilLPObjSettings::$map
staticprotected

Definition at line 52 of file class.ilLPObjSettings.php.

◆ $obj_id

ilLPObjSettings::$obj_id = null

Definition at line 18 of file class.ilLPObjSettings.php.

Referenced by getObjId().

◆ $obj_mode

ilLPObjSettings::$obj_mode = null

Definition at line 20 of file class.ilLPObjSettings.php.

Referenced by getMode().

◆ $obj_type

ilLPObjSettings::$obj_type = null

Definition at line 19 of file class.ilLPObjSettings.php.

Referenced by getObjType().

◆ $visits

ilLPObjSettings::$visits = null

Definition at line 21 of file class.ilLPObjSettings.php.

◆ LP_DEFAULT_VISITS

const ilLPObjSettings::LP_DEFAULT_VISITS = 30

Definition at line 50 of file class.ilLPObjSettings.php.

◆ LP_MODE_COLLECTION

◆ LP_MODE_COLLECTION_MANUAL

◆ LP_MODE_COLLECTION_MOBS

◆ LP_MODE_COLLECTION_TLT

◆ LP_MODE_CONTENT_VISITED

const ilLPObjSettings::LP_MODE_CONTENT_VISITED = 20

◆ LP_MODE_DEACTIVATED

const ilLPObjSettings::LP_MODE_DEACTIVATED = 0

Definition at line 25 of file class.ilLPObjSettings.php.

Referenced by ilLPStatus\checkLPModesForObjects(), ilCertificateSettingsCourseFormRepository\createForm(), ilObjSessionGUI\createRecurringSessions(), ilCertificateCourseLearningProgressEvaluation\evaluate(), ilLPCollectionSettingsTableGUI\fillRow(), ilObjectLP\getCurrentMode(), ilLSLP\getDefaultMode(), ilFileLP\getDefaultMode(), ilSurveyLP\getDefaultMode(), ilMediaCastLP\getDefaultMode(), ilFolderLP\getDefaultMode(), ilScormLP\getDefaultMode(), ilGroupLP\getDefaultMode(), ilLSLP\getDefaultModes(), ilMediaCastLP\getDefaultModes(), ilFileLP\getDefaultModes(), ilSurveyLP\getDefaultModes(), ilCourseLP\getDefaultModes(), ilHTMLLearningModuleLP\getDefaultModes(), ilSessionLP\getDefaultModes(), ilLearningModuleLP\getDefaultModes(), ilFolderLP\getDefaultModes(), ilExerciseLP\getDefaultModes(), ilGroupLP\getDefaultModes(), ilStudyProgrammeLP\getDefaultModes(), ilTestLP\getDefaultModes(), ilScormLP\getDefaultModes(), ilCertificateGUI\getEditorForm(), ilCourseLPBadgeGUI\getInvalidLPModes(), ilCertificateSettingsCourseFormRepository\getInvalidLPModes(), ilTimingsUser\getObjectsWithInactiveLP(), ilContentPageLP\getValidModes(), ilIndividualAssessmentLP\getValidModes(), ilLSLP\getValidModes(), ilFolderLP\getValidModes(), ilSurveyLP\getValidModes(), ilMediaCastLP\getValidModes(), ilSessionLP\getValidModes(), ilFileLP\getValidModes(), ilExerciseLP\getValidModes(), ilStudyProgrammeLP\getValidModes(), ilTestLP\getValidModes(), ilScormLP\getValidModes(), ilHTMLLearningModuleLP\getValidModes(), ilGroupLP\getValidModes(), ilLearningModuleLP\getValidModes(), ilCourseLP\getValidModes(), ilLTIAppEventListener\handleOutcomeWithoutLP(), ilObjUserTrackingGUI\initLPDefaultsForm(), ilObjectLP\isActive(), ilObjUserTrackingGUI\saveLPDefaultsObject(), and ilObjSessionGUI\saveObject().

◆ LP_MODE_EVENT

const ilLPObjSettings::LP_MODE_EVENT = 10

◆ LP_MODE_EXERCISE_RETURNED

const ilLPObjSettings::LP_MODE_EXERCISE_RETURNED = 9

◆ LP_MODE_INDIVIDUAL_ASSESSMENT

const ilLPObjSettings::LP_MODE_INDIVIDUAL_ASSESSMENT = 23

◆ LP_MODE_MANUAL

◆ LP_MODE_MANUAL_BY_TUTOR

◆ LP_MODE_OBJECTIVES

◆ LP_MODE_PLUGIN

const ilLPObjSettings::LP_MODE_PLUGIN = 14

◆ LP_MODE_QUESTIONS

const ilLPObjSettings::LP_MODE_QUESTIONS = 17

◆ LP_MODE_SCORM

◆ LP_MODE_SCORM_PACKAGE

const ilLPObjSettings::LP_MODE_SCORM_PACKAGE = 12

Definition at line 37 of file class.ilLPObjSettings.php.

Referenced by ilScormLP\getDefaultModes(), and ilScormLP\getValidModes().

◆ LP_MODE_STUDY_PROGRAMME

const ilLPObjSettings::LP_MODE_STUDY_PROGRAMME = 22

◆ LP_MODE_SURVEY_FINISHED

const ilLPObjSettings::LP_MODE_SURVEY_FINISHED = 18

◆ LP_MODE_TEST_FINISHED

const ilLPObjSettings::LP_MODE_TEST_FINISHED = 7

◆ LP_MODE_TEST_PASSED

◆ LP_MODE_TLT

◆ LP_MODE_UNDEFINED

◆ LP_MODE_VISITED_PAGES

const ilLPObjSettings::LP_MODE_VISITED_PAGES = 19

◆ LP_MODE_VISITS


The documentation for this class was generated from the following file: