Fix issue with gamification enabled for all learning paths when there is a setting for that in each learning path. Enabling gamification for a learning path thus requires to enable it globally and *then* enable it at LP level

1.10.x
Yannick Warnier 10 years ago
parent a5e2432b38
commit 9cb8c047cd
  1. 9
      main/newscorm/lp_view.php

@ -455,7 +455,8 @@ if ($_SESSION['oLP']->current == $_SESSION['oLP']->get_last()) {
}
}
$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'));
@ -471,6 +472,12 @@ $template->assign(
'glossary_tool_availables',
['true', 'lp', 'exercise_and_lp']
);
// If the global gamification mode is enabled...
$gamificationMode = api_get_setting('gamification_mode');
// ...AND this learning path is set in gamification mode, then change the display
$gamificationMode = $gamificationMode && $_SESSION['oLP']->seriousgame_mode;
$template->assign('show_glossary_in_documents', api_get_setting('show_glossary_in_documents'));
$template->assign('jquery_web_path', api_get_jquery_web_path());
$template->assign('jquery_ui_js_web_path', api_get_jquery_ui_js_web_path());

Loading…
Cancel
Save