5 include_once
"Services/Cron/classes/class.ilCronJob.php";
19 return "lp_object_statistics";
26 $lng->loadLanguageModule(
"trac");
27 return $lng->txt(
"trac_object_statistics");
34 $lng->loadLanguageModule(
"trac");
35 return $lng->txt(
"trac_object_statistics_info");
40 return self::SCHEDULE_TYPE_DAILY;
62 $this->
date = strtotime(
"yesterday");
94 $trashed_objects = $tree->getSavedNodeObjIds($all_courses);
96 include_once
'Services/Object/classes/class.ilObjectLP.php';
97 include_once
"Modules/Course/classes/class.ilCourseParticipants.php";
98 include_once
"Services/Tracking/classes/class.ilLPStatusWrapper.php";
99 foreach($all_courses as $crs_id)
102 if(!in_array($crs_id, $trashed_objects))
106 if(!$olp->isActive())
112 $ilDB->manipulate(
"DELETE FROM obj_lp_stat WHERE".
113 " obj_id = ".$ilDB->quote($crs_id,
"integer").
114 " AND fulldate = ".$ilDB->quote(
date(
"Ymd", $this->
date),
"integer"));
117 $members = $members->getMembers();
124 $not_attempted = count($members) - $in_progress - $completed -
$failed;
127 "type" =>
array(
"text",
"crs"),
128 "obj_id" =>
array(
"integer", $crs_id),
133 "mem_cnt" =>
array(
"integer", count($members)),
134 "in_progress" =>
array(
"integer", $in_progress),
135 "completed" =>
array(
"integer", $completed),
136 "failed" =>
array(
"integer", $failed),
137 "not_attempted" =>
array(
"integer", $not_attempted)
140 $ilDB->insert(
"obj_lp_stat", $set);
159 include_once
"Services/Tracking/classes/class.ilTrQuery.php";
161 foreach(
$data as $type => $item)
164 $ilDB->manipulate(
"DELETE FROM obj_type_stat WHERE".
165 " type = ".$ilDB->quote($type,
"text").
166 " AND fulldate = ".$ilDB->quote(
date(
"Ymd", $this->
date),
"integer"));
169 "type" =>
array(
"text", $type),
174 "cnt_references" =>
array(
"integer", (
int)$item[
"references"]),
175 "cnt_objects" =>
array(
"integer", (
int)$item[
"objects"]),
176 "cnt_deleted" =>
array(
"integer", (
int)$item[
"deleted"])
179 $ilDB->insert(
"obj_type_stat", $set);
198 $sql =
"SELECT COUNT(DISTINCT(usr_id)) counter,obj_id FROM read_event".
199 " WHERE last_access >= ".$ilDB->quote($this->
date,
"integer").
200 " AND last_access <= ".$ilDB->quote($to,
"integer").
202 $set = $ilDB->query($sql);
203 while(
$row = $ilDB->fetchAssoc($set))
206 $ilDB->manipulate(
"DELETE FROM obj_user_stat".
207 " WHERE fulldate = ".$ilDB->quote(
date(
"Ymd", $this->
date),
"integer").
208 " AND obj_id = ".$ilDB->quote(
$row[
"obj_id"],
"integer"));
211 "obj_id" =>
array(
"integer",
$row[
"obj_id"]),
216 "counter" =>
array(
"integer",
$row[
"counter"])
219 $ilDB->insert(
"obj_user_stat", $iset);
Cron job application base class.
static _lookupFailedForObject($a_obj_id, $a_user_ids=null)
Get failed users for object.
static _getObjectsByType($a_obj_type="", $a_owner="")
Get objects by type.
Cron for lp object statistics.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Create styles array
The data for the language used.
static _lookupInProgressForObject($a_obj_id, $a_user_ids=null)
Get in progress users for object.
static ping($a_job_id)
Keep cron job alive.
Cron job result data container.
static getObjectTypeStatistics()
static _lookupCompletedForObject($a_obj_id, $a_user_ids=null)
Get completed users for object.
static getInstance($a_obj_id)
getDefaultScheduleValue()