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)
34 if(!(
bool)
sizeof(array_diff($all_page_ids, $user_page_ids)))
60 $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
66 $status = self::LP_STATUS_IN_PROGRESS_NUM;
68 if(self::hasVisitedAllPages($a_obj_id, $a_user_id))
70 $status = self::LP_STATUS_COMPLETED_NUM;
96 $all_page_ids =
sizeof(self::getLMPages($a_obj_id));
102 $user_page_ids =
sizeof(self::getVisitedPages($a_obj_id, $a_user_id));
104 return floor($user_page_ids/$all_page_ids*100);
114 $all_page_ids = self::getLMPages($a_obj_id);
115 if(!
sizeof($all_page_ids))
120 $user_page_ids = self::getVisitedPages($a_obj_id, $a_user_id);
121 return !(bool)
sizeof(array_diff($all_page_ids, $user_page_ids));
130 include_once
"Services/COPage/classes/class.ilPageObject.php";
132 $set = $ilDB->query(
"SELECT lm_data.obj_id".
134 " JOIN lm_tree ON (lm_tree.child = lm_data.obj_id)".
135 " WHERE lm_tree.lm_id = ".$ilDB->quote($a_obj_id,
"integer").
136 " AND lm_data.type = ".$ilDB->quote(
"pg",
"text"));
137 while(
$row = $ilDB->fetchAssoc($set))
155 $all_page_ids = self::getLMPages($a_obj_id);
156 if(!
sizeof($all_page_ids))
161 $sql =
"SELECT obj_id, usr_id".
162 " FROM lm_read_event".
163 " WHERE ".$ilDB->in(
"obj_id", $all_page_ids,
"",
"integer");
167 $sql .=
" AND usr_id = ".$ilDB->quote($a_user_id,
"integer");
170 $set = $ilDB->query($sql);
171 while(
$row = $ilDB->fetchAssoc($set))
173 $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)
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.