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);
138 $columns[$id[1]] = $def;
144 $columns[
"obj_".$this->obj_id] = $parent;
148 $columns[
"last_access"] = array(
"txt" => $this->lng->txt(
"last_access"),
149 "id" =>
"last_access",
151 $columns[
"spent_seconds"] = array(
"txt" => $this->lng->txt(
"trac_spent_seconds"),
152 "id" =>
"spent_seconds",
164 include_once(
"./Services/Tracking/classes/class.ilTrQuery.php");
166 if($collection[
"object_ids"])
169 $this->ref_ids = $collection[
"ref_ids"];
173 if($collection[
"objectives_parent_id"] &&
$data[
"users"])
176 if($objectives[
"cnt"])
178 $this->objective_ids = array();
179 $objective_columns = array();
180 foreach($objectives[
"set"] as
$row)
182 if(isset(
$data[
"set"][$row[
"usr_id"]]))
184 $obj_id =
"objtv_".$row[
"obj_id"];
185 $data[
"set"][$row[
"usr_id"]][
"objects"][$obj_id] = array(
"status"=>$row[
"status"]);
187 if(!in_array($obj_id, $this->objective_ids))
189 $this->objective_ids[$obj_id] = $row[
"title"];
196 if($collection[
"scorm"])
198 $this->sco_ids = array();
199 foreach(array_keys(
$data[
"set"]) as $user_id)
201 foreach($collection[
"scorm"][
"scos"] as $sco)
203 if(!in_array($sco, $this->sco_ids))
205 $this->sco_ids[$sco] = $collection[
"scorm"][
"scos_title"][$sco];
213 if(in_array($user_id, $collection[
"scorm"][
"failed"][$sco]))
217 else if(in_array($user_id, $collection[
"scorm"][
"completed"][$sco]))
221 else if(in_array($user_id, $collection[
"scorm"][
"in_progress"][$sco]))
226 $obj_id =
"objsco_".$sco;
227 $data[
"set"][$user_id][
"objects"][$obj_id] = array(
"status"=>$status);
235 return $collection[
"object_ids"];
242 $this->tpl->setVariable(
"VAL_LOGIN", $a_set[
"login"]);
249 case "spent_seconds":
250 $this->tpl->setCurrentBlock($c);
251 $this->tpl->setVariable(
"VAL_".strtoupper($c), $this->
parseValue($c, $a_set[$c],
""));
252 $this->tpl->parseCurrentBlock();
255 case (substr($c, 0, 4) ==
"obj_"):
256 $obj_id = substr($c, 4);
257 if(!isset($a_set[
"objects"][$obj_id]))
259 $data = array(
"status"=>0);
263 $data = $a_set[
"objects"][$obj_id];
264 if(
$data[
"percentage"] ==
"0")
266 $data[
"percentage"] = NULL;
283 $this->tpl->setCurrentBlock(
'warning_img');
285 $this->tpl->setVariable(
'WARNING_ALT', $this->lng->txt(
'trac_time_passed').$timing);
286 $this->tpl->parseCurrentBlock();
290 $this->tpl->setCurrentBlock(
"objects");
291 $this->tpl->setVariable(
"VAL_STATUS", $this->
parseValue(
"status",
$data[
"status"],
""));
292 $this->tpl->setVariable(
"VAL_PERCENTAGE", $this->
parseValue(
"percentage",
$data[
"percentage"],
""));
293 $this->tpl->parseCurrentBlock();
297 case (substr($c, 0, 6) ==
"objtv_"):
299 if(!isset($a_set[
"objects"][$obj_id]))
301 $data = array(
"status"=>0);
305 $data = $a_set[
"objects"][$obj_id];
307 $this->tpl->setCurrentBlock(
"objects");
308 $this->tpl->setVariable(
"VAL_STATUS", $this->
parseValue(
"status",
$data[
"status"],
""));
309 $this->tpl->parseCurrentBlock();
312 case (substr($c, 0, 7) ==
"objsco_"):
314 if(!isset($a_set[
"objects"][$obj_id]))
316 $data = array(
"status"=>0);
320 $data = $a_set[
"objects"][$obj_id];
322 $this->tpl->setCurrentBlock(
"objects");
323 $this->tpl->setVariable(
"VAL_STATUS", $this->
parseValue(
"status",
$data[
"status"],
""));
324 $this->tpl->parseCurrentBlock();
332 global $ilObjDataCache;
334 $worksheet->write($a_row, 0, $this->lng->txt(
"login"));
340 if(substr($c, 0, 4) ==
"obj_")
342 $obj_id = substr($c, 4);
343 $type = $ilObjDataCache->lookupType($obj_id);
344 $worksheet->write($a_row, $cnt,
"(".$this->lng->txt(
$type).
") ".$labels[$c][
"txt"]);
348 $worksheet->write($a_row, $cnt, $labels[$c][
"txt"]);
356 $worksheet->write($a_row, 0, $a_set[
"login"]);
361 if(in_array($c, array(
'last_access',
'spent_seconds')))
363 $val = $this->
parseValue($c, $a_set[$c],
"user");
365 else if(substr($c, 0, 4) ==
"obj_")
367 $obj_id = substr($c, 4);
372 $obj_id = substr($c, 6);
375 $worksheet->write($a_row, $cnt, $val);
382 global $ilObjDataCache;
384 $a_csv->addColumn($this->lng->txt(
"login"));
389 if(substr($c, 0, 4) ==
"obj_")
391 $obj_id = substr($c, 4);
392 $type = $ilObjDataCache->lookupType($obj_id);
393 $a_csv->addColumn(
"(".$this->lng->txt(
$type).
") ".$labels[$c][
"txt"]);
397 $a_csv->addColumn($labels[$c][
"txt"]);
406 $a_csv->addColumn($a_set[
"login"]);
410 if(in_array($c, array(
'last_access',
'spent_seconds')))
412 $val = $this->
parseValue($c, $a_set[$c],
"user");
414 else if(substr($c, 0, 4) ==
"obj_")
416 $obj_id = substr($c, 4);
421 $obj_id = substr($c, 6);
424 $a_csv->addColumn($val);