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 return $collection[
"object_ids"];
258 if(!$a_set[
"active"])
260 $this->tpl->setCurrentBlock(
'inactive_bl');
261 $this->tpl->setVariable(
'TXT_INACTIVE', $lng->txt(
"inactive"));
262 $this->tpl->parseCurrentBlock();
265 $this->tpl->setVariable(
"VAL_LOGIN", $a_set[
"login"]);
272 case "spent_seconds":
273 case 'status_changed':
274 $this->tpl->setCurrentBlock($c);
275 $this->tpl->setVariable(
"VAL_".strtoupper($c), $this->
parseValue($c, $a_set[$c],
""));
276 $this->tpl->parseCurrentBlock();
279 case (substr($c, 0, 4) ==
"obj_"):
280 $obj_id = substr($c, 4);
281 if(!isset($a_set[
"objects"][$obj_id]))
283 $data = array(
"status"=>0);
287 $data = $a_set[
"objects"][$obj_id];
288 if(
$data[
"percentage"] ==
"0")
290 $data[
"percentage"] = NULL;
307 $this->tpl->setCurrentBlock(
'warning_img');
309 $this->tpl->setVariable(
'WARNING_ALT', $this->lng->txt(
'trac_time_passed').$timing);
310 $this->tpl->parseCurrentBlock();
314 $this->tpl->setCurrentBlock(
"objects");
315 $this->tpl->setVariable(
"VAL_STATUS", $this->
parseValue(
"status",
$data[
"status"],
""));
316 $this->tpl->setVariable(
"VAL_PERCENTAGE", $this->
parseValue(
"percentage",
$data[
"percentage"],
""));
317 $this->tpl->parseCurrentBlock();
321 case (substr($c, 0, 6) ==
"objtv_"):
323 if(!isset($a_set[
"objects"][$obj_id]))
325 $data = array(
"status"=>0);
329 $data = $a_set[
"objects"][$obj_id];
331 $this->tpl->setCurrentBlock(
"objects");
332 $this->tpl->setVariable(
"VAL_STATUS", $this->
parseValue(
"status",
$data[
"status"],
""));
333 $this->tpl->parseCurrentBlock();
336 case (substr($c, 0, 7) ==
"objsco_"):
338 if(!isset($a_set[
"objects"][$obj_id]))
340 $data = array(
"status"=>0);
344 $data = $a_set[
"objects"][$obj_id];
346 $this->tpl->setCurrentBlock(
"objects");
347 $this->tpl->setVariable(
"VAL_STATUS", $this->
parseValue(
"status",
$data[
"status"],
""));
348 $this->tpl->parseCurrentBlock();
356 global $ilObjDataCache;
358 $worksheet->write($a_row, 0, $this->lng->txt(
"login"));
364 if(substr($c, 0, 4) ==
"obj_")
366 $obj_id = substr($c, 4);
367 $type = $ilObjDataCache->lookupType($obj_id);
368 $worksheet->write($a_row, $cnt,
"(".$this->lng->txt($type).
") ".$labels[$c][
"txt"]);
372 $worksheet->write($a_row, $cnt, $labels[$c][
"txt"]);
380 $worksheet->write($a_row, 0, $a_set[
"login"]);
388 case "spent_seconds":
389 case "status_changed":
390 $val = $this->
parseValue($c, $a_set[$c],
"user");
393 case (substr($c, 0, 4) ==
"obj_"):
394 $obj_id = substr($c, 4);
398 case (substr($c, 0, 6) ==
"objtv_"):
403 case (substr($c, 0, 7) ==
"objsco_"):
408 $worksheet->write($a_row, $cnt, $val);
415 global $ilObjDataCache;
417 $a_csv->addColumn($this->lng->txt(
"login"));
422 if(substr($c, 0, 4) ==
"obj_")
424 $obj_id = substr($c, 4);
425 $type = $ilObjDataCache->lookupType($obj_id);
426 $a_csv->addColumn(
"(".$this->lng->txt($type).
") ".$labels[$c][
"txt"]);
430 $a_csv->addColumn($labels[$c][
"txt"]);
439 $a_csv->addColumn($a_set[
"login"]);
446 case "spent_seconds":
447 case "status_changed":
448 $val = $this->
parseValue($c, $a_set[$c],
"user");
451 case (substr($c, 0, 4) ==
"obj_"):
452 $obj_id = substr($c, 4);
456 case (substr($c, 0, 6) ==
"objtv_"):
461 case (substr($c, 0, 7) ==
"objsco_"):
466 $a_csv->addColumn($val);