35 define(
"LP_MODE_PERSONAL_DESKTOP",1);
36 define(
"LP_MODE_ADMINISTRATION",2);
37 define(
"LP_MODE_REPOSITORY",3);
38 define(
"LP_MODE_USER_FOLDER",4);
40 define(
"LP_ACTIVE_SETTINGS",1);
41 define(
"LP_ACTIVE_OBJECTS",2);
42 define(
"LP_ACTIVE_PROGRESS",3);
43 define(
"LP_ACTIVE_LM_STATISTICS",4);
44 define(
"LP_ACTIVE_USERS",5);
45 define(
"LP_ACTIVE_SUMMARY",6);
46 define(
"LP_ACTIVE_OBJSTATACCESS",7);
47 define(
"LP_ACTIVE_OBJSTATTYPES",8);
48 define(
"LP_ACTIVE_OBJSTATDAILY",9);
49 define(
"LP_ACTIVE_OBJSTATADMIN",10);
51 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
77 $this->lng->loadLanguageModule(
'trac');
78 $this->tabs_gui =& $ilTabs;
80 $this->mode = $a_mode;
81 $this->ref_id = $a_ref_id;
82 $this->obj_id = $ilObjDataCache->lookupObjId($this->ref_id);
83 $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
84 $this->usr_id = $a_usr_id;
91 return $this->anonymized;
96 switch($this->obj_type)
99 include_once
'./Modules/Test/classes/class.ilObjTest.php';
122 return $this->obj_id;
131 if((
int)
$_GET[
'user_id'])
133 return (
int) $_GET[
'user_id'];
140 $this->statistics_activated = $a_act;
146 if(strlen(
$cmd = $this->ctrl->getCmd()))
163 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
167 $this->tabs_gui->addTarget(
'trac_progress',
168 $this->ctrl->getLinkTargetByClass(
'illplistofprogressgui',
''),
174 $this->tabs_gui->addTarget(
'trac_objects',
175 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
183 if($rbacsystem->checkAccess(
'edit_learning_progress',$this->getRefId()))
191 $this->ctrl->setParameterByClass(
'illplistofprogressgui',
'user_id',$this->
getUserId());
192 $this->tabs_gui->addSubTabTarget(
'trac_progress',
193 $this->ctrl->getLinkTargetByClass(
'illplistofprogressgui',
''),
199 $sub_tab = ($ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($this->getRefId())) ==
'crs') ?
203 $this->tabs_gui->addSubTabTarget($sub_tab,
204 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
209 if ($this->statistics_activated)
211 $this->tabs_gui->addSubTabTarget(
'trac_lm_statistics',
212 $this->ctrl->getLinkTargetByClass(
'illmstatisticsgui',
''),
216 if(!$this->
isAnonymized() && !in_array($this->obj_type, array(
'tst',
'lm',
'htlm',
'exc')))
218 $this->tabs_gui->addSubTabTarget(
"trac_matrix",
219 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
'showUserObjectMatrix'),
220 "",
"",
"", $a_active == LP_ACTIVE_MATRIX);
223 $this->tabs_gui->addSubTabTarget(
"trac_summary",
224 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
'showObjectSummary'),
228 $this->tabs_gui->addSubTabTarget(
'trac_settings',
229 $this->ctrl->getLinkTargetByClass(
'illplistofsettingsgui',
''),
240 $this->tabs_gui->addSubTabTarget(
'trac_objects',
241 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
251 die (
'No valid mode given');
264 $this->tpl->show(
true);
276 $this->tpl->setTitle($this->lng->txt(
"learning_progress"));
309 $path_arr = $tree->getPathFull($a_ref_id);
311 foreach($tree->getPathFull($a_ref_id) as
$data)
319 $a_tpl->setCurrentBlock(
"path_item");
320 $a_tpl->setVariable(
"PATH_ITEM",
$path);
321 $a_tpl->parseCurrentBlock();
323 $a_tpl->setCurrentBlock(
"path");
324 $a_tpl->parseCurrentBlock();
339 $tpl->setVariable($tpl_prefix.
"STATUS_IMG",
341 $tpl->setVariable($tpl_prefix.
"STATUS_ALT",$lng->txt($a_status));
351 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
354 switch((
string)$a_status)
392 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
410 return $lng->txt($a_status);
418 include_once
"./Services/Table/classes/class.ilTableGUI.php";
429 global $ilObjDataCache;
431 $details_id = $item_id ? $item_id : $this->details_id;
433 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
439 $info->addSection($this->lng->txt(
'details'));
475 if(!is_object($a_user))
480 if($a_user->getId() != $ilUser->getId())
482 $info->addSection($this->lng->txt(
"trac_user_data"));
485 $info->addProperty($this->lng->txt(
'last_login'),
487 $info->addProperty($this->lng->txt(
'trac_total_online'),
495 global $ilObjDataCache;
497 $type = $ilObjDataCache->lookupType($item_id);
500 $info->addSection($this->lng->txt(
'trac_learning_progress'));
506 include_once
'Services/Tracking/classes/class.ilLearningProgress.php';
509 if($progress[
'access_time'])
511 $info->addProperty($this->lng->txt(
'last_access'),
516 $info->addProperty($this->lng->txt(
'last_access'),$this->lng->txt(
'trac_not_accessed'));
518 $info->addProperty($this->lng->txt(
'trac_visits'),(int) $progress[
'visits']);
525 include_once(
"./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
529 $info->addProperty($this->lng->txt(
'trac_status'),
530 ilUtil::img($status_path, $status_text).
" ".$status_text);
539 include_once(
"./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
543 $info->addProperty($this->lng->txt(
'trac_status'),
544 ilUtil::img($status_path, $status_text).
" ".$status_text);
549 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
552 $info->addProperty($this->lng->txt(
'trac_mark'),$mark);
556 $info->addProperty($this->lng->txt(
'trac_comment'),
$comment);
562 include_once
'Services/Tracking/classes/class.ilLPStatus.php';
565 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
588 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
591 $this->tpl->setCurrentBlock(
"btn_cell");
592 $this->tpl->setVariable(
"BTN_LINK",$a_link);
593 $this->tpl->setVariable(
"BTN_TXT",$a_text);
596 $this->tpl->setVariable(
"BTN_TARGET",$a_target);
599 $this->tpl->parseCurrentBlock();
615 function __sort($a_ids,$a_table,$a_field,$a_id_name)
627 $where =
"WHERE ".$ilDB->in($a_id_name, $a_ids,
false,
'integer').
" ";
629 $query =
"SELECT ".$a_id_name.
" FROM ".$a_table.
" ".
631 "ORDER BY ".$a_field;
636 $ids[] =
$row->$a_id_name;
638 return $ids ? $ids : array();
648 return sprintf(
"%d%%",$reached / $max * 100);
653 global $ilObjDataCache;
655 foreach($a_items as $item_id)
658 $this->obj_data[$item_id][
'type'] = $ilObjDataCache->lookupType($item_id);
659 if($this->obj_data[$item_id][
'mode'] ==
LP_MODE_TLT)
661 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
666 include_once
'./Services/Tracking/classes/class.ilLPObjSettings.php';
671 include_once
'./Services/Tracking/classes/class.ilLPCollectionCache.php';
681 $tpl =
new ilTemplate(
"tpl.lp_legend.html",
true,
true,
"Services/Tracking");
682 $tpl->setVariable(
"IMG_NOT_ATTEMPTED",
684 $tpl->setVariable(
"IMG_IN_PROGRESS",
686 $tpl->setVariable(
"IMG_COMPLETED",
688 $tpl->setVariable(
"IMG_FAILED",
690 $tpl->setVariable(
"TXT_NOT_ATTEMPTED",
691 $lng->txt(
"trac_not_attempted"));
692 $tpl->setVariable(
"TXT_IN_PROGRESS",
693 $lng->txt(
"trac_in_progress"));
694 $tpl->setVariable(
"TXT_COMPLETED",
695 $lng->txt(
"trac_completed"));
696 $tpl->setVariable(
"TXT_FAILED",
697 $lng->txt(
"trac_failed"));
705 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
709 $obj_id = $ilObjDataCache->lookupObjId($a_ref_id);
713 $ilCtrl->setParameter($this,
'userdetails_id',$a_sub_id);
714 $obj_id = $ilObjDataCache->lookupObjId($a_sub_id);
717 $marks =
new ilLPMarks($obj_id, $a_user_id);
719 $tpl =
new ilTemplate(
'tpl.lp_edit_user.html',
true,
true,
'Services/Tracking');
721 $tpl->setVariable(
"OBJ_TITLE", $lng->txt(
"edit").
": ".$ilObjDataCache->lookupTitle($obj_id));
724 $ilCtrl->setParameter($this,
'user_id',$a_user_id);
725 $ilCtrl->setParameter($this,
'details_id',$a_ref_id);
726 $tpl->setVariable(
"FORMACTION",$ilCtrl->getFormAction($this));
729 $tpl->setVariable(
"ALT_IMG",$ilObjDataCache->lookupTitle($a_user_id));
730 $tpl->setVariable(
"TXT_LP",$lng->txt(
'trac_learning_progress_tbl_header'));
734 $type = $ilObjDataCache->lookupType($obj_id);
737 $tpl->setVariable(
"TXT_MARK",$lng->txt(
'trac_mark'));
741 $tpl->setVariable(
"TXT_COMMENT",$lng->txt(
'trac_comment'));
746 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
749 $tpl->setVariable(
"mode_manual");
750 $tpl->setVariable(
"TXT_COMPLETED",$lng->txt(
'trac_completed'));
756 $tpl->setVariable(
"TXT_CANCEL",$lng->txt(
'cancel'));
757 $tpl->setVariable(
"TXT_SAVE",$lng->txt(
'save'));
758 $tpl->setVariable(
"CMD_CANCEL", $a_cancel);
767 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
769 $marks =
new ilLPMarks($obj_id, $user_id);
774 if($marks->getCompleted() != (bool)
$_POST[
'completed'])
776 $marks->setCompleted((
bool)
$_POST[
'completed']);
785 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
792 global $objDefinition, $ilObjDataCache;
796 $a_type = $ilObjDataCache->lookupType($a_obj_id);
799 if($objDefinition->isPluginTypeName($a_type))
804 $class =
"ilObj".$objDefinition->getClassName($a_type).
"Access";
805 include_once $objDefinition->getLocation($a_type).
"/class.".$class.
".php";
806 return call_user_func(array($class,
'_isOffline'), $a_obj_id);