5 include_once
'./Services/Tracking/classes/class.ilLPStatus.php';
19 include_once
'./Services/Tracking/classes/class.ilChangeEvent.php';
31 $all_page_ids = self::getLMPages($a_obj_id);
32 foreach (self::getVisitedPages($a_obj_id) as $user_id => $user_page_ids) {
33 if (!(
bool)
sizeof(array_diff($all_page_ids, $user_page_ids))) {
58 $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
62 $status = self::LP_STATUS_IN_PROGRESS_NUM;
64 if (self::hasVisitedAllPages($a_obj_id, $a_user_id)) {
65 $status = self::LP_STATUS_COMPLETED_NUM;
91 $all_page_ids =
sizeof(self::getLMPages($a_obj_id));
96 $user_page_ids =
sizeof(self::getVisitedPages($a_obj_id, $a_user_id));
98 return floor($user_page_ids / $all_page_ids * 100);
108 $all_page_ids = self::getLMPages($a_obj_id);
109 if (!
sizeof($all_page_ids)) {
113 $user_page_ids = self::getVisitedPages($a_obj_id, $a_user_id);
114 return !(bool)
sizeof(array_diff($all_page_ids, $user_page_ids));
121 $ilDB = $DIC[
'ilDB'];
125 include_once
"Services/COPage/classes/class.ilPageObject.php";
127 $set =
$ilDB->query(
"SELECT lm_data.obj_id" .
129 " JOIN lm_tree ON (lm_tree.child = lm_data.obj_id)" .
130 " WHERE lm_tree.lm_id = " .
$ilDB->quote($a_obj_id,
"integer") .
131 " AND lm_data.type = " .
$ilDB->quote(
"pg",
"text"));
146 $ilDB = $DIC[
'ilDB'];
150 $all_page_ids = self::getLMPages($a_obj_id);
151 if (!
sizeof($all_page_ids)) {
155 $sql =
"SELECT obj_id, usr_id" .
156 " FROM lm_read_event" .
157 " WHERE " .
$ilDB->in(
"obj_id", $all_page_ids,
"",
"integer");
160 $sql .=
" AND usr_id = " .
$ilDB->quote($a_user_id,
"integer");
163 $set =
$ilDB->query($sql);
165 $res[
$row[
"usr_id"]][] = $row[
"obj_id"];
static _getCompleted($a_obj_id)
static hasAccessed($a_obj_id, $a_usr_id)
Has accessed.
static _getCompleted($a_obj_id)
Static function to read the users who have the status 'completed'.
static _getInProgress($a_obj_id)
determineStatus($a_obj_id, $a_user_id, $a_obj=null)
Determine status.
static getVisitedPages($a_obj_id, $a_user_id=null)
foreach($_POST as $key=> $value) $res
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
static _lookupType($a_id, $a_reference=false)
lookup object type
determinePercentage($a_obj_id, $a_user_id, $a_obj=null)
Determine percentage.
static hasVisitedAllPages($a_obj_id, $a_user_id)
Abstract class ilLPStatus for all learning progress modes E.g ilLPStatusManual, ilLPStatusObjectives ...
static getLMPages($a_obj_id)
static lookupUsersInProgress($a_obj_id)
Lookup users in progress.