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 $columns[
"status_changed"] = array(
"txt" => $this->lng->txt(
"trac_status_changed"),
149 "id" =>
"status_changed",
152 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
157 $columns[
"last_access"] = array(
"txt" => $this->lng->txt(
"last_access"),
158 "id" =>
"last_access",
164 $columns[
"spent_seconds"] = array(
"txt" => $this->lng->txt(
"trac_spent_seconds"),
165 "id" =>
"spent_seconds",
178 include_once(
"./Services/Tracking/classes/class.ilTrQuery.php");
180 if($collection[
"object_ids"])
183 $this->ref_ids = $collection[
"ref_ids"];
186 if($collection[
"objectives_parent_id"] &&
$data[
"users"])
189 if($objectives[
"cnt"])
191 $this->objective_ids = array();
192 $objective_columns = array();
193 foreach($objectives[
"set"] as
$row)
195 if(isset(
$data[
"set"][$row[
"usr_id"]]))
197 $obj_id =
"objtv_".$row[
"obj_id"];
198 $data[
"set"][$row[
"usr_id"]][
"objects"][$obj_id] = array(
"status"=>$row[
"status"]);
200 if(!in_array($obj_id, $this->objective_ids))
202 $this->objective_ids[$obj_id] = $row[
"title"];
209 if($collection[
"scorm"] &&
$data[
"set"])
211 $this->sco_ids = array();
212 foreach(array_keys(
$data[
"set"]) as $user_id)
214 foreach($collection[
"scorm"][
"scos"] as $sco)
216 if(!in_array($sco, $this->sco_ids))
218 $this->sco_ids[$sco] = $collection[
"scorm"][
"scos_title"][$sco];
226 if(in_array($user_id, $collection[
"scorm"][
"failed"][$sco]))
230 else if(in_array($user_id, $collection[
"scorm"][
"completed"][$sco]))
234 else if(in_array($user_id, $collection[
"scorm"][
"in_progress"][$sco]))
239 $obj_id =
"objsco_".$sco;
240 $data[
"set"][$user_id][
"objects"][$obj_id] = array(
"status"=>$status);
248 $this->perc_map = array();
249 foreach(
$data[
"set"] as $item)
251 if(is_array($item[
"objects"]))
253 foreach($item[
"objects"] as $obj_id => $obj_data)
255 if((
int)$obj_data[
"percentage"] > 0)
257 $this->perc_map[$obj_id] =
true;
267 return $collection[
"object_ids"];
277 if(!$a_set[
"active"])
279 $this->tpl->setCurrentBlock(
'inactive_bl');
280 $this->tpl->setVariable(
'TXT_INACTIVE', $lng->txt(
"inactive"));
281 $this->tpl->parseCurrentBlock();
284 $this->tpl->setVariable(
"VAL_LOGIN", $a_set[
"login"]);
291 case "spent_seconds":
292 case 'status_changed':
293 $this->tpl->setCurrentBlock($c);
294 $this->tpl->setVariable(
"VAL_".strtoupper($c), $this->
parseValue($c, $a_set[$c],
""));
295 $this->tpl->parseCurrentBlock();
298 case (substr($c, 0, 4) ==
"obj_"):
299 $obj_id = substr($c, 4);
300 if(!isset($a_set[
"objects"][$obj_id]))
302 $data = array(
"status"=>0);
306 $data = $a_set[
"objects"][$obj_id];
307 if(
$data[
"percentage"] ==
"0")
309 $data[
"percentage"] = NULL;
326 $this->tpl->setCurrentBlock(
'warning_img');
328 $this->tpl->setVariable(
'WARNING_ALT', $this->lng->txt(
'trac_time_passed').$timing);
329 $this->tpl->parseCurrentBlock();
333 $this->tpl->setCurrentBlock(
"objects");
334 $this->tpl->setVariable(
"VAL_STATUS", $this->
parseValue(
"status",
$data[
"status"],
""));
335 $this->tpl->setVariable(
"VAL_PERCENTAGE", $this->
parseValue(
"percentage",
$data[
"percentage"],
""));
336 $this->tpl->parseCurrentBlock();
340 case (substr($c, 0, 6) ==
"objtv_"):
341 case (substr($c, 0, 7) ==
"objsco_"):
343 if(!isset($a_set[
"objects"][$obj_id]))
345 $data = array(
"status"=>0);
349 $data = $a_set[
"objects"][$obj_id];
351 $this->tpl->setCurrentBlock(
"objects");
352 $this->tpl->setVariable(
"VAL_STATUS", $this->
parseValue(
"status",
$data[
"status"],
""));
353 $this->tpl->parseCurrentBlock();
361 global $ilObjDataCache;
363 $worksheet->write($a_row, 0, $this->lng->txt(
"login"));
369 if(substr($c, 0, 4) ==
"obj_")
371 $obj_id = substr($c, 4);
372 $type = $ilObjDataCache->lookupType($obj_id);
373 $worksheet->write($a_row, $cnt,
"(".$this->lng->txt($type).
") ".$labels[$c][
"txt"]);
375 if(is_array($this->perc_map) && $this->perc_map[$obj_id])
378 $worksheet->write($a_row, $cnt, $this->lng->txt(
"trac_percentage").
" (%)");
383 $worksheet->write($a_row, $cnt, $labels[$c][
"txt"]);
391 $worksheet->write($a_row, 0, $a_set[
"login"]);
399 case "spent_seconds":
400 case "status_changed":
401 $val = $this->
parseValue($c, $a_set[$c],
"user");
402 $worksheet->write($a_row, $cnt, $val);
405 case (substr($c, 0, 4) ==
"obj_"):
406 $obj_id = substr($c, 4);
408 $worksheet->write($a_row, $cnt, $val);
410 if(is_array($this->perc_map) && $this->perc_map[$obj_id])
413 $perc = (int)$a_set[
"objects"][$obj_id][
"percentage"];
418 $worksheet->write($a_row, $cnt, $perc);
422 case (substr($c, 0, 6) ==
"objtv_"):
423 case (substr($c, 0, 7) ==
"objsco_"):
426 $worksheet->write($a_row, $cnt, $val);
435 global $ilObjDataCache;
437 $a_csv->addColumn($this->lng->txt(
"login"));
442 if(substr($c, 0, 4) ==
"obj_")
444 $obj_id = substr($c, 4);
445 $type = $ilObjDataCache->lookupType($obj_id);
446 $a_csv->addColumn(
"(".$this->lng->txt($type).
") ".$labels[$c][
"txt"]);
448 if(is_array($this->perc_map) && $this->perc_map[$obj_id])
450 $a_csv->addColumn($this->lng->txt(
"trac_percentage").
" (%)");
455 $a_csv->addColumn($labels[$c][
"txt"]);
464 $a_csv->addColumn($a_set[
"login"]);
471 case "spent_seconds":
472 case "status_changed":
473 $val = $this->
parseValue($c, $a_set[$c],
"user");
474 $a_csv->addColumn($val);
477 case (substr($c, 0, 4) ==
"obj_"):
478 $obj_id = substr($c, 4);
480 $a_csv->addColumn($val);
482 if(is_array($this->perc_map) && $this->perc_map[$obj_id])
484 $perc = (int)$a_set[
"objects"][$obj_id][
"percentage"];
489 $a_csv->addColumn($perc);
493 case (substr($c, 0, 6) ==
"objtv_"):
494 case (substr($c, 0, 7) ==
"objsco_"):
497 $a_csv->addColumn($val);