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 = '