4 include_once(
"./Services/Tracking/classes/class.ilLPTableBaseGUI.php");
35 $this->
parseTitle($this->obj_id,
"trac_matrix");
38 $this->
setFormAction($ilCtrl->getFormActionByClass(get_class($this)));
39 $this->
setRowTemplate(
"tpl.user_object_matrix_row.html",
"Services/Tracking");
44 $this->
addColumn($this->lng->txt(
"login"),
"login");
48 foreach ($selected as $c)
50 $title = $labels[$c][
"txt"];
52 if(isset($labels[$c][
"icon"]))
54 $alt = $lng->txt($labels[$c][
"type"]);
55 $icon =
'<img src="'.$labels[$c][
"icon"].
'" alt="'.$alt.
'" />';
56 if(
sizeof($selected) > 5)
77 $this->filter[
"name"] = $item->getValue();
82 global $ilObjDataCache;
86 if($this->obj_ids === NULL)
93 foreach($this->obj_ids as $obj_id)
95 if($obj_id == $this->obj_id)
97 $parent = array(
"txt" => $this->lng->txt(
"status"),
102 $title = $ilObjDataCache->lookupTitle($obj_id);
103 $type = $ilObjDataCache->lookupType($obj_id);
107 include_once
"Modules/Session/classes/class.ilObjSession.php";
111 $tmp_cols[strtolower(
$title).
"#~#obj_".$obj_id] = array(
"txt" =>
$title,
"icon" =>
$icon,
"type" => $type,
"default" =>
true);
114 if(
sizeof($this->objective_ids))
116 foreach($this->objective_ids as $obj_id =>
$title)
118 $tmp_cols[strtolower(
$title).
"#~#objtv_".$obj_id] = array(
"txt" =>
$title,
"default" =>
true);
121 if(
sizeof($this->sco_ids))
123 foreach($this->sco_ids as $obj_id =>
$title)
126 $tmp_cols[strtolower(
$title).
"#~#objsco_".$obj_id] = array(
"txt" =>
$title,
"icon"=>
$icon,
"default" =>
true);
131 if(!
sizeof($this->sco_ids))
135 foreach($tmp_cols as $id => $def)
137 $id = explode(
'#~#', $id);
144 $columns[
"obj_".$this->obj_id] = $parent;
148 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
153 $columns[
"last_access"] = array(
"txt" => $this->lng->txt(
"last_access"),
154 "id" =>
"last_access",
160 $columns[
"spent_seconds"] = array(
"txt" => $this->lng->txt(
"trac_spent_seconds"),
161 "id" =>
"spent_seconds",
174 include_once(
"./Services/Tracking/classes/class.ilTrQuery.php");
176 if($collection[
"object_ids"])
179 $this->ref_ids = $collection[
"ref_ids"];
183 if($collection[
"objectives_parent_id"] &&
$data[
"users"])
186 if($objectives[
"cnt"])
188 $this->objective_ids = array();
189 $objective_columns = array();
190 foreach($objectives[
"set"] as
$row)
192 if(isset(
$data[
"set"][$row[
"usr_id"]]))
194 $obj_id =
"objtv_".$row[
"obj_id"];
195 $data[
"set"][$row[
"usr_id"]][
"objects"][$obj_id] = array(
"status"=>$row[
"status"]);
197 if(!in_array($obj_id, $this->objective_ids))
199 $this->objective_ids[$obj_id] = $row[
"title"];
206 if($collection[
"scorm"])
208 $this->sco_ids = array();
209 foreach(array_keys(
$data[
"set"]) as $user_id)
211 foreach($collection[
"scorm"][
"scos"] as $sco)
213 if(!in_array($sco, $this->sco_ids))
215 $this->sco_ids[$sco] = $collection[
"scorm"][
"scos_title"][$sco];
223 if(in_array($user_id, $collection[
"scorm"][
"failed"][$sco]))
227 else if(in_array($user_id, $collection[
"scorm"][
"completed"][$sco]))
231 else if(in_array($user_id, $collection[
"scorm"][
"in_progress"][$sco]))
236 $obj_id =
"objsco_".$sco;
237 $data[
"set"][$user_id][
"objects"][$obj_id] = array(
"status"=>$status);
245 return $collection[
"object_ids"];
252 $this->tpl->setVariable(
"VAL_LOGIN", $a_set[
"login"]);
259 case "spent_seconds":
260 $this->tpl->setCurrentBlock($c);
261 $this->tpl->setVariable(
"VAL_".strtoupper($c), $this->
parseValue($c, $a_set[$c],
""));
262 $this->tpl->parseCurrentBlock();
265 case (substr($c, 0, 4) ==
"obj_"):
266 $obj_id = substr($c, 4);
267 if(!isset($a_set[
"objects"][$obj_id]))
269 $data = array(
"status"=>0);
273 $data = $a_set[
"objects"][$obj_id];
274 if(
$data[
"percentage"] ==
"0")
276 $data[
"percentage"] = NULL;
293 $this->tpl->setCurrentBlock(
'warning_img');
295 $this->tpl->setVariable(
'WARNING_ALT', $this->lng->txt(
'trac_time_passed').$timing);
296 $this->tpl->parseCurrentBlock();
300 $this->tpl->setCurrentBlock(
"objects");
301 $this->tpl->setVariable(
"VAL_STATUS", $this->
parseValue(
"status",
$data[
"status"],
""));
302 $this->tpl->setVariable(
"VAL_PERCENTAGE", $this->
parseValue(
"percentage",
$data[
"percentage"],
""));
303 $this->tpl->parseCurrentBlock();
307 case (substr($c, 0, 6) ==
"objtv_"):
309 if(!isset($a_set[
"objects"][$obj_id]))
311 $data = array(
"status"=>0);
315 $data = $a_set[
"objects"][$obj_id];
317 $this->tpl->setCurrentBlock(
"objects");
318 $this->tpl->setVariable(
"VAL_STATUS", $this->
parseValue(
"status",
$data[
"status"],
""));
319 $this->tpl->parseCurrentBlock();
322 case (substr($c, 0, 7) ==
"objsco_"):
324 if(!isset($a_set[
"objects"][$obj_id]))
326 $data = array(
"status"=>0);
330 $data = $a_set[
"objects"][$obj_id];
332 $this->tpl->setCurrentBlock(
"objects");
333 $this->tpl->setVariable(
"VAL_STATUS", $this->
parseValue(
"status",
$data[
"status"],
""));
334 $this->tpl->parseCurrentBlock();
342 global $ilObjDataCache;
344 $worksheet->write($a_row, 0, $this->lng->txt(
"login"));
350 if(substr($c, 0, 4) ==
"obj_")
352 $obj_id = substr($c, 4);
353 $type = $ilObjDataCache->lookupType($obj_id);
354 $worksheet->write($a_row, $cnt,
"(".$this->lng->txt($type).
") ".$labels[$c][
"txt"]);
358 $worksheet->write($a_row, $cnt, $labels[$c][
"txt"]);
366 $worksheet->write($a_row, 0, $a_set[
"login"]);
371 if(in_array($c, array(
'last_access',
'spent_seconds')))
373 $val = $this->
parseValue($c, $a_set[$c],
"user");
375 else if(substr($c, 0, 4) ==
"obj_")
377 $obj_id = substr($c, 4);
382 $obj_id = substr($c, 6);
385 $worksheet->write($a_row, $cnt, $val);
392 global $ilObjDataCache;
394 $a_csv->addColumn($this->lng->txt(
"login"));
399 if(substr($c, 0, 4) ==
"obj_")
401 $obj_id = substr($c, 4);
402 $type = $ilObjDataCache->lookupType($obj_id);
403 $a_csv->addColumn(
"(".$this->lng->txt($type).
") ".$labels[$c][
"txt"]);
407 $a_csv->addColumn($labels[$c][
"txt"]);
416 $a_csv->addColumn($a_set[
"login"]);
420 if(in_array($c, array(
'last_access',
'spent_seconds')))
422 $val = $this->
parseValue($c, $a_set[$c],
"user");
424 else if(substr($c, 0, 4) ==
"obj_")
426 $obj_id = substr($c, 4);
431 $obj_id = substr($c, 6);
434 $a_csv->addColumn($val);