Removing PHP notices

skala
Julio Montoya 15 years ago
parent 72f717b598
commit 28f298d233
  1. 15
      main/exercice/exercice.php
  2. 6
      main/exercice/exercise.class.php
  3. 5
      main/exercice/question.class.php
  4. 37
      main/exercice/question_list_admin.inc.php
  5. 5
      main/inc/header.inc.php
  6. 2
      main/inc/lib/database.lib.php
  7. 2
      main/inc/lib/online.inc.php

@ -546,7 +546,7 @@ if ($show == 'test') {
}
if ($is_allowedToEdit && $origin != 'learnpath') {
if ($_GET['show'] != 'result') {
if ($show != 'result') {
echo '<a href="exercise_admin.php?' . api_get_cidreq() . '">' . Display :: return_icon('new_exercice.png', get_lang('NewEx'),'','32').'</a>';
echo '<a href="question_create.php?' . api_get_cidreq() . '">' . Display :: return_icon('new_question.png', get_lang('AddQ'),'','32').'</a>';
echo '<a href="hotpotatoes.php?' . api_get_cidreq() . '">' . Display :: return_icon('import_hotpotatoes.png', get_lang('ImportHotPotatoesQuiz'),'','32').'</a>';
@ -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 = '<a href="exercise_submit.php?'.api_get_cidreq().$myorigin.$mylpid.$myllpitemid.'&exerciseId='.$row['id'].'"><img src="../img/quiz.gif" /> '.$title.' </a>'.$lp_blocked;
$url = '<a href="exercise_submit.php?'.api_get_cidreq().$myorigin.$mylpid.$mylpitemid.'&exerciseId='.$row['id'].'"><img src="../img/quiz.gif" /> '.$title.' </a>'.$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 = '<a href="exercise_submit.php?'.api_get_cidreq().$myorigin.$mylpid.$myllpitemid.'&exerciseId='.$row['id'].'">'.$row['title'].'</a>';
$url = '<a href="exercise_submit.php?'.api_get_cidreq().$myorigin.$mylpid.$mylpitemid.'&exerciseId='.$row['id'].'">'.$row['title'].'</a>';
} else {
$url = $row['title'];
}
} else {
$url = '<a href="exercise_submit.php?'.api_get_cidreq().$myorigin.$mylpid.$myllpitemid.'&exerciseId='.$row['id'].'">'.$row['title'].'</a>';
$url = '<a href="exercise_submit.php?'.api_get_cidreq().$myorigin.$mylpid.$mylpitemid.'&exerciseId='.$row['id'].'">'.$row['title'].'</a>';
}
//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']);

@ -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 = '<div style="margin-top:-10px;">';
$confirmation_alert = $this->type == 1? " onclick=\"javascript:if(!confirm('".get_lang("ConfirmYourChoice")."')) return false;\" ":"";
$submit_btn = '<button class="next" type="submit" name="submit" name="submit_save" id="submit_save" '.$confirmation_alert.' >';
$hotspot_get = $_POST['hotspot'];
$hotspot_get = isset($_POST['hotspot'])?Security::remove_XSS($_POST['hotspot']):null;
if ($this->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT && $this->type == ONE_PER_PAGE) {
$submit_btn = '';

@ -82,7 +82,10 @@ abstract class Question
}
public function getIsContent() {
$isContent = intval($_REQUEST['isContent']);
$isContent = null;
if (isset($_REQUEST['isContent'])) {
$isContent = intval($_REQUEST['isContent']);
}
return $this->isContent = $isContent;
}

@ -169,21 +169,19 @@ if ($nbrQuestions) {
//forces the query to the database
$my_exercise->read($_GET['exerciseId']);
$questionList=$my_exercise->selectQuestionList();
$i=1;
if (is_array($questionList)) {
echo '<div id="question_list">';
if (is_array($questionList)) {
echo '<div id="question_list">';
foreach($questionList as $id) {
//To avoid warning messages
if (!is_numeric($id)) {
continue;
}
$objQuestionTmp = Question :: read($id);
$question_class = get_class($objQuestionTmp);
$label = $question_class->$explanationLangVar;
$question_class = get_class($objQuestionTmp);
//$label = $question_class->$explanationLangVar;
$edit_link = '<a href="'.api_get_self().'?'.api_get_cidreq().'&type='.$objQuestionTmp->selectType().'&myid=1&editQuestion='.$id.'">'.Display::return_icon('edit.gif',get_lang('Modify')).'</a>';
// this variable $show_quiz_edition comes from admin.php blocks the exercise/quiz modifications
@ -207,9 +205,9 @@ if ($nbrQuestions) {
echo '</div>';
echo '<div class="question-list-description-block">';
echo '<p>';
//echo $actions;
echo get_lang($question_class.$label);
echo '<p>';
//echo get_lang($question_class.$label);
echo get_lang($question_class);
echo '<br />';
//echo get_lang('Level').': '.$objQuestionTmp->selectLevel();
echo '<br />';
@ -225,16 +223,7 @@ if ($nbrQuestions) {
echo '</div>';
}
}
?>
</table></div>
<table border="0" align="center" cellpadding="2" cellspacing="2" width="100%">
<?php
if(!$i) {
?>
<tr>
<td><?php echo get_lang('NoQuestion'); ?></td>
</tr>
<?php
}
?>
</table>
echo '</table></div>';
if(!$nbrQuestions) {
echo Display::display_warning_message(get_lang('NoQuestion'));
}

@ -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 = '<link rel="shortcut icon" href="'.api_get_path(WEB_PATH).'favicon.ico" type="image/x-icon" />';
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);

@ -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;

@ -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) {

Loading…
Cancel
Save