45 $this->date = strtotime(
"yesterday");
64 $trashed_objects = $tree->getSavedNodeObjIds($all_courses);
66 include_once
'Services/Tracking/classes/class.ilLPObjSettings.php';
67 include_once
"Modules/Course/classes/class.ilCourseParticipants.php";
68 include_once
"Services/Tracking/classes/class.ilLPStatusWrapper.php";
69 foreach($all_courses as $crs_id)
72 if(!in_array($crs_id, $trashed_objects))
82 $ilDB->manipulate(
"DELETE FROM obj_lp_stat WHERE".
83 " obj_id = ".$ilDB->quote($crs_id,
"integer").
84 " AND fulldate = ".$ilDB->quote(date(
"Ymd", $this->date),
"integer"));
87 $members = $members->getMembers();
94 $not_attempted = count($members) - $in_progress - $completed -
$failed;
97 "type" => array(
"text",
"crs"),
98 "obj_id" => array(
"integer", $crs_id),
99 "yyyy" => array(
"integer", date(
"Y", $this->date)),
100 "mm" => array(
"integer", date(
"m", $this->date)),
101 "dd" => array(
"integer", date(
"d", $this->date)),
102 "fulldate" => array(
"integer", date(
"Ymd", $this->date)),
103 "mem_cnt" => array(
"integer", count($members)),
104 "in_progress" => array(
"integer", $in_progress),
105 "completed" => array(
"integer", $completed),
106 "failed" => array(
"integer", $failed),
107 "not_attempted" => array(
"integer", $not_attempted)
110 $ilDB->insert(
"obj_lp_stat", $set);
120 include_once
"Services/Tracking/classes/class.ilTrQuery.php";
122 foreach(
$data as $type => $item)
125 $ilDB->manipulate(
"DELETE FROM obj_type_stat WHERE".
126 " type = ".$ilDB->quote($type,
"text").
127 " AND fulldate = ".$ilDB->quote(date(
"Ymd", $this->date),
"integer"));
130 "type" => array(
"text", $type),
131 "yyyy" => array(
"integer", date(
"Y", $this->date)),
132 "mm" => array(
"integer", date(
"m", $this->date)),
133 "dd" => array(
"integer", date(
"d", $this->date)),
134 "fulldate" => array(
"integer", date(
"Ymd", $this->date)),
135 "cnt_references" => array(
"integer", (
int)$item[
"references"]),
136 "cnt_objects" => array(
"integer", (
int)$item[
"objects"]),
137 "cnt_deleted" => array(
"integer", (
int)$item[
"deleted"])
140 $ilDB->insert(
"obj_type_stat", $set);
148 $to = mktime(23, 59, 59, date(
"m", $this->date), date(
"d", $this->date), date(
"Y", $this->date));
150 $sql =
"SELECT COUNT(DISTINCT(usr_id)) counter,obj_id FROM read_event".
151 " WHERE last_access >= ".$ilDB->quote($this->date,
"integer").
152 " AND last_access <= ".$ilDB->quote($to,
"integer").
154 $set = $ilDB->query($sql);
155 while(
$row = $ilDB->fetchAssoc($set))
158 $ilDB->manipulate(
"DELETE FROM obj_user_stat".
159 " WHERE fulldate = ".$ilDB->quote(date(
"Ymd", $this->date),
"integer").
160 " AND obj_id = ".$ilDB->quote(
$row[
"obj_id"],
"integer"));
163 "obj_id" => array(
"integer",
$row[
"obj_id"]),
164 "yyyy" => array(
"integer", date(
"Y", $this->date)),
165 "mm" => array(
"integer", date(
"m", $this->date)),
166 "dd" => array(
"integer", date(
"d", $this->date)),
167 "fulldate" => array(
"integer", date(
"Ymd", $this->date)),
168 "counter" => array(
"integer",
$row[
"counter"])
171 $ilDB->insert(
"obj_user_stat", $iset);