Learnpath: Set correct item type to avoid frameReady issue - refs BT#21752

pull/5554/head
christianbeeznst 1 year ago
parent 044cb7a839
commit ad9e934195
  1. 2
      public/main/exercise/exercise_result.php
  2. 2
      public/main/exercise/result.php
  3. 5
      public/main/inc/lib/display.lib.php
  4. 5
      public/main/lp/lp_view.php

@ -266,7 +266,7 @@ ExerciseLib::exercise_time_control_delete(
ExerciseLib::delete_chat_exercise_session($exeId);
if (!in_array($origin, ['learnpath', 'embeddable', 'mobileapp'])) {
$pageBottom .= '<div class="question-return">';
$pageBottom .= '<div class="question-return mb-4">';
$pageBottom .= Display::url(
get_lang('Return to Course Homepage'),
api_get_course_url(),

@ -156,7 +156,7 @@ switch ($action) {
$lpId = (int) $track_exercise_info['orig_lp_id'];
$lpItemId = (int) $track_exercise_info['orig_lp_item_id'];
$lpViewId = (int) $track_exercise_info['orig_lp_item_view_id'];
$pageBottom = '<div class="question-return">';
$pageBottom = '<div class="question-return mb-4">';
$pageBottom .= Display::url(
get_lang('Back to the attempt list'),
api_get_path(WEB_CODE_PATH).'exercise/overview.php?exerciseId='.$exercise_id.'&'.api_get_cidreq().

@ -2667,6 +2667,11 @@ class Display
string $itemType = '',
string $jsConditionalFunction = 'function () { return false; }'
): string {
if (in_array($itemType, ['link', 'sco', 'xapi', 'quiz', 'h5p', 'forum'])) {
return false;
}
$colorThemeRepo = Container::$container->get(ColorThemeRepository::class);
$router = Container::getRouter();

@ -59,6 +59,7 @@ if (false === $visibility &&
}
$lp_item_id = $oLP->get_current_item_id();
$lpCurrentItemId = isset($_GET['lp_item_id']) ? (int) $_GET['lp_item_id'] : $oLP->get_current_item_id();
$lpType = $lp->getLpType();
if (!api_is_allowed_to_edit(null, true)) {
@ -191,7 +192,7 @@ $get_teacher_buttons = $oLP->get_teacher_toc_buttons();
$itemType = '';
$type_quiz = false;
foreach ($get_toc_list as $toc) {
if ($toc['id'] == $lp_item_id) {
if ($toc['id'] == $lpCurrentItemId) {
$itemType = $toc['type'];
$type_quiz = 'quiz' === $toc['type'];
}
@ -536,7 +537,7 @@ if (Tracking::minimumTimeAvailable(api_get_session_id(), api_get_course_int_id()
$template->assign('lp_accumulate_work_time', $lpMinTime);
$template->assign('lp_mode', $lp->getDefaultViewMod());
$template->assign('lp_title_scorm', stripslashes($lp->getTitle()));
$template->assign('lp_item_parents', $oLP->getCurrentItemParentNames($oLP->get_current_item_id()));
$template->assign('lp_item_parents', $oLP->getCurrentItemParentNames($lpCurrentItemId));
// @todo Fix lp_view_accordion
/*if ('true' === api_get_setting('lp.lp_view_accordion') && 1 == $lpType) {

Loading…
Cancel
Save