4 include_once
'./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php';
31 $ilBench->start(
'LearningProgress',
'0000_Start');
34 $this->ctrl->setReturn($this,
"");
40 case 'illplistofprogressgui':
41 include_once
'Services/Tracking/classes/repository_statistics/class.ilLPListOfProgressGUI.php';
43 $ilHelp->setScreenIdComponent(
"lp");
48 $this->ctrl->forwardCommand($lop_gui);
51 case 'illplistofobjectsgui':
53 !$ilAccess->checkAccess(
'edit_learning_progress',
'', $this->getRefId()))
58 include_once
'Services/Tracking/classes/repository_statistics/class.ilLPListOfObjectsGUI.php';
59 if(stristr($this->ctrl->getCmd(),
"matrix"))
63 else if(stristr($this->ctrl->getCmd(),
"summary"))
73 $this->ctrl->forwardCommand($loo_gui);
76 case 'illplistofsettingsgui':
78 !$ilAccess->checkAccess(
'edit_learning_progress',
'', $this->getRefId()))
83 include_once
'Services/Tracking/classes/repository_statistics/class.ilLPListOfSettingsGUI.php';
88 $this->ctrl->forwardCommand($los_gui);
91 case 'illmstatisticsgui':
92 include_once
'Services/Tracking/classes/class.ilLMStatisticsGUI.php';
97 $this->ctrl->forwardCommand($los_gui);
100 case 'illpobjectstatisticsgui':
101 include_once
'Services/Tracking/classes/object_statistics/class.ilLPObjectStatisticsGUI.php';
102 if(stristr($this->ctrl->getCmd(),
"access"))
106 else if(stristr($this->ctrl->getCmd(),
"types"))
110 else if(stristr($this->ctrl->getCmd(),
"daily"))
120 $this->ctrl->forwardCommand($ost_gui);
124 $cmd = $this->ctrl->getCmd();
126 $this->tpl->show(
true);
134 $ilBench->stop(
'LearningProgress',
'0000_Start');
144 if($this->ctrl->getCmdClass() == strtolower(get_class($this)))
146 $this->ctrl->setCmdClass(strtolower($a_class));
161 if(strlen($next_class = $this->ctrl->getNextClass()))
165 $_SESSION[
'il_lp_history'] = $next_class;
171 case self::LP_CONTEXT_ADMINISTRATION:
172 return 'illplistofobjectsgui';
174 case self::LP_CONTEXT_REPOSITORY:
175 $cmd = $this->ctrl->getCmd();
176 if(in_array(
$cmd, array(
"editmanual",
"updatemanual",
"showtlt")))
182 include_once
'./Services/Object/classes/class.ilObjectLP.php';
184 if(!$olp->isActive())
186 return 'illplistofsettingsgui';
189 if(!$this->anonymized and
190 $ilAccess->checkAccess(
'edit_learning_progress',
'',$this->getRefId()))
192 return 'illplistofobjectsgui';
194 return 'illplistofprogressgui';
196 case self::LP_CONTEXT_PERSONAL_DESKTOP:
198 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
202 if($has_edit || $has_personal)
208 $tgt =
'illplistofprogressgui';
212 $tgt =
'illplistofobjectsgui';
218 case 'illplistofobjectsgui':
225 case 'illplistofprogressgui':
246 case self::LP_CONTEXT_USER_FOLDER:
247 case self::LP_CONTEXT_ORG_UNIT:
250 return 'illplistofprogressgui';
259 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
262 include_once
'./Services/Object/classes/class.ilObjectLP.php';
267 $tpl->setContent($form->getHTML());
276 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
278 $form->setFormAction($ilCtrl->getFormAction($this,
"updatemanual"));
279 $form->setTitle($lng->txt(
"learning_progress"));
280 $form->setDescription($lng->txt(
"trac_collection_manual_learner_info"));
282 $coll_items = array();
284 include_once
'./Services/Object/classes/class.ilObjectLP.php';
286 $collection = $olp->getCollectionInstance();
289 $coll_items = $collection->getItems();
290 $possible_items = $collection->getPossibleItems($this->
getRefId());
295 $subitem_title = $lng->txt(
"objs_st");
296 $subitem_info = $lng->txt(
"trac_collection_manual_learner_lm_info");
301 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
303 $lp_data = $class::_getObjectStatus($this->
getObjId(), $this->usr_id);
306 $grp->setInfo($subitem_info);
307 $form->addItem($grp);
309 $completed = array();
310 foreach($coll_items as $item_id)
315 if(isset($lp_data[$item_id]))
318 $info = $lng->txt(
"trac_collection_manual_learner_changed_ts").
": ".
321 if($lp_data[$item_id][0])
324 $completed[] = $item_id;
332 $opt =
new ilCheckboxOption($icon.
" ".$possible_items[$item_id][
"title"], $item_id);
335 $opt->setInfo($info);
337 $grp->addOption($opt);
342 $grp->setValue($completed);
345 $form->addCommandButton(
"updatemanual", $lng->txt(
"save"));
354 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
357 include_once
'./Services/Object/classes/class.ilObjectLP.php';
362 if($form->checkInput())
364 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
366 $class::_setObjectStatus($this->
getObjId(), $this->usr_id, $form->getInput(
"sids"));
371 $ilCtrl->redirect($this,
"editmanual");
380 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
382 $form->setFormAction($ilCtrl->getFormAction($this,
"showtlt"));
383 $form->setTitle($lng->txt(
"learning_progress"));
384 $form->setDescription($lng->txt(
"trac_collection_tlt_learner_info"));
386 $coll_items = array();
388 include_once
'./Services/Object/classes/class.ilObjectLP.php';
390 $collection = $olp->getCollectionInstance();
393 $coll_items = $collection->getItems();
394 $possible_items = $collection->getPossibleItems($this->
getRefId());
397 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
399 $info = $class::_getStatusInfo($this->
getObjId(),
true);
401 foreach($coll_items as $item_id)
404 if(!array_key_exists($item_id, $possible_items))
413 if(isset($info[
"completed"][$item_id]) &&
414 in_array($ilUser->getId(), $info[
"completed"][$item_id]))
418 else if(isset($info[
"in_progress"][$item_id]) &&
419 in_array($ilUser->getId(), $info[
"in_progress"][$item_id]))
429 if(isset($info[
"tlt_users"][$item_id][$ilUser->getId()]))
431 $spent = $info[
"tlt_users"][$item_id][$ilUser->getId()];
433 $needed = $info[
"tlt"][$item_id];
436 $field->setInfo(sprintf($lng->txt(
"trac_collection_tlt_learner_subitem"),
439 min(100, round($spent/$needed*100))));
442 $form->addItem($field);
445 $tpl->setContent($form->getHTML());