ILIAS  Release_4_4_x_branch Revision 61816
 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)

Data Fields

const PATH = 'Services/Tracking/classes/status/'

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 48230 2014-02-27 11:08:27Z jluetzen

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

Member Function Documentation

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

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

References exit, ilObjectLP\getInstance(), ilLPObjSettings\LP_MODE_COLLECTION, ilLPObjSettings\LP_MODE_COLLECTION_MANUAL, ilLPObjSettings\LP_MODE_COLLECTION_TLT, ilLPObjSettings\LP_MODE_DEACTIVATED, ilLPObjSettings\LP_MODE_EVENT, ilLPObjSettings\LP_MODE_EXERCISE_RETURNED, ilLPObjSettings\LP_MODE_MANUAL, ilLPObjSettings\LP_MODE_MANUAL_BY_TUTOR, ilLPObjSettings\LP_MODE_OBJECTIVES, ilLPObjSettings\LP_MODE_PLUGIN, ilLPObjSettings\LP_MODE_SCORM, ilLPObjSettings\LP_MODE_SCORM_PACKAGE, ilLPObjSettings\LP_MODE_TEST_FINISHED, ilLPObjSettings\LP_MODE_TEST_PASSED, ilLPObjSettings\LP_MODE_TLT, ilLPObjSettings\LP_MODE_UNDEFINED, and ilLPObjSettings\LP_MODE_VISITS.

Referenced by ilLPStatusWrapper\_getCompleted(), ilLPStatusWrapper\_getFailed(), ilLPStatusWrapper\_getInProgress(), ilLPStatusWrapper\_getNotAttempted(), ilLPStatusWrapper\_getStatusInfo(), ilLPStatusWrapper\_getTypicalLearningTime(), ilLPStatusWrapper\_lookupCompletedForObject(), ilLPStatusWrapper\_lookupFailedForObject(), ilLPStatusWrapper\_lookupInProgressForObject(), ilLMExplorer\checkLPIcon(), ilLMExplorerGUI\checkLPIcon(), ilTrQuery\getParticipantsForObject(), ilLearningProgressGUI\initCollectionManualForm(), ilLearningProgressGUI\showtlt(), ilTrackingTest\testLPMarks(), and ilLearningProgressGUI\updateManual().

{
if($a_mode === NULL)
{
include_once 'Services/Object/classes/class.ilObjectLP.php';
$olp = ilObjectLP::getInstance($a_obj_id);
$a_mode = $olp->getCurrentMode();
// 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 self::PATH.'class.ilLPStatusVisits.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusVisits';
include_once self::PATH.'class.ilLPStatusCollection.php';
return self::$class_by_obj_id[$a_obj_id] ='ilLPStatusCollection';
include_once self::PATH.'class.ilLPStatusTypicalLearningTime.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusTypicalLearningTime';
include_once self::PATH.'class.ilLPStatusSCORM.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusSCORM';
include_once self::PATH.'class.ilLPStatusTestFinished.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusTestFinished';
include_once self::PATH.'class.ilLPStatusTestPassed.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusTestPassed';
include_once self::PATH.'class.ilLPStatusManual.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusManual';
include_once self::PATH.'class.ilLPStatusManualByTutor.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusManualByTutor';
include_once self::PATH.'class.ilLPStatusExerciseReturned.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusExerciseReturned';
include_once self::PATH.'class.ilLPStatusObjectives.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusObjectives';
include_once self::PATH.'class.ilLPStatusSCORMPackage.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusSCORMPackage';
include_once self::PATH.'class.ilLPStatusEvent.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusEvent';
include_once self::PATH.'class.ilLPStatusPlugin.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusPlugin';
include_once self::PATH.'class.ilLPStatusCollectionTLT.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusCollectionTLT';
include_once self::PATH.'class.ilLPStatusCollectionManual.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatusCollectionManual';
include_once 'Services/Tracking/classes/class.ilLPStatus.php';
return self::$class_by_obj_id[$a_obj_id] = 'ilLPStatus';
include_once 'Services/Object/classes/class.ilObjectLP.php';
$olp = ilObjectLP::getInstance($a_obj_id);
$mode = $olp->getCurrentMode();
{
return self::$class_by_obj_id[$a_obj_id] = self::_getClassById($a_obj_id, $mode);
}
// fallthrough
default:
echo "ilLPStatusFactory: unknown type ".$a_mode;
}
}

+ 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 123 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 self::PATH.'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 138 of file class.ilLPStatusFactory.php.

References exit, ilObjectLP\getInstance(), ilLPObjSettings\LP_MODE_COLLECTION, ilLPObjSettings\LP_MODE_COLLECTION_MANUAL, ilLPObjSettings\LP_MODE_COLLECTION_TLT, ilLPObjSettings\LP_MODE_DEACTIVATED, ilLPObjSettings\LP_MODE_EVENT, ilLPObjSettings\LP_MODE_EXERCISE_RETURNED, ilLPObjSettings\LP_MODE_MANUAL, ilLPObjSettings\LP_MODE_MANUAL_BY_TUTOR, ilLPObjSettings\LP_MODE_OBJECTIVES, ilLPObjSettings\LP_MODE_PLUGIN, ilLPObjSettings\LP_MODE_SCORM, ilLPObjSettings\LP_MODE_SCORM_PACKAGE, ilLPObjSettings\LP_MODE_TEST_FINISHED, ilLPObjSettings\LP_MODE_TEST_PASSED, ilLPObjSettings\LP_MODE_TLT, ilLPObjSettings\LP_MODE_UNDEFINED, and ilLPObjSettings\LP_MODE_VISITS.

Referenced by ilLPStatusWrapper\_determineStatus(), ilLPStatusWrapper\_refreshStatus(), ilLPStatusWrapper\_setDirty(), ilLPStatusWrapper\_updateStatus(), ilLPStatus\checkStatusForObject(), and ilTrQuery\getObjectIds().

{
if($a_mode === NULL)
{
include_once 'Services/Object/classes/class.ilObjectLP.php';
$olp = ilObjectLP::getInstance($a_obj_id);
$a_mode = $olp->getCurrentMode();
}
switch($a_mode)
{
include_once self::PATH.'class.ilLPStatusVisits.php';
return new ilLPStatusVisits($a_obj_id);
include_once self::PATH.'class.ilLPStatusCollection.php';
return new ilLPStatusCollection($a_obj_id);
include_once self::PATH.'class.ilLPStatusTypicalLearningTime.php';
return new ilLPStatusTypicalLearningTime($a_obj_id);
include_once self::PATH.'class.ilLPStatusSCORM.php';
return new ilLPStatusSCORM($a_obj_id);
include_once self::PATH.'class.ilLPStatusTestFinished.php';
return new ilLPStatusTestFinished($a_obj_id);
include_once self::PATH.'class.ilLPStatusTestPassed.php';
return new ilLPStatusTestPassed($a_obj_id);
include_once self::PATH.'class.ilLPStatusManual.php';
return new ilLPStatusManual($a_obj_id);
include_once self::PATH.'class.ilLPStatusManualByTutor.php';
return new ilLPStatusManualByTutor($a_obj_id);
include_once self::PATH.'class.ilLPStatusExerciseReturned.php';
return new ilLPStatusExerciseReturned($a_obj_id);
include_once self::PATH.'class.ilLPStatusObjectives.php';
return new ilLPStatusObjectives($a_obj_id);
include_once self::PATH.'class.ilLPStatusSCORMPackage.php';
return new ilLPStatusSCORMPackage($a_obj_id);
include_once self::PATH.'class.ilLPStatusEvent.php';
return new ilLPStatusEvent($a_obj_id);
include_once self::PATH.'class.ilLPStatusPlugin.php';
return new ilLPStatusPlugin($a_obj_id);
include_once self::PATH.'class.ilLPStatusCollectionTLT.php';
return new ilLPStatusCollectionTLT($a_obj_id);
include_once self::PATH.'class.ilLPStatusCollectionManual.php';
return new ilLPStatusCollectionManual($a_obj_id);
include_once 'Services/Tracking/classes/class.ilLPStatus.php';
return new ilLPStatus($a_obj_id);
include_once 'Services/Object/classes/class.ilObjectLP.php';
$olp = ilObjectLP::getInstance($a_obj_id);
$mode = $olp->getCurrentMode();
{
return self::_getInstance($a_obj_id, $mode);
}
// fallthrough
default:
echo "ilLPStatusFactory: unknown type ".$a_mode;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilLPStatusFactory::$class_by_obj_id = array()
staticprivate

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

const ilLPStatusFactory::PATH = 'Services/Tracking/classes/status/'

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


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