19 declare(strict_types=0);
88 $this->tpl = $DIC->ui()->mainTemplate();
89 $this->
help = $DIC->help();
90 $this->
ctrl = $DIC->ctrl();
91 $this->
lng = $DIC->language();
92 $this->
lng->loadLanguageModule(
'trac');
93 $this->tabs_gui = $DIC->tabs();
94 $this->
toolbar = $DIC->toolbar();
96 $this->
user = $DIC->user();
97 $this->
access = $DIC->access();
98 $this->rbacsystem = $DIC->rbac()->system();
99 $this->rbacreview = $DIC->rbac()->review();
100 $this->tree = $DIC->repositoryTree();
101 $this->lom_services = $DIC->learningObjectMetadata();
103 $this->
http = $DIC->http();
105 $this->ui_factory = $DIC->ui()->factory();
106 $this->ui_renderer = $DIC->ui()->renderer();
108 $this->mode = $a_mode;
109 $this->ref_id = $a_ref_id;
112 $this->usr_id = $a_usr_id;
115 if (!$this->anonymized && $this->obj_id) {
117 $this->anonymized = $olp->isAnonymized();
119 $this->
logger = $DIC->logger()->trac();
144 if ($this->
http->wrapper()->query()->has(
'user_id')) {
145 return $this->
http->wrapper()->query()->retrieve(
166 if (strlen($cmd = $this->
ctrl->getCmd())) {
175 case self::LP_CONTEXT_PERSONAL_DESKTOP:
179 $this->tabs_gui->addTarget(
181 $this->
ctrl->getLinkTargetByClass(
182 'illplistofprogressgui',
188 $a_active == self::LP_ACTIVE_PROGRESS
193 case self::LP_CONTEXT_REPOSITORY:
196 if ($olp->isActive()) {
198 'read_learning_progress',
203 $this->
ctrl->setParameterByClass(
204 'illplistofprogressgui',
208 $this->tabs_gui->addSubTabTarget(
210 $this->
ctrl->getLinkTargetByClass(
211 'illplistofprogressgui',
217 $a_active == self::LP_ACTIVE_PROGRESS
229 $this->tabs_gui->addSubTabTarget(
231 $this->
ctrl->getLinkTargetByClass(
232 "illplistofobjectsgui",
238 $a_active == self::LP_ACTIVE_OBJECTS
246 $this->tabs_gui->addSubTabTarget(
248 $this->
ctrl->getLinkTargetByClass(
249 "illplistofobjectsgui",
250 'showUserObjectMatrix' 255 $a_active == self::LP_ACTIVE_MATRIX
259 $this->tabs_gui->addSubTabTarget(
261 $this->
ctrl->getLinkTargetByClass(
262 "illplistofobjectsgui",
268 $a_active == self::LP_ACTIVE_SUMMARY
274 'edit_learning_progress',
277 $this->tabs_gui->addSubTabTarget(
279 $this->
ctrl->getLinkTargetByClass(
280 'illplistofsettingsgui',
286 $a_active == self::LP_ACTIVE_SETTINGS
291 case self::LP_CONTEXT_USER_FOLDER:
292 case self::LP_CONTEXT_ORG_UNIT:
297 die(
'No valid mode given');
305 case self::LP_CONTEXT_PERSONAL_DESKTOP:
306 $this->tpl->printToStdout();
324 $lng = $DIC->language();
342 return $a_lng->txt((
string) $a_status);
352 string $item_type =
'',
353 bool $add_section =
true 355 $details_id = $item_id ?: $this->details_id;
356 $details_type = $item_type ?: $this->details_type;
359 $mode = $olp->getCurrentMode();
371 $this->
lng->txt(
'trac_required_visits'),
378 $this->
lng->txt(
'meta_typical_learning_time'),
389 $paths = $this->lom_services->paths();
390 $data_helper = $this->lom_services->dataHelper();
392 $value = $this->lom_services->read($obj_id, $sub_id, $type, $paths->firstTypicalLearningTime())
393 ->firstData($paths->firstTypicalLearningTime())
396 return $data_helper->durationToSeconds($value);
415 $this->
lng->txt(
'trac_mode'),
416 $olp->getModeText($olp->getCurrentMode())
426 $this->
lng->txt(
'trac_status'),
435 "tpl.lp_edit_manual_info_page.html",
438 "components/ILIAS/Tracking" 442 $this->
lng->txt(
"trac_info_edited")
452 [0 => $this->
lng->txt(
'trac_not_completed'),
453 1 => $this->
lng->txt(
'trac_completed')
459 $i_tpl->setVariable(
"TXT_SAVE", $this->
lng->txt(
"save"));
460 $info->
addProperty($this->
lng->txt(
'trac_status'), $i_tpl->get());
464 $mode = $olp->getCurrentMode();
483 $this->
lng->txt(
'trac_percentage'),
500 if (in_array($type, [
"lm",
"htlm"])) {
502 if ($progress[
'access_time'] ??
false) {
504 $this->
lng->txt(
'trac_last_access'),
511 $this->
lng->txt(
'trac_last_access'),
512 $this->
lng->txt(
'trac_not_accessed')
517 $this->
lng->txt(
'trac_visits'),
518 (string) ($progress[
'visits'] ??
"")
523 $this->
lng->txt(
'trac_spent_time'),
525 $progress[
'spent_seconds']
558 "tpl.lp_legend.html",
561 "components/ILIAS/Tracking" 581 $this->
lng->txt(
"trac_not_attempted")
585 $this->
lng->txt(
"trac_in_progress")
589 $this->
lng->txt(
"trac_completed")
593 $this->
lng->txt(
"trac_failed")
596 $panel = $this->ui_factory->panel()->secondary()->legacy(
598 $this->ui_factory->legacy()->content($tpl->
get())
601 return $this->ui_renderer->render($panel);
607 ?
string $a_cancel =
null 610 $lp_mode = $olp->getCurrentMode();
614 $form->setFormAction($this->
ctrl->getFormAction($this,
"updateUser"));
619 $form->setDescription(
620 $this->
lng->txt(
'trac_mode') .
": " . $olp->getModeText($lp_mode)
625 $form->addItem($user);
627 $marks =
new ilLPMarks($a_obj_id, $a_user_id);
631 $mark->setValue($marks->getMark());
632 $mark->setMaxLength(32);
633 $form->addItem($mark);
637 $comm->setValue($marks->getComment());
638 $form->addItem($comm);
645 $this->
lng->txt(
'trac_completed'),
651 $form->addItem($status);
654 $form->addCommandButton(
"updateUser", $this->
lng->txt(
'save'));
657 $form->addCommandButton($a_cancel, $this->
lng->txt(
'cancel'));
666 ?
string $a_cancel =
null,
672 $this->
ctrl->setParameter($this,
'userdetails_id', $a_sub_id);
675 $this->
ctrl->setParameter($this,
'user_id', $a_user_id);
676 $this->
ctrl->setParameter($this,
'details_id', $a_ref_id);
678 return $form->getHTML();
684 if ($form->checkInput()) {
685 $marks =
new ilLPMarks($obj_id, $user_id);
686 $marks->setMark($form->getInput(
"mark"));
687 $marks->setComment($form->getInput(
"comment"));
692 $status = $form->getItemByPostVar(
"completed");
693 if (is_object($status)) {
694 if ($marks->getCompleted() != $form->getInput(
"completed")) {
695 $marks->setCompleted($form->getInput(
"completed"));
721 $objDefinition = $DIC[
'objDefinition'];
722 $ilObjDataCache = $DIC[
'ilObjDataCache'];
725 $a_type = $ilObjDataCache->lookupType($a_obj_id);
728 if ($objDefinition->isPluginTypeName($a_type)) {
731 $class =
"ilObj" . $objDefinition->getClassName($a_type) .
"Access";
732 return (
bool) $class::_isOffline($a_obj_id);
const LP_STATUS_COMPLETED_NUM
static _lookupVisits(int $a_obj_id)
readTypicalLearningTimeInSeconds(int $obj_id, int $sub_id, string $type)
const LP_MODE_CMIX_COMPLETED
ilObjectDataCache $ilObjectDataCache
const LP_MODE_CMIX_COMPLETED_OR_PASSED
__showEditUser(int $a_user_id, int $a_ref_id, ?string $a_cancel=null, int $a_sub_id=0)
static _lookupComment(int $a_usr_id, int $a_obj_id)
__showObjectDetails(ilInfoScreenGUI $info, int $item_id=0, string $item_type='', bool $add_section=true)
show details about current object.
static _getProgress(int $a_user_id, int $a_obj_id)
const LP_MODE_MANUAL_BY_TUTOR
LOMServices $lom_services
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static isSupportedObjectType(string $type)
const LP_MODE_CMIX_PASSED_WITH_FAILED
static _hasLearningProgressLearner()
static supportsMatrixView(string $obj_type)
const LP_STATUS_NOT_ATTEMPTED
const LP_MODE_CMIX_PASSED
static _lookupPercentage(int $a_obj_id, int $a_user_id)
Lookup percentage.
addProperty(string $a_name, string $a_value, string $a_link="")
add a property to current section
const LP_STATUS_IN_PROGRESS_NUM
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
__updateUser(int $user_id, int $obj_id)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
const LP_ACTIVE_OBJSTATADMIN
const LP_CONTEXT_USER_FOLDER
static secondsToString(int $seconds, bool $force_with_seconds=false, ?ilLanguage $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
const LP_CONTEXT_ADMINISTRATION
initEditUserForm(int $a_user_id, int $a_obj_id, ?string $a_cancel=null)
const LP_STATUS_IN_PROGRESS
const LP_MODE_CMIX_COMPL_WITH_FAILED
static _lookupObjId(int $ref_id)
static _hasCompleted(int $a_usr_id, int $a_obj_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static _enabledUserRelatedData()
static http()
Fetches the global http state from ILIAS.
const LP_ACTIVE_OBJSTATDAILY
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path='ilpublicuserprofilegui')
Default behaviour is:
static _lookupTitle(int $obj_id)
RefineryFactory $refinery
__setSubTabs(int $a_active)
const LP_MODE_TEST_PASSED
addSection(string $a_title)
const LP_CONTEXT_PERSONAL_DESKTOP
static _getStatusText(int $a_status, ?ilLanguage $a_lng=null)
Get status alt text.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
static _lookupStatus(int $a_obj_id, int $a_user_id, bool $a_create=true)
Lookup status.
const LP_CONTEXT_ORG_UNIT
const LP_STATUS_NOT_ATTEMPTED_NUM
static _lookupMark(int $a_usr_id, int $a_obj_id)
__construct(int $a_mode, int $a_ref_id=0, int $a_usr_id=0)
static __readStatus(int $a_obj_id, int $user_id)
PhpInconsistentReturnPointsInspection
__appendLPDetails(ilInfoScreenGUI $info, int $item_id, int $user_id)
const LP_ACTIVE_OBJSTATTYPES
const LP_CONTEXT_REPOSITORY
const LP_MODE_CMIX_COMPL_OR_PASSED_WITH_FAILED
static checkPermission(string $a_permission, int $a_ref_id, ?int $a_user_id=null)
wrapper for rbac access checks
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
__getLegendHTML(int $variant=ilLPStatusIcons::ICON_VARIANT_LONG)
const LP_ACTIVE_OBJSTATACCESS
static supportsMark(string $obj_type)
static _lookupType(int $id, bool $reference=false)
ilGlobalTemplateInterface $tpl
static isObjectOffline(int $a_obj_id, string $a_type='')
const LP_STATUS_COMPLETED
const LP_MODE_LTI_OUTCOME
static getInstance(int $obj_id)
const LP_STATUS_FAILED_NUM
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)