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->active_pdf;
96 include_once
'Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
98 $this->active_pdf = $rpc_server->getHost() ?
true :
false;
103 return $this->anonymized;
108 switch($this->obj_type)
111 include_once
'./Modules/Test/classes/class.ilObjTest.php';
134 return $this->obj_id;
143 if((
int)
$_GET[
'user_id'])
145 return (
int) $_GET[
'user_id'];
152 $this->statistics_activated = $a_act;
158 if(strlen(
$cmd = $this->ctrl->getCmd()))
167 global $rbacsystem,$ilObjDataCache,
$lng,$ilUser;
175 $this->tabs_gui->addTarget(
'trac_progress',
176 $this->ctrl->getLinkTargetByClass(
'illplistofprogressgui',
''),
180 $types = array(
"crs",
"grp",
"exc",
"tst",
"lm",
"sahs",
"htlm",
"dbk");
183 $this->tabs_gui->addTarget(
'trac_objects',
184 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
192 if($rbacsystem->checkAccess(
'edit_learning_progress',$this->getRefId()))
196 $this->ctrl->setParameterByClass(
'illplistofprogressgui',
'user_id',$this->
getUserId());
197 $this->tabs_gui->addSubTabTarget(
'trac_progress',
198 $this->ctrl->getLinkTargetByClass(
'illplistofprogressgui',
''),
204 $sub_tab = ($ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($this->getRefId())) ==
'crs') ?
208 $this->tabs_gui->addSubTabTarget($sub_tab,
209 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
214 if ($this->statistics_activated)
216 $this->tabs_gui->addSubTabTarget(
'trac_lm_statistics',
217 $this->ctrl->getLinkTargetByClass(
'illmstatisticsgui',
''),
221 if(!$this->
isAnonymized() && !in_array($this->obj_type, array(
'tst',
'lm',
'htlm',
'exc')))
223 $this->tabs_gui->addSubTabTarget(
"trac_matrix",
224 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
'showUserObjectMatrix'),
225 "",
"",
"", $a_active == LP_ACTIVE_MATRIX);
228 $this->tabs_gui->addSubTabTarget(
"trac_summary",
229 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
'showObjectSummary'),
232 $this->tabs_gui->addSubTabTarget(
'trac_settings',
233 $this->ctrl->getLinkTargetByClass(
'illplistofsettingsgui',
''),
244 $this->tabs_gui->addSubTabTarget(
'trac_objects',
245 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
255 die (
'No valid mode given');
268 $this->tpl->show(
true);
280 $this->tpl->setTitle($this->lng->txt(
"learning_progress"));
313 $path_arr = $tree->getPathFull($a_ref_id);
315 foreach($tree->getPathFull($a_ref_id) as
$data)
323 $a_tpl->setCurrentBlock(
"path_item");
324 $a_tpl->setVariable(
"PATH_ITEM",
$path);
325 $a_tpl->parseCurrentBlock();
327 $a_tpl->setCurrentBlock(
"path");
328 $a_tpl->parseCurrentBlock();
343 $tpl->setVariable($tpl_prefix.
"STATUS_IMG",
345 $tpl->setVariable($tpl_prefix.
"STATUS_ALT",$lng->txt($a_status));
355 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
358 switch((
string)$a_status)
396 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
414 return $lng->txt($a_status);
422 include_once
"./Services/Table/classes/class.ilTableGUI.php";
433 global $ilObjDataCache;
435 $details_id = $item_id ? $item_id : $this->details_id;
437 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
443 $info->addSection($this->lng->txt(
'details'));
476 if(!is_object($a_user))
481 if($a_user->getId() != $ilUser->getId())
483 $info->addSection($this->lng->txt(
"trac_user_data"));
486 $info->addProperty($this->lng->txt(
'last_login'),
488 $info->addProperty($this->lng->txt(
'trac_total_online'),
496 global $ilObjDataCache;
498 $type = $ilObjDataCache->lookupType($item_id);
501 $info->addSection($this->lng->txt(
'trac_learning_progress'));
507 include_once
'Services/Tracking/classes/class.ilLearningProgress.php';
510 if($progress[
'access_time'])
512 $info->addProperty($this->lng->txt(
'last_access'),
517 $info->addProperty($this->lng->txt(
'last_access'),$this->lng->txt(
'trac_not_accessed'));
519 $info->addProperty($this->lng->txt(
'trac_visits'),(int) $progress[
'visits']);
526 include_once(
"./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
530 $info->addProperty($this->lng->txt(
'trac_status'),
531 ilUtil::img($status_path, $status_text).
" ".$status_text);
540 include_once(
"./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
544 $info->addProperty($this->lng->txt(
'trac_status'),
545 ilUtil::img($status_path, $status_text).
" ".$status_text);
550 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
553 $info->addProperty($this->lng->txt(
'trac_mark'),$mark);
557 $info->addProperty($this->lng->txt(
'trac_comment'),
$comment);
563 include_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
566 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
589 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
592 $this->tpl->setCurrentBlock(
"btn_cell");
593 $this->tpl->setVariable(
"BTN_LINK",$a_link);
594 $this->tpl->setVariable(
"BTN_TXT",$a_text);
597 $this->tpl->setVariable(
"BTN_TARGET",$a_target);
600 $this->tpl->parseCurrentBlock();
616 function __sort($a_ids,$a_table,$a_field,$a_id_name)
628 $where =
"WHERE ".$ilDB->in($a_id_name, $a_ids,
false,
'integer').
" ";
630 $query =
"SELECT ".$a_id_name.
" FROM ".$a_table.
" ".
632 "ORDER BY ".$a_field;
637 $ids[] =
$row->$a_id_name;
639 return $ids ? $ids : array();
649 return sprintf(
"%d%%",$reached / $max * 100);
654 global $ilObjDataCache;
656 foreach($a_items as $item_id)
659 $this->obj_data[$item_id][
'type'] = $ilObjDataCache->lookupType($item_id);
660 if($this->obj_data[$item_id][
'mode'] ==
LP_MODE_TLT)
662 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
667 include_once
'./Services/Tracking/classes/class.ilLPObjSettings.php';
672 include_once
'./Services/Tracking/classes/class.ilLPCollectionCache.php';
682 $tpl =
new ilTemplate(
"tpl.lp_legend.html",
true,
true,
"Services/Tracking");
683 $tpl->setVariable(
"IMG_NOT_ATTEMPTED",
685 $tpl->setVariable(
"IMG_IN_PROGRESS",
687 $tpl->setVariable(
"IMG_COMPLETED",
689 $tpl->setVariable(
"IMG_FAILED",
691 $tpl->setVariable(
"TXT_NOT_ATTEMPTED",
692 $lng->txt(
"trac_not_attempted"));
693 $tpl->setVariable(
"TXT_IN_PROGRESS",
694 $lng->txt(
"trac_in_progress"));
695 $tpl->setVariable(
"TXT_COMPLETED",
696 $lng->txt(
"trac_completed"));
697 $tpl->setVariable(
"TXT_FAILED",
698 $lng->txt(
"trac_failed"));
706 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
710 $obj_id = $ilObjDataCache->lookupObjId($a_ref_id);
714 $ilCtrl->setParameter($this,
'userdetails_id',$a_sub_id);
715 $obj_id = $ilObjDataCache->lookupObjId($a_sub_id);
718 $marks =
new ilLPMarks($obj_id, $a_user_id);
720 $tpl =
new ilTemplate(
'tpl.lp_edit_user.html',
true,
true,
'Services/Tracking');
722 $tpl->setVariable(
"OBJ_TITLE", $lng->txt(
"edit").
": ".$ilObjDataCache->lookupTitle($obj_id));
725 $ilCtrl->setParameter($this,
'user_id',$a_user_id);
726 $ilCtrl->setParameter($this,
'details_id',$a_ref_id);
727 $tpl->setVariable(
"FORMACTION",$ilCtrl->getFormAction($this));
730 $tpl->setVariable(
"ALT_IMG",$ilObjDataCache->lookupTitle($a_user_id));
731 $tpl->setVariable(
"TXT_LP",$lng->txt(
'trac_learning_progress_tbl_header'));
735 $type = $ilObjDataCache->lookupType($obj_id);
738 $tpl->setVariable(
"TXT_MARK",$lng->txt(
'trac_mark'));
742 $tpl->setVariable(
"TXT_COMMENT",$lng->txt(
'trac_comment'));
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);
765 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
767 $marks =
new ilLPMarks($obj_id, $user_id);
770 $marks->setCompleted((
bool)
$_POST[
'completed']);
773 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
779 global $objDefinition, $ilObjDataCache;
783 $a_type = $ilObjDataCache->lookupType($a_obj_id);
786 $class =
"ilObj".$objDefinition->getClassName($a_type).
"Access";
787 include_once $objDefinition->getLocation($a_type).
"/class.".$class.
".php";
789 return call_user_func(array($class,
'_isOffline'), $a_obj_id);