ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCourseAppEventListener Class Reference

Course Pool listener. More...

+ Collaboration diagram for ilCourseAppEventListener:

Static Public Member Functions

static handleEvent ($a_component, $a_event, $a_parameter)
 Handle an event in a listener.

Static Protected Attributes

static $course_mode = array()

Detailed Description

Course Pool listener.

Listens to events of other components.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 11 of file class.ilCourseAppEventListener.php.

Member Function Documentation

static ilCourseAppEventListener::handleEvent (   $a_component,
  $a_event,
  $a_parameter 
)
static

Handle an event in a listener.

Parameters
string$a_componentcomponent, e.g. "Modules/Forum" or "Services/User"
string$a_eventevent e.g. "createUser", "updateUser", "deleteUser", ...
array$a_parameterparameter array (assoc), array("name" => ..., "phone_office" => ...)

Definition at line 22 of file class.ilCourseAppEventListener.php.

References $ilUser, ilObject\_lookupType(), ilCourseParticipants\_updatePassed(), LP_MODE_COLLECTION, LP_MODE_MANUAL_BY_TUTOR, LP_MODE_OBJECTIVES, LP_STATUS_COMPLETED_NUM, and ilObjCourse\STATUS_DETERMINATION_LP.

{
global $ilUser;
if($a_component == "Services/Tracking" && $a_event == "updateStatus")
{
$obj_id = $a_parameter["obj_id"];
$user_id = $a_parameter["usr_id"];
$status = $a_parameter["status"];
if($obj_id && $user_id)
{
if (ilObject::_lookupType($obj_id) != "crs")
{
return;
}
// determine couse setting only once
if(!isset(self::$course_mode[$obj_id]))
{
include_once("./Modules/Course/classes/class.ilObjCourse.php");
$crs = new ilObjCourse($obj_id, false);
if($crs->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP)
{
include_once './Services/Tracking/classes/class.ilLPObjSettings.php';
$lp_settings = new ilLPObjSettings($obj_id);
$mode = $lp_settings->getMode();
}
else
{
$mode = false;
}
self::$course_mode[$obj_id] = $mode;
}
$is_completed = ($status == LP_STATUS_COMPLETED_NUM);
// we are NOT using the members object because of performance issues
switch(self::$course_mode[$obj_id])
{
// #11600
include_once "Modules/Course/classes/class.ilCourseParticipants.php";
ilCourseParticipants::_updatePassed($obj_id, $user_id, $is_completed, true);
break;
// overwrites course passed status if it was set automatically (full sync)
// or toggle manually set passed status to completed (1-way-sync)
$do_update = $is_completed;
include_once "Modules/Course/classes/class.ilCourseParticipants.php";
if(!$do_update)
{
$part = new ilCourseParticipants($obj_id);
$passed = $part->getPassedInfo($user_id);
if(!is_array($passed) ||
$passed["user_id"] == -1)
{
$do_update = true;
}
}
if($do_update)
{
ilCourseParticipants::_updatePassed($obj_id, $user_id, $is_completed);
}
break;
}
}
}
}

+ Here is the call graph for this function:

Field Documentation

ilCourseAppEventListener::$course_mode = array()
staticprotected

Definition at line 13 of file class.ilCourseAppEventListener.php.


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