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));
123 include_once
"Services/COPage/classes/class.ilPageObject.php";
125 $set = $ilDB->query(
"SELECT lm_data.obj_id" .
127 " JOIN lm_tree ON (lm_tree.child = lm_data.obj_id)" .
128 " WHERE lm_tree.lm_id = " . $ilDB->quote($a_obj_id,
"integer") .
129 " AND lm_data.type = " . $ilDB->quote(
"pg",
"text"));
130 while (
$row = $ilDB->fetchAssoc($set)) {
146 $all_page_ids = self::getLMPages($a_obj_id);
147 if (!
sizeof($all_page_ids)) {
151 $sql =
"SELECT obj_id, usr_id" .
152 " FROM lm_read_event" .
153 " WHERE " . $ilDB->in(
"obj_id", $all_page_ids,
"",
"integer");
156 $sql .=
" AND usr_id = " . $ilDB->quote($a_user_id,
"integer");
159 $set = $ilDB->query($sql);
160 while (
$row = $ilDB->fetchAssoc($set)) {
161 $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
Create styles array
The data for the language used.
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.