diff --git a/main/newscorm/lp_view.php b/main/newscorm/lp_view.php index 6ff61d97be..b3e615ff0e 100755 --- a/main/newscorm/lp_view.php +++ b/main/newscorm/lp_view.php @@ -397,6 +397,8 @@ if ($_SESSION['oLP']->get_preview_image()) { $lpPreviewImagePath = $_SESSION['oLP']->get_preview_image_path(); } +$gamificationMode = api_get_setting('gamification_mode'); + $template = new Template('title', false, false, true, true, false); $template->assign('glossary_extra_tools', api_get_setting('show_glossary_in_extra_tools')); $template->assign( @@ -408,20 +410,8 @@ $template->assign('jquery_web_path', api_get_jquery_web_path()); $template->assign('jquery_ui_js_web_path', api_get_jquery_ui_js_web_path()); $template->assign('jquery_ui_css_web_path', api_get_jquery_ui_css_web_path()); $template->assign('is_allowed_to_edit', $is_allowed_to_edit); - -if (api_get_setting('gamification_mode') == '1') { - $template->assign( - 'gamification_stars', - $_SESSION['oLP']->getCalculateStars($sessionId) - ); - $template->assign( - 'gamification_score', - $_SESSION['oLP']->getCalculateScore($sessionId) - ); -} - +$template->assign('gamification_mode', $gamificationMode); $template->assign('breadcrumb', $breadcrumb); - $template->assign('button_home_url', $buttonHomeUrl); $template->assign('button_home_text', $buttonHomeText); $template->assign('navigation_bar', $navigation_bar); @@ -431,14 +421,18 @@ $template->assign('media_player', $mediaplayer); $template->assign('toc_list', $get_toc_list); $template->assign('iframe_src', $src); $template->assign('navigation_bar_bottom', $navigation_bar_bottom); -$template->assign( - 'gamification_stars', - $_SESSION['oLP']->getCalculateStars($sessionId) -); -$template->assign( - 'gamification_points', - $_SESSION['oLP']->getCalculateScore($sessionId) -); + +if ($gamificationMode == 1) { + $template->assign( + 'gamification_stars', + $_SESSION['oLP']->getCalculateStars($sessionId) + ); + $template->assign( + 'gamification_points', + $_SESSION['oLP']->getCalculateScore($sessionId) + ); +} + $template->assign( 'lp_preview_image', Display::return_icon(