ILIAS  eassessment Revision 61809
 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 53 of file class.ilLPObjSettings.php.

Member Function Documentation

ilLPObjSettings::__getDefaultMode (   $a_obj_id,
  $a_type 
)

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

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

Referenced by ilLPStatusFactory\_getClassById(), ilLPStatusFactory\_getInstance(), _lookupMode(), ilTrQuery\getObjectsStatus(), ilTrQuery\getObjectsStatusForUser(), 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:
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPObjSettings::__read ( )

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

References $res, $row, _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 ,'integer'));
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->is_stored = true;
$this->obj_type = $row->obj_type;
$this->obj_mode = $row->u_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 439 of file class.ilLPObjSettings.php.

References $ilDB, 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 456 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 199 of file class.ilLPObjSettings.php.

References $ilDB, $query, and $res.

Referenced by ilTrackingTest\testLPObjectSettings().

{
global $ilDB;
$query = "DELETE FROM ut_lp_settings WHERE obj_id = ".$ilDB->quote($a_obj_id ,'integer');
$res = $ilDB->manipulate($query);
return true;
}

+ Here is the caller graph for this function:

ilLPObjSettings::_isContainer (   $a_mode)

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

References LP_MODE_COLLECTION, LP_MODE_MANUAL_BY_TUTOR, LP_MODE_OBJECTIVES, and LP_MODE_SCORM.

Referenced by ilPDFPresentation\__createObjectDetails(), and ilLPProgressTableGUI\fillRow().

{
return $a_mode == LP_MODE_COLLECTION or
$a_mode == LP_MODE_SCORM or
$a_mode == LP_MODE_OBJECTIVES or
}

+ Here is the caller graph for this function:

ilLPObjSettings::_lookupMode (   $a_obj_id)

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

References $ilDB, $query, $res, $row, __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(), ilLPListOfSettingsGUI\__showCollectionTable(), ilLearningProgressBaseGUI\__showEditUser(), ilLearningProgressBaseGUI\__showObjectDetails(), ilLPStatusFactory\_getClassById(), ilLPStatusFactory\_getInstance(), ilLPCollections\_getItems(), ilCourseItems\_hasCollectionTimings(), ilTimingCache\_showWarning(), ilLearningProgressAccess\checkAccess(), ilTrQuery\getObjectIds(), ilTrObjectUsersPropsTableGUI\getSelectableColumns(), ilTrQuery\getSubTree(), ilTrUserObjectsPropsTableGUI\initFilter(), ilLPTableBaseGUI\isPercentageAvailable(), ilObjGroupGUI\membersObject(), ilObjCourseGUI\membersObject(), ilLPTableBaseGUI\parseTitle(), ilObjCourseGUI\printMembersObject(), ilLPTableBaseGUI\searchFilterListener(), ilLPFilter\searchFilterListener(), and ilInfoScreenGUI\showLearningProgress().

{
global $ilDB,$ilObjDataCache;
{
}
{
return LP_MODE_SCORM;
}
$query = "SELECT u_mode FROM ut_lp_settings ".
"WHERE obj_id = ".$ilDB->quote($a_obj_id ,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->u_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 175 of file class.ilLPObjSettings.php.

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, and LP_DEFAULT_VISITS.

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

{
global $ilDB;
$query = "SELECT visits FROM ut_lp_settings ".
"WHERE obj_id = ".$ilDB->quote($a_obj_id ,'integer');
$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 387 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_new');
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 330 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\__showEditUser(), ilLPProgressTableGUI\fillRow(), ilLPProgressTableGUI\fillRowCSV(), ilLPProgressTableGUI\fillRowExcel(), and ilLPTableBaseGUI\parseTitle().

{
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 86 of file class.ilLPObjSettings.php.

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

{
global $ilDB;
$query = "INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) ".
"VALUES( ".
$this->db->quote($a_new_obj_id ,'integer').", ".
$this->db->quote($this->getObjType() ,'text').", ".
$this->db->quote($this->getMode() ,'integer').", ".
$this->db->quote($this->getVisits() ,'integer').
")";
$res = $ilDB->manipulate($query);
return true;
}

+ Here is the call graph for this function:

ilLPObjSettings::getMode ( )

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

References $obj_mode.

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

{
}

+ Here is the caller graph for this function:

ilLPObjSettings::getObjId ( )

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

References $obj_id.

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

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

+ Here is the caller graph for this function:

ilLPObjSettings::getObjType ( )

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

References $obj_type.

Referenced by cloneSettings(), and insert().

{
}

+ Here is the caller graph for this function:

ilLPObjSettings::getValidModes ( )

Definition at line 235 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':
return array(
LP_MODE_MANUAL => $lng->txt('trac_mode_manual'),
LP_MODE_DEACTIVATE => $lng->txt('trac_mode_deactivated')
);
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 101 of file class.ilLPObjSettings.php.

References LP_DEFAULT_VISITS.

Referenced by cloneSettings(), and update().

{
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 64 of file class.ilLPObjSettings.php.

References $ilDB, __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 150 of file class.ilLPObjSettings.php.

References $ilDB, $ilLog, $query, $res, __read(), ilLPStatusWrapper\_refreshStatus(), getMode(), getObjId(), and getObjType().

Referenced by update().

{
global $ilDB,$ilLog;
$ilLog->logStack();
$query = "INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) ".
"VALUES(".
$ilDB->quote($this->getObjId() ,'integer').", ".
$ilDB->quote($this->getObjType(),'text').", ".
$ilDB->quote($this->getMode(),'integer').", ".
$ilDB->quote(0, 'integer').
")";
$res = $ilDB->manipulate($query);
$this->__read();
// refresh learning progress
include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
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 111 of file class.ilLPObjSettings.php.

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

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

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

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

References $ilDB, $query, $res, __read(), ilLPStatusWrapper\_refreshStatus(), getMode(), getObjId(), getVisits(), and insert().

{
global $ilDB;
if(!$this->is_stored)
{
return $this->insert();
}
$query = "UPDATE ut_lp_settings SET u_mode = ".$ilDB->quote($this->getMode() ,'integer').", ".
"visits = ".$ilDB->quote($this->getVisits() ,'integer')." ".
"WHERE obj_id = ".$ilDB->quote($this->getObjId() ,'integer');
$res = $ilDB->manipulate($query);
$this->__read();
// refresh learning progress
include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
return true;
}

+ Here is the call graph for this function:

Field Documentation

ilLPObjSettings::$db = null

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

ilLPObjSettings::$is_stored = false

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

ilLPObjSettings::$obj_id = null

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

Referenced by getObjId().

ilLPObjSettings::$obj_mode = null

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

Referenced by getMode().

ilLPObjSettings::$obj_type = null

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

Referenced by getObjType().

ilLPObjSettings::$visits = null

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


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