diff --git a/main/exercice/exercice.php b/main/exercice/exercice.php index f714d02453..31fdb1b656 100755 --- a/main/exercice/exercice.php +++ b/main/exercice/exercice.php @@ -546,7 +546,7 @@ if ($show == 'test') { } if ($is_allowedToEdit && $origin != 'learnpath') { - if ($_GET['show'] != 'result') { + if ($show != 'result') { echo '' . Display :: return_icon('new_exercice.png', get_lang('NewEx'),'','32').''; echo '' . Display :: return_icon('new_question.png', get_lang('AddQ'),'','32').''; echo '' . Display :: return_icon('import_hotpotatoes.png', get_lang('ImportHotPotatoesQuiz'),'','32').''; @@ -711,7 +711,7 @@ if ($show == 'test') { $myorigin = (empty ($origin) ? '' : '&origin=' . $origin); $mylpid = (empty ($learnpath_id) ? '' : '&learnpath_id=' . $learnpath_id); $mylpitemid = (empty ($learnpath_item_id) ? '' : '&learnpath_item_id=' . $learnpath_item_id); - + $token = Security::get_token(); $i=1; @@ -727,7 +727,8 @@ if ($show == 'test') { $header_list = ''; foreach($headers as $header) { - $header_list .= Display::tag('th', $header['name'], $header['params']); + $params = isset($header['params'])? $header['params'] : null; + $header_list .= Display::tag('th', $header['name'], $params); } echo Display::tag('tr', $header_list); @@ -806,7 +807,7 @@ if ($show == 'test') { } else { $title = $row['title']; } - $url = ' '.$title.' '.$lp_blocked; + $url = ' '.$title.' '.$lp_blocked; $item = Display::tag('td', $url.' '.$session_img); $exid = $row['id']; @@ -865,12 +866,12 @@ if ($show == 'test') { // if time is actived show link to exercise if ($time_limits) { if ($is_actived_time) { - $url = ''.$row['title'].''; + $url = ''.$row['title'].''; } else { $url = $row['title']; } } else { - $url = ''.$row['title'].''; + $url = ''.$row['title'].''; } //Link of the exercise @@ -1007,7 +1008,7 @@ if ($show == 'test') { } $nbrActiveTests = 0; - if (is_array($attribute['path'])) { + if (isset($attribute['path']) && is_array($attribute['path'])) { while (list($key, $path) = each($attribute['path'])) { $item = ''; list ($a, $vis) = each($attribute['visibility']); diff --git a/main/exercice/exercise.class.php b/main/exercice/exercise.class.php index 9e4d445e6f..b54bb91947 100755 --- a/main/exercice/exercise.class.php +++ b/main/exercice/exercise.class.php @@ -134,8 +134,10 @@ class Exercise { //this is needed only is there is no questions // // @todo not sure were in the code this is used somebody mess with the exercise tool + // @todo don't know who add that config and why $_configuration['live_exercise_tracking'] global $_configuration, $questionList; - if ($this->type == ONE_PER_PAGE && $_configuration['live_exercise_tracking'] && $_SERVER['REQUEST_METHOD'] != 'POST' && defined('QUESTION_LIST_ALREADY_LOGGED')) { + if ($this->type == ONE_PER_PAGE && $_SERVER['REQUEST_METHOD'] != 'POST' && defined('QUESTION_LIST_ALREADY_LOGGED') && + isset($_configuration['live_exercise_tracking']) && $_configuration['live_exercise_tracking']) { //if(empty($_SESSION['questionList'])) $this->questionList = $questionList; } @@ -1541,7 +1543,7 @@ class Exercise { $html = '
'; $confirmation_alert = $this->type == 1? " onclick=\"javascript:if(!confirm('".get_lang("ConfirmYourChoice")."')) return false;\" ":""; $submit_btn = '
'; +if(!$nbrQuestions) { + echo Display::display_warning_message(get_lang('NoQuestion')); +} \ No newline at end of file diff --git a/main/inc/header.inc.php b/main/inc/header.inc.php index fcced3b68d..6c9a6f2936 100755 --- a/main/inc/header.inc.php +++ b/main/inc/header.inc.php @@ -7,9 +7,6 @@ */ /* HEADERS SECTION */ -/* - * HTTP HEADER - */ // Server mode indicator. if (api_is_platform_admin()) { @@ -167,7 +164,7 @@ if (isset($htmlIncHeadXtra) && $htmlIncHeadXtra) { include api_get_path(LIBRARY_PATH).'javascript/email_links.lib.js.php'; $favico = ''; -if ($_configuration['multiple_access_urls']) { +if (isset($_configuration['multiple_access_urls']) && $_configuration['multiple_access_urls']) { $access_url_id = api_get_current_access_url_id(); if ($access_url_id != -1) { $url_info = api_get_access_url($access_url_id); diff --git a/main/inc/lib/database.lib.php b/main/inc/lib/database.lib.php index f5b6cf7693..4477917169 100755 --- a/main/inc/lib/database.lib.php +++ b/main/inc/lib/database.lib.php @@ -1124,7 +1124,7 @@ class Database { if (empty($conditions)) { return ''; } - $return_value = ''; + $return_value = $where_return = ''; foreach ($conditions as $type_condition => $condition_data) { if ($condition_data == false) { continue; diff --git a/main/inc/lib/online.inc.php b/main/inc/lib/online.inc.php index 4e99101b11..e316faf0dd 100755 --- a/main/inc/lib/online.inc.php +++ b/main/inc/lib/online.inc.php @@ -213,7 +213,7 @@ function who_is_online_count($valid, $friends = false) { } global $_configuration; - if ($_configuration['multiple_access_urls']) { + if (isset($_configuration['multiple_access_urls']) && $_configuration['multiple_access_urls']) { $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); $access_url_id = api_get_current_access_url_id(); if ($access_url_id != -1) {