ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLPObjSettings Class Reference
+ Collaboration diagram for ilLPObjSettings:

Public Member Functions

 ilLPObjSettings ($a_obj_id)
 cloneSettings ($a_new_obj_id)
 Clone settings.
 getVisits ()
 setVisits ($a_visits)
 setMode ($a_mode)
 getMode ()
 getObjId ()
 getObjType ()
 update ()
 insert ()
 _lookupVisits ($a_obj_id)
 _isContainer ($a_mode)
 _delete ($a_obj_id)
 _lookupMode ($a_obj_id)
 getValidModes ()
 _mode2Text ($a_mode)
 _checkObjectives ($a_obj_id)
 _checkSCORMPreconditions ($a_obj_id)
 __read ()
 __getDefaultMode ($a_obj_id, $a_type)

Static Public Member Functions

static _mode2InfoText ($a_mode)
 get mode info text

Data Fields

 $db = null
 $obj_id = null
 $obj_type = null
 $obj_mode = null
 $visits = null
 $is_stored = false

Detailed Description

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

Member Function Documentation

ilLPObjSettings::__getDefaultMode (   $a_obj_id,
  $a_type 
)

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

References _checkObjectives(), LP_MODE_DEACTIVATED, LP_MODE_EVENT, LP_MODE_EXERCISE_RETURNED, LP_MODE_MANUAL, LP_MODE_MANUAL_BY_TUTOR, LP_MODE_OBJECTIVES, and LP_MODE_TEST_PASSED.

Referenced by _lookupMode(), and ilLPObjSettings().

{
global $ilDB;
#$type = strlen($a_type) ? $a_type : $this->obj_type;
switch($a_type)
{
case 'crs':
// If objectives are enabled return deactivated
{
}
case 'dbk':
case 'lm':
case 'htlm':
case 'sahs':
case 'dbk':
case 'tst':
case 'exc':
case 'grp':
case 'fold':
case 'sess':
return LP_MODE_EVENT;
default:
return LP_MODE_UNDEFINED;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPObjSettings::__read ( )

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

References $res, _checkObjectives(), _checkSCORMPreconditions(), DB_FETCHMODE_OBJECT, LP_MODE_OBJECTIVES, and LP_MODE_SCORM.

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

{
$res = $this->db->query("SELECT * FROM ut_lp_settings WHERE obj_id = ".$this->db->quote($this->obj_id)." ");
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->is_stored = true;
$this->obj_type = $row->obj_type;
$this->obj_mode = $row->mode;
$this->visits = $row->visits;
{
$this->obj_mode = LP_MODE_OBJECTIVES;
}
{
$this->obj_mode = LP_MODE_SCORM;
}
return true;
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPObjSettings::_checkObjectives (   $a_obj_id)

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

References ilObjCourse\_lookupViewMode(), and IL_CRS_VIEW_OBJECTIVE.

Referenced by __getDefaultMode(), __read(), _lookupMode(), and getValidModes().

{
global $ilDB,$ilObjDataCache;
// Return deactivate for course with objective view
if($ilObjDataCache->lookupType($a_obj_id) == 'crs')
{
include_once 'Modules/Course/classes/class.ilObjCourse.php';
{
return true;
}
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPObjSettings::_checkSCORMPreconditions (   $a_obj_id)

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

References ilConditionHandler\_getConditionsOfTrigger().

Referenced by __read(), _lookupMode(), and getValidModes().

{
global $ilObjDataCache;
if($ilObjDataCache->lookupType($a_obj_id) != 'sahs')
{
return false;
}
include_once('classes/class.ilConditionHandler.php');
if(count($conditions = ilConditionHandler::_getConditionsOfTrigger('sahs',$a_obj_id)))
{
return true;
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPObjSettings::_delete (   $a_obj_id)

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

{
global $ilDB;
$query = "DELETE FROM ut_lp_settings WHERE obj_id = '".$a_obj_id."'";
$ilDB->query($query);
return true;
}
ilLPObjSettings::_isContainer (   $a_mode)
ilLPObjSettings::_lookupMode (   $a_obj_id)

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

References $res, __getDefaultMode(), _checkObjectives(), _checkSCORMPreconditions(), DB_FETCHMODE_OBJECT, LP_MODE_OBJECTIVES, and LP_MODE_SCORM.

Referenced by ilPDFPresentation\__createObjectDetails(), ilLPFilter\__getAllObjects(), ilLPListOfProgressGUI\__initDetails(), ilLPListOfObjectsGUI\__initDetails(), ilLearningProgressBaseGUI\__readItemStatusInfo(), ilLPItemListGUI\__readMode(), ilLPListOfSettingsGUI\__showCollectionTable(), ilLPListOfObjectsGUI\__showEditUser(), ilLearningProgressBaseGUI\__showObjectDetails(), ilLPStatusFactory\_getClassById(), ilLPStatusFactory\_getInstance(), ilLPCollections\_getItems(), ilCourseItems\_hasCollectionTimings(), ilLearningProgressAccess\checkAccess(), ilObjGroupGUI\membersObject(), ilObjCourseGUI\membersObject(), ilObjCourseGUI\printMembersObject(), ilLPFilter\searchFilterListener(), and ilInfoScreenGUI\showLearningProgress().

{
global $ilDB,$ilObjDataCache;
{
}
{
return LP_MODE_SCORM;
}
$query = "SELECT mode FROM ut_lp_settings ".
"WHERE obj_id = '".$a_obj_id."'";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->mode;
}
// no db entry exists => return default mode by type
return ilLPObjSettings::__getDefaultMode($a_obj_id,$ilObjDataCache->lookupType($a_obj_id));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPObjSettings::_lookupVisits (   $a_obj_id)

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

References $res, DB_FETCHMODE_OBJECT, and LP_DEFAULT_VISITS.

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

{
global $ilDB;
#echo $a_obj_id;
$query = "SELECT visits FROM ut_lp_settings ".
"WHERE obj_id = '".$a_obj_id."'";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->visits;
}
}

+ Here is the caller graph for this function:

static ilLPObjSettings::_mode2InfoText (   $a_mode)
static

get mode info text

public

Parameters
int$mode

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

References $lng, LP_MODE_COLLECTION, LP_MODE_DEACTIVATED, LP_MODE_EVENT, LP_MODE_EXERCISE_RETURNED, LP_MODE_MANUAL, LP_MODE_MANUAL_BY_TUTOR, LP_MODE_OBJECTIVES, LP_MODE_SCORM, LP_MODE_SCORM_PACKAGE, LP_MODE_TEST_FINISHED, LP_MODE_TEST_PASSED, LP_MODE_TLT, and LP_MODE_VISITS.

Referenced by ilLPListOfSettingsGUI\showModeSelection().

{
global $lng;
switch($a_mode)
{
return $lng->txt('trac_mode_deactivated_info');
return $lng->txt('trac_mode_tlt_info');
return $lng->txt('trac_mode_visits_info');
return $lng->txt('trac_mode_manual_info');
return $lng->txt('trac_mode_manual_by_tutor_info');
return $lng->txt('trac_mode_objectives_info');
return $lng->txt('trac_mode_collection_info');
return $lng->txt('trac_mode_scorm_info');
return $lng->txt('trac_mode_test_finished_info');
return $lng->txt('trac_mode_test_passed_info');
return $lng->txt('trac_mode_exercise_returned_info');
return $lng->txt('trac_mode_scorm_package_info');
return $lng->txt('trac_mode_event_info');
}
}

+ Here is the caller graph for this function:

ilLPObjSettings::_mode2Text (   $a_mode)

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

References $lng, LP_MODE_COLLECTION, LP_MODE_DEACTIVATED, LP_MODE_EVENT, LP_MODE_EXERCISE_RETURNED, LP_MODE_MANUAL, LP_MODE_MANUAL_BY_TUTOR, LP_MODE_OBJECTIVES, LP_MODE_SCORM, LP_MODE_SCORM_PACKAGE, LP_MODE_TEST_FINISHED, LP_MODE_TEST_PASSED, LP_MODE_TLT, and LP_MODE_VISITS.

Referenced by ilLPListOfSettingsGUI\__showCollectionTable(), ilLearningProgressBaseGUI\__showObjectDetails(), ilLPItemListGUI\renderObjectInfo(), and ilLPItemListGUI\renderObjectInfoXML().

{
global $lng;
switch($a_mode)
{
return $lng->txt('trac_mode_deactivated');
return $lng->txt('trac_mode_tlt');
return $lng->txt('trac_mode_visits');
return $lng->txt('trac_mode_manual');
return $lng->txt('trac_mode_manual_by_tutor');
return $lng->txt('trac_mode_objectives');
return $lng->txt('trac_mode_collection');
return $lng->txt('trac_mode_scorm');
return $lng->txt('trac_mode_test_finished');
return $lng->txt('trac_mode_test_passed');
return $lng->txt('trac_mode_exercise_returned');
return $lng->txt('trac_mode_scorm_package');
return $lng->txt('trac_mode_event');
}
}

+ Here is the caller graph for this function:

ilLPObjSettings::cloneSettings (   $a_new_obj_id)

Clone settings.

public

Parameters
intnew obj id

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

References getMode(), getObjType(), and getVisits().

{
$query = "INSERT INTO ut_lp_settings ".
"SET obj_id = ".$this->db->quote($a_new_obj_id).", ".
"obj_type = ".$this->db->quote($this->getObjType()).", ".
"mode = ".$this->db->quote($this->getMode()).", ".
"visits = ".$this->db->quote($this->getVisits());
$this->db->query($query);
return true;
}

+ Here is the call graph for this function:

ilLPObjSettings::getMode ( )

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

References $obj_mode.

Referenced by cloneSettings().

{
}

+ Here is the caller graph for this function:

ilLPObjSettings::getObjId ( )

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

References $obj_id.

Referenced by getValidModes().

{
return (int) $this->obj_id;
}

+ Here is the caller graph for this function:

ilLPObjSettings::getObjType ( )

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

References $obj_type.

Referenced by cloneSettings().

{
}

+ Here is the caller graph for this function:

ilLPObjSettings::getValidModes ( )

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

References $lng, _checkObjectives(), _checkSCORMPreconditions(), ilLPCollections\_getCountPossibleSAHSItems(), ilObjSAHSLearningModule\_lookupSubType(), getObjId(), LP_MODE_COLLECTION, LP_MODE_DEACTIVATED, LP_MODE_EVENT, LP_MODE_EXERCISE_RETURNED, LP_MODE_MANUAL, LP_MODE_MANUAL_BY_TUTOR, LP_MODE_OBJECTIVES, LP_MODE_SCORM, LP_MODE_SCORM_PACKAGE, LP_MODE_TEST_FINISHED, LP_MODE_TEST_PASSED, LP_MODE_TLT, and LP_MODE_VISITS.

{
global $lng;
switch($this->obj_type)
{
case 'crs':
{
return array(LP_MODE_OBJECTIVES => $lng->txt('trac_mode_objectives'));
}
return array(LP_MODE_DEACTIVATED => $lng->txt('trac_mode_deactivated'),
LP_MODE_MANUAL_BY_TUTOR => $lng->txt('trac_mode_manual_by_tutor'),
LP_MODE_COLLECTION => $lng->txt('trac_mode_collection'));
break;
case 'dbk':
case 'lm':
return array(LP_MODE_MANUAL => $lng->txt('trac_mode_manual'),
LP_MODE_VISITS => $lng->txt('trac_mode_visits'),
LP_MODE_TLT => $lng->txt('trac_mode_tlt'),
LP_MODE_DEACTIVATED => $lng->txt('trac_mode_deactivated'));
case 'htlm':
return array(LP_MODE_DEACTIVATED => $lng->txt('trac_mode_deactivated'),
LP_MODE_MANUAL => $lng->txt('trac_mode_manual'));
case 'sahs':
include_once './Services/Tracking/classes/class.ilLPCollections.php';
include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
if ($subtype != "scorm2004")
{
{
return array(LP_MODE_SCORM => $lng->txt('trac_mode_scorm_aicc'));
}
{
return array(LP_MODE_DEACTIVATED => $lng->txt('trac_mode_deactivated'),
LP_MODE_SCORM => $lng->txt('trac_mode_scorm_aicc'));
}
return array(LP_MODE_DEACTIVATED => $lng->txt('trac_mode_deactivated'));
}
else
{
{
return array(LP_MODE_SCORM => $lng->txt('trac_mode_scorm_aicc'),
LP_MODE_SCORM_PACKAGE => $lng->txt('trac_mode_scorm_package'));
}
{
return array(LP_MODE_DEACTIVATED => $lng->txt('trac_mode_deactivated'),
LP_MODE_SCORM_PACKAGE => $lng->txt('trac_mode_scorm_package'),
LP_MODE_SCORM => $lng->txt('trac_mode_scorm_aicc'));
}
return array(LP_MODE_DEACTIVATED => $lng->txt('trac_mode_deactivated'),
LP_MODE_SCORM_PACKAGE => $lng->txt('trac_mode_scorm_package'));
}
break;
case 'tst':
return array(LP_MODE_TEST_FINISHED => $lng->txt('trac_mode_test_finished'),
LP_MODE_TEST_PASSED => $lng->txt('trac_mode_test_passed'),
LP_MODE_DEACTIVATED => $lng->txt('trac_mode_deactivated'));
case 'exc':
return array(LP_MODE_DEACTIVATED => $lng->txt('trac_mode_deactivated'),
LP_MODE_EXERCISE_RETURNED => $lng->txt('trac_mode_exercise_returned'));
case 'grp':
return array(LP_MODE_DEACTIVATED => $lng->txt('trac_mode_deactivated'),
LP_MODE_MANUAL_BY_TUTOR => $lng->txt('trac_mode_manual_by_tutor'),
LP_MODE_COLLECTION => $lng->txt('trac_mode_collection'));
case 'fold':
return array(LP_MODE_DEACTIVATED => $lng->txt('trac_mode_deactivated'),
LP_MODE_COLLECTION => $lng->txt('trac_mode_collection'));
case 'sess':
return array(LP_MODE_EVENT => $this->lng->txt('trac_mode_event'));
default:
return array();
}
}

+ Here is the call graph for this function:

ilLPObjSettings::getVisits ( )

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

References LP_DEFAULT_VISITS.

Referenced by cloneSettings().

{
return (int) $this->visits ? $this->visits : LP_DEFAULT_VISITS;
}

+ Here is the caller graph for this function:

ilLPObjSettings::ilLPObjSettings (   $a_obj_id)

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

References __getDefaultMode(), and __read().

{
global $ilObjDataCache,$ilDB;
$this->db =& $ilDB;
$this->obj_id = $a_obj_id;
if(!$this->__read())
{
$this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
$this->obj_mode = $this->__getDefaultMode($this->obj_id,$this->obj_type);
}
}

+ Here is the call graph for this function:

ilLPObjSettings::insert ( )

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

References __read().

Referenced by update().

{
$query = "INSERT INTO ut_lp_settings SET obj_id = '".$this->obj_id."', ".
"obj_type = '".$this->obj_type."', ".
"mode = '".$this->obj_mode."'";
$this->db->query($query);
$this->__read();
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPObjSettings::setMode (   $a_mode)

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

{
$this->obj_mode = $a_mode;
}
ilLPObjSettings::setVisits (   $a_visits)

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

{
$this->visits = $a_visits;
}
ilLPObjSettings::update ( )

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

References __read(), and insert().

{
if(!$this->is_stored)
{
return $this->insert();
}
$query = "UPDATE ut_lp_settings SET mode = '".$this->obj_mode.
"', visits = '".$this->visits."' ".
"WHERE obj_id = '".$this->getObjId()."'";
$this->db->query($query);
$this->__read();
return true;
}

+ Here is the call graph for this function:

Field Documentation

ilLPObjSettings::$db = null

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

ilLPObjSettings::$is_stored = false

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

ilLPObjSettings::$obj_id = null

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

Referenced by getObjId().

ilLPObjSettings::$obj_mode = null

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

Referenced by getMode().

ilLPObjSettings::$obj_type = null

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

Referenced by getObjType().

ilLPObjSettings::$visits = null

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


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