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");
92 $logger =
$GLOBALS[
'DIC']->logger()->trac();
100 $trashed_objects = $tree->getSavedNodeObjIds($all_courses);
102 include_once
'Services/Object/classes/class.ilObjectLP.php';
103 include_once
"Modules/Course/classes/class.ilCourseParticipants.php";
104 include_once
"Services/Tracking/classes/class.ilLPStatusWrapper.php";
105 foreach ($all_courses as $crs_id) {
107 if (!in_array($crs_id, $trashed_objects)) {
110 $logger->warning(
'Found course without reference: obj_id = ' . $crs_id);
116 if (!$olp->isActive()) {
121 $ilDB->manipulate(
"DELETE FROM obj_lp_stat WHERE" .
122 " obj_id = " . $ilDB->quote($crs_id,
"integer") .
123 " AND fulldate = " . $ilDB->quote(
date(
"Ymd", $this->
date),
"integer"));
126 $members = $members->getMembers();
133 $not_attempted = count($members) - $in_progress - $completed -
$failed;
136 "type" =>
array(
"text",
"crs"),
137 "obj_id" =>
array(
"integer", $crs_id),
142 "mem_cnt" =>
array(
"integer", count($members)),
143 "in_progress" =>
array(
"integer", $in_progress),
144 "completed" =>
array(
"integer", $completed),
145 "failed" =>
array(
"integer", $failed),
146 "not_attempted" =>
array(
"integer", $not_attempted)
149 $ilDB->insert(
"obj_lp_stat", $set);
168 include_once
"Services/Tracking/classes/class.ilTrQuery.php";
172 $ilDB->manipulate(
"DELETE FROM obj_type_stat WHERE" .
173 " type = " . $ilDB->quote(
$type,
"text") .
174 " AND fulldate = " . $ilDB->quote(
date(
"Ymd", $this->
date),
"integer"));
182 "cnt_references" =>
array(
"integer", (
int) $item[
"references"]),
183 "cnt_objects" =>
array(
"integer", (
int) $item[
"objects"]),
184 "cnt_deleted" =>
array(
"integer", (
int) $item[
"deleted"])
187 $ilDB->insert(
"obj_type_stat", $set);
206 $sql =
"SELECT COUNT(DISTINCT(usr_id)) counter,obj_id FROM read_event" .
207 " WHERE last_access >= " . $ilDB->quote($this->
date,
"integer") .
208 " AND last_access <= " . $ilDB->quote($to,
"integer") .
210 $set = $ilDB->query($sql);
211 while (
$row = $ilDB->fetchAssoc($set)) {
213 $ilDB->manipulate(
"DELETE FROM obj_user_stat" .
214 " WHERE fulldate = " . $ilDB->quote(
date(
"Ymd", $this->
date),
"integer") .
215 " AND obj_id = " . $ilDB->quote(
$row[
"obj_id"],
"integer"));
218 "obj_id" =>
array(
"integer",
$row[
"obj_id"]),
223 "counter" =>
array(
"integer",
$row[
"counter"])
226 $ilDB->insert(
"obj_user_stat", $iset);
Cron job application base class.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
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.
static _getAllReferences($a_id)
get all reference ids of object
catch(Exception $e) $message
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()
gatherCourseLPData()
gather course data type $tree type $ilDB