4 include_once
'./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php';
26 $ilBench->start(
'LearningProgress',
'0000_Start');
28 $this->ctrl->setReturn($this,
"");
34 case 'illplistofprogressgui':
35 include_once
'Services/Tracking/classes/repository_statistics/class.ilLPListOfProgressGUI.php';
37 $ilHelp->setScreenIdComponent(
"lp");
42 $this->ctrl->forwardCommand($lop_gui);
45 case 'illplistofobjectsgui':
46 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
53 include_once
'Services/Tracking/classes/repository_statistics/class.ilLPListOfObjectsGUI.php';
54 if(stristr($this->ctrl->getCmd(),
"matrix"))
58 else if(stristr($this->ctrl->getCmd(),
"summary"))
68 $this->ctrl->forwardCommand($loo_gui);
71 case 'illplistofsettingsgui':
72 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
79 include_once
'Services/Tracking/classes/repository_statistics/class.ilLPListOfSettingsGUI.php';
84 $this->ctrl->forwardCommand($los_gui);
87 case 'illpobjectstatisticsgui':
88 include_once
'Services/Tracking/classes/object_statistics/class.ilLPObjectStatisticsGUI.php';
89 if(stristr($this->ctrl->getCmd(),
"access"))
93 else if(stristr($this->ctrl->getCmd(),
"types"))
97 else if(stristr($this->ctrl->getCmd(),
"daily"))
107 $this->ctrl->forwardCommand($ost_gui);
111 $cmd = $this->ctrl->getCmd();
116 $this->tpl->show(
true);
124 $ilBench->stop(
'LearningProgress',
'0000_Start');
134 if($this->ctrl->getCmdClass() == strtolower(get_class($this)))
136 $this->ctrl->setCmdClass(strtolower($a_class));
151 if(strlen($next_class = $this->ctrl->getNextClass()))
153 if($this->
getMode() == self::LP_CONTEXT_PERSONAL_DESKTOP)
155 $_SESSION[
'il_lp_history'] = $next_class;
161 case self::LP_CONTEXT_ADMINISTRATION:
162 return 'illplistofobjectsgui';
164 case self::LP_CONTEXT_REPOSITORY:
165 $cmd = $this->ctrl->getCmd();
166 if(in_array(
$cmd,
array(
"editmanual",
"updatemanual",
"showtlt")))
172 include_once
'./Services/Object/classes/class.ilObjectLP.php';
174 if(!$olp->isActive())
176 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
180 return 'illplistofsettingsgui';
188 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
189 if(!$this->anonymized &&
192 return 'illplistofobjectsgui';
197 return 'illplistofsettingsgui';
199 return 'illplistofprogressgui';
201 case self::LP_CONTEXT_PERSONAL_DESKTOP:
203 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
207 if($has_edit || $has_personal)
213 $tgt =
'illplistofprogressgui';
217 $tgt =
'illplistofobjectsgui';
223 case 'illplistofobjectsgui':
230 case 'illplistofprogressgui':
251 case self::LP_CONTEXT_USER_FOLDER:
252 case self::LP_CONTEXT_ORG_UNIT:
255 return 'illplistofprogressgui';
265 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
268 include_once
'./Services/Object/classes/class.ilObjectLP.php';
273 $tpl->setContent($form->getHTML());
282 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
284 $form->setFormAction($ilCtrl->getFormAction($this,
"updatemanual"));
285 $form->setTitle($lng->txt(
"learning_progress"));
286 $form->setDescription($lng->txt(
"trac_collection_manual_learner_info"));
288 $coll_items =
array();
290 include_once
'./Services/Object/classes/class.ilObjectLP.php';
292 $collection = $olp->getCollectionInstance();
295 $coll_items = $collection->getItems();
296 $possible_items = $collection->getPossibleItems($this->
getRefId());
301 $subitem_title = $lng->txt(
"objs_st");
302 $subitem_info = $lng->txt(
"trac_collection_manual_learner_lm_info");
307 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
309 $lp_data = $class::_getObjectStatus($this->
getObjId(), $this->usr_id);
312 $grp->setInfo($subitem_info);
313 $form->addItem($grp);
317 $completed =
array();
318 foreach(array_keys($possible_items) as $item_id)
320 if(!in_array($item_id, $coll_items))
328 if(isset($lp_data[$item_id]))
331 $info = $lng->txt(
"trac_collection_manual_learner_changed_ts").
": ".
334 if($lp_data[$item_id][0])
337 $completed[] = $item_id;
345 $opt =
new ilCheckboxOption($icon.
" ".$possible_items[$item_id][
"title"], $item_id);
348 $opt->setInfo(
$info);
350 $grp->addOption($opt);
355 $grp->setValue($completed);
358 $form->addCommandButton(
"updatemanual", $lng->txt(
"save"));
367 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
370 include_once
'./Services/Object/classes/class.ilObjectLP.php';
375 if($form->checkInput())
377 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
379 $class::_setObjectStatus($this->
getObjId(), $this->usr_id, $form->getInput(
"sids"));
384 $ilCtrl->redirect($this,
"editmanual");
393 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
395 $form->setFormAction($ilCtrl->getFormAction($this,
"showtlt"));
396 $form->setTitle($lng->txt(
"learning_progress"));
397 $form->setDescription($lng->txt(
"trac_collection_tlt_learner_info"));
399 $coll_items =
array();
401 include_once
'./Services/Object/classes/class.ilObjectLP.php';
403 $collection = $olp->getCollectionInstance();
406 $coll_items = $collection->getItems();
407 $possible_items = $collection->getPossibleItems($this->
getRefId());
410 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
414 foreach($coll_items as $item_id)
417 if(!array_key_exists($item_id, $possible_items))
426 if(isset(
$info[
"completed"][$item_id]) &&
427 in_array($ilUser->getId(),
$info[
"completed"][$item_id]))
431 else if(isset(
$info[
"in_progress"][$item_id]) &&
432 in_array($ilUser->getId(),
$info[
"in_progress"][$item_id]))
442 if(isset(
$info[
"tlt_users"][$item_id][$ilUser->getId()]))
444 $spent =
$info[
"tlt_users"][$item_id][$ilUser->getId()];
446 $needed =
$info[
"tlt"][$item_id];
449 $field->setInfo(sprintf($lng->txt(
"trac_collection_tlt_learner_subitem"),
452 min(100, round(abs($spent)/$needed*100))));
455 $form->addItem($field);
458 $tpl->setContent($form->getHTML());
const LP_STATUS_COMPLETED_NUM
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
This class represents an option in a checkbox group.
static _getImagePathForStatus($a_status)
Get image path for status.
static _hasLearningProgressLearner()
static _getStatusText($a_status, $a_lng=null)
Get status alt text.
executeCommand()
execute command
const LP_STATUS_IN_PROGRESS_NUM
Class ilLPListOfSettingsGUI.
const LP_MODE_COLLECTION_MANUAL
static _hasLearningProgressOtherUsers()
const LP_MODE_COLLECTION_TLT
static checkPermission($a_permission, $a_ref_id, $a_user_id=null)
wrapper for rbac access checks
static _getClassById($a_obj_id, $a_mode=NULL)
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
static _enabledUserRelatedData()
check wether user related tracking is enabled or not
static _enabledLearningProgress()
check wether learing progress is enabled or not
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
initCollectionManualForm()
static _lookupObjId($a_id)
static formatDate(ilDateTime $date)
Format a date public.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
const LP_STATUS_NOT_ATTEMPTED_NUM
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static redirect($a_script)
http redirect to other script
static getInstance($a_obj_id)
Class ilObjUserTrackingGUI.