ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLPStatusFactory Class Reference

Class ilLPStatusFactory Creates status class instances for learning progress modes of an object. More...

+ Collaboration diagram for ilLPStatusFactory:

Public Member Functions

 _getClassById ($a_obj_id, $a_mode=NULL)
 _getClassByIdAndType ($a_obj_id, $a_type)
_getInstance ($a_obj_id, $a_mode=NULL)

Static Private Attributes

static $class_by_obj_id = array()

Detailed Description

Class ilLPStatusFactory Creates status class instances for learning progress modes of an object.

E.g obj_id of course returns an instance of ilLPStatusManual, ilLPStatusObjectives ...

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id:
class.ilLPStatusFactory.php 34476 2012-05-07 09:28:05Z akill

Definition at line 17 of file class.ilLPStatusFactory.php.

Member Function Documentation

ilLPStatusFactory::_getClassById (   $a_obj_id,
  $a_mode = NULL 
)

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

References ilLPObjSettings\__getDefaultMode(), ilLPObjSettings\_lookupMode(), ilObject\_lookupType(), exit, 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, LP_MODE_UNDEFINED, and LP_MODE_VISITS.

Referenced by ilLPStatusWrapper\_determineStatus(), ilLPStatusWrapper\_getCompleted(), ilLPStatusWrapper\_getFailed(), ilLPStatusWrapper\_getInProgress(), ilLPStatusWrapper\_getNotAttempted(), ilLPStatusWrapper\_getStatusInfo(), ilLPStatusWrapper\_getTypicalLearningTime(), ilLPStatusWrapper\_refreshStatus(), ilLPStatusWrapper\_setDirty(), ilLPStatusWrapper\_updateStatus(), and ilLPStatus\checkStatusForObject().

{
include_once 'Services/Tracking/classes/class.ilLPObjSettings.php';
if($a_mode === NULL)
{
$a_mode = ilLPObjSettings::_lookupMode($a_obj_id);
// please keep the cache in this if-block, otherwise default values
// will not trigger the include_once calls
if (isset(self::$class_by_obj_id[$a_obj_id]))
{
return self::$class_by_obj_id[$a_obj_id];
}
}
switch($a_mode)
{
include_once 'Services/Tracking/classes/class.ilLPStatusVisits.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusVisits';
include_once 'Services/Tracking/classes/class.ilLPStatusCollection.php';
return self::$class_by_obj_id[$a_obj_id] ='ilLPStatusCollection';
include_once 'Services/Tracking/classes/class.ilLPStatusTypicalLearningTime.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusTypicalLearningTime';
include_once 'Services/Tracking/classes/class.ilLPStatusSCORM.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusSCORM';
include_once 'Services/Tracking/classes/class.ilLPStatus.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatus';
include_once 'Services/Tracking/classes/class.ilLPStatusTestFinished.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusTestFinished';
include_once 'Services/Tracking/classes/class.ilLPStatusTestPassed.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusTestPassed';
include_once 'Services/Tracking/classes/class.ilLPStatusManual.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusManual';
include_once 'Services/Tracking/classes/class.ilLPStatusManualByTutor.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusManualByTutor';
include_once 'Services/Tracking/classes/class.ilLPStatusExerciseReturned.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusExerciseReturned';
include_once 'Services/Tracking/classes/class.ilLPStatusObjectives.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusObjectives';
include_once 'Services/Tracking/classes/class.ilLPStatusSCORMPackage.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusSCORMPackage';
include_once('./Services/Tracking/classes/class.ilLPStatusEvent.php');
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusEvent';
$type = ilObject::_lookupType($a_obj_id);
$mode = ilLPObjSettings::__getDefaultMode($a_obj_id, $type);
if($mode != LP_MODE_UNDEFINED)
{
return self::$class_by_obj_id[$a_obj_id] = self::_getClassById($a_obj_id, $mode);
}
// fallthrough
default:
echo "ilLPStatusFactory: unknown type ".ilLPObjSettings::_lookupMode($a_obj_id);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPStatusFactory::_getClassByIdAndType (   $a_obj_id,
  $a_type 
)

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

References exit.

Referenced by ilLPStatusWrapper\_getCompletedByType(), ilLPStatusWrapper\_getFailedByType(), ilLPStatusWrapper\_getInProgressByType(), ilLPStatusWrapper\_getNotAttemptedByType(), and ilLPStatusWrapper\_getStatusInfoByType().

{
// id is ignored in the moment
switch($a_type)
{
case 'event':
include_once 'Services/Tracking/classes/class.ilLPStatusEvent.php';
return 'ilLPStatusEvent';
default:
echo "ilLPStatusFactory: unknown type: ".$a_type;
}
}

+ Here is the caller graph for this function:

& ilLPStatusFactory::_getInstance (   $a_obj_id,
  $a_mode = NULL 
)

Definition at line 121 of file class.ilLPStatusFactory.php.

References ilLPObjSettings\__getDefaultMode(), ilLPObjSettings\_lookupMode(), ilObject\_lookupType(), exit, LP_MODE_COLLECTION, LP_MODE_EVENT, LP_MODE_EXERCISE_RETURNED, LP_MODE_MANUAL, LP_MODE_MANUAL_BY_TUTOR, LP_MODE_OBJECTIVES, LP_MODE_SCORM, LP_MODE_TEST_FINISHED, LP_MODE_TEST_PASSED, LP_MODE_TLT, LP_MODE_UNDEFINED, and LP_MODE_VISITS.

{
include_once 'Services/Tracking/classes/class.ilLPObjSettings.php';
if($a_mode === NULL)
{
$a_mode = ilLPObjSettings::_lookupMode($a_obj_id);
}
switch($a_mode)
{
include_once 'Services/Tracking/classes/class.ilLPStatusVisits.php';
return new ilLPStatusVisits($a_obj_id);
include_once 'Services/Tracking/classes/class.ilLPStatusCollection.php';
return new ilLPStatusCollection($a_obj_id);
include_once 'Services/Tracking/classes/class.ilLPStatusTypicalLearningTime.php';
return new ilLPStatusTypicalLearningTime($a_obj_id);
include_once 'Services/Tracking/classes/class.ilLPStatusSCORM.php';
return new ilLPStatusSCORM($a_obj_id);
include_once 'Services/Tracking/classes/class.ilLPStatusTestFinished.php';
return new ilLPStatusTestFinished($a_obj_id);
include_once 'Services/Tracking/classes/class.ilLPStatusTestPassed.php';
return new ilLPStatusTestPassed($a_obj_id);
include_once 'Services/Tracking/classes/class.ilLPStatusManual.php';
return new ilLPStatusManual($a_obj_id);
include_once 'Services/Tracking/classes/class.ilLPStatusManualByTutor.php';
return new ilLPStatusManualByTutor($a_obj_id);
include_once 'Services/Tracking/classes/class.ilLPStatusExerciseReturned.php';
return new ilLPStatusExerciseReturned($a_obj_id);
include_once 'Services/Tracking/classes/class.ilLPStatusObjectives.php';
return new ilLPStatusObjectives($a_obj_id);
include_once 'Services/Tracking/classes/class.ilLPStatusEvent.php';
return new ilLPStatusEvent($a_obj_id);
$type = ilObject::_lookupType($a_obj_id);
$mode = ilLPObjSettings::__getDefaultMode($a_obj_id, $type);
if($mode != LP_MODE_UNDEFINED)
{
return self::_getInstance($a_obj_id, $mode);
}
// fallthrough
default:
echo "ilLPStatusFactory: unknown type ".ilLPObjSettings::_lookupMode($a_obj_id);
}
}

+ Here is the call graph for this function:

Field Documentation

ilLPStatusFactory::$class_by_obj_id = array()
staticprivate

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


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