Skip to content

Commit

Permalink
43498: Failed test: Versuch, zeitlich begrenzt aktivierte Seite aufzu…
Browse files Browse the repository at this point in the history
…rufen
  • Loading branch information
alex40724 committed Feb 21, 2025
1 parent 4960416 commit 583e115
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ protected function determineStatus(): int
if ($this->current_page == 0) {
$status = self::STATUS_NO_PAGE_FOUND;
}

return $status;
}

Expand Down Expand Up @@ -464,7 +463,7 @@ protected function renderDeactivatedPageMessage(): string
"components/ILIAS/LearningModule"
);
$m = $this->lng->txt("cont_page_currently_deactivated");
$act_data = ilLMPage::_lookupActivationData($this->requested_obj_id, $this->lm->getType());
$act_data = ilLMPage::_lookupActivationData($this->current_page, $this->lm->getType());
if ($act_data["show_activation_info"] &&
(ilUtil::now() < $act_data["activation_start"])) {
$m .= "<p>" . sprintf(
Expand All @@ -478,7 +477,7 @@ protected function renderDeactivatedPageMessage(): string
$mtpl->setVariable("MESSAGE", $m);
$mtpl->setVariable(
"ITEM_TITLE",
ilLMObject::_lookupTitle($this->requested_obj_id)
ilLMObject::_lookupTitle($this->current_page)
);
return $mtpl->get();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ protected function determineStatus(): void
// determine object id
if ($requested_obj_id == 0) {
$obj_id = $this->lm_tree->getRootId();

if ($this->cmd == "resume") {
if ($user->getId() != ANONYMOUS_USER_ID && ($this->focus_id == 0)) {
$last_accessed_page = ilObjLearningModuleAccess::_getLastAccessedPage($this->lm->getRefId(), $user->getId());
Expand Down Expand Up @@ -122,15 +121,12 @@ protected function determineStatus(): void
$this->current_page_id = $obj_id;
return;
}

$curr_node = $this->lm_tree->getNodeData($obj_id);

$active = ilLMPage::_lookupActive(
$obj_id,
$this->lm->getType(),
(bool) $this->lm_set->get("time_scheduled_page_activation")
);

$show = $active;

// look, whether activation data should be shown
Expand All @@ -155,6 +151,16 @@ protected function determineStatus(): void
$this->lm->getType(),
$this->lm_set->get("time_scheduled_page_activation")
);
if (!$active) {
// look, whether activation data should be shown
$act_data = ilLMPage::_lookupActivationData((int) $page_id, $this->lm->getType());
if ($act_data["show_activation_info"] ?? false) {
$active = true;
if (ilLMPageObject::_lookupType($page_id) == "pg") {
$this->deactivated_page = true;
}
}
}
}
}

Expand Down

0 comments on commit 583e115

Please sign in to comment.