Minor - Fix notice messages. Undefined variable issues.

1.9.x
Imanol Losada 12 years ago
parent 98a218b7d4
commit 6c4b056278
  1. 1
      main/exercice/global_multiple_answer.class.php
  2. 12
      main/exercice/hotspot_admin.inc.php
  3. 1
      main/exercice/multiple_answer.class.php
  4. 1
      main/exercice/multiple_answer_combination.class.php
  5. 3
      main/exercice/question.class.php
  6. 5
      main/exercice/question_admin.inc.php
  7. 4
      main/exercice/unique_answer_no_option.class.php

@ -55,6 +55,7 @@ class GlobalMultipleAnswer extends Question
$correct = 0;
/* Mise en variable du nombre de reponse */
$answer = false;
if (!empty($this->id)) {
$answer = new Answer($this->id);
$answer->read();

@ -69,6 +69,10 @@ if ($modifyIn) {
$hotspot_admin_url = api_get_path(WEB_CODE_PATH) . 'exercice/admin.php?' . api_get_cidreq() . '&exerciseId=' . $exerciseId;
// the answer form has been submitted
$submitAnswers = isset($submitAnswers) ? $submitAnswers : false;
$buttonBack = isset($buttonBack) ? $buttonBack : false;
$nbrAnswers = isset($nbrAnswers) ? $nbrAnswers : 0;
if ($submitAnswers || $buttonBack) {
if ($answerType == HOT_SPOT) {
@ -396,6 +400,7 @@ if ($modifyAnswers) {
$_SESSION['tmp_answers']['destination'] = $destination;
}
$lessAnswers = isset($lessAnswers) ? $lessAnswers : false;
if ($lessAnswers) {
if ($answerType == HOT_SPOT_DELINEATION) {
$lest_answer = 1;
@ -433,6 +438,7 @@ if ($modifyAnswers) {
}
}
$moreAnswers = isset($moreAnswers) ? $moreAnswers : false;
if ($moreAnswers) {
if ($nbrAnswers < 12) {
$nbrAnswers++;
@ -451,6 +457,7 @@ if ($modifyAnswers) {
}
}
$moreOARAnswers = isset($moreOARAnswers) ? $moreOARAnswers : false;
if ($moreOARAnswers) {
if ($nbrAnswers < 12) {
// Add a new answer
@ -871,7 +878,7 @@ if ($modifyAnswers) {
$flat_list = $list->get_flat_list();
$select_lp_id = array();
$option_lp = '';
//$option_lp.='<option value="0">'.get_lang('SelectTargetLP').'</option>';
$is_selected = false;
foreach ($flat_list as $id => $details) {
$selected = '';
$select_lp_id[$id] = $details['lp_name'];
@ -893,6 +900,9 @@ if ($modifyAnswers) {
$question_list = $objExercise->selectQuestionList();
$option_feed = '';
$option_feed.='<option value="0">' . get_lang('SelectTargetQuestion') . '</option>';
$details = isset($details) ? $details : null;
$id = isset($id) ? $id : 0;
$select_question_noerror = isset($select_question_noerror) ? $select_question_noerror : null;
foreach ($question_list as $key => $questionid) {
$selected = '';
$question = Question::read($questionid);

@ -61,6 +61,7 @@ class MultipleAnswer extends Question
$defaults = array();
$correct = 0;
$answer = false;
if(!empty($this -> id)) {
$answer = new Answer($this -> id);
$answer -> read();

@ -53,6 +53,7 @@ class MultipleAnswerCombination extends Question
$defaults = array();
$correct = 0;
$answer = false;
if(!empty($this -> id)) {
$answer = new Answer($this -> id);
$answer -> read();

@ -1125,7 +1125,7 @@ abstract class Question
return get_lang($key[1]);
}
static function get_question_type($type) {
static function get_question_type($type) {error_log('TYPE --> '.$type);
if ($type == ORAL_EXPRESSION && api_get_setting('enable_nanogong') != 'true') {
return null;
}
@ -1470,6 +1470,7 @@ abstract class Question
}
if ($this->type == FREE_ANSWER || $this->type == ORAL_EXPRESSION) {
$score['revised'] = isset($score['revised']) ? $score['revised'] : false;
if ($score['revised'] == true) {
$score_label = get_lang('Revised');
$class = '';

@ -27,7 +27,7 @@ if (is_object($objQuestion)) {
if (isset($_GET['editQuestion'])) {
$class="btn save";
$text=get_lang('ModifyQuestion');
$type = Security::remove_XSS($_GET['type']);
$type = isset($_GET['type']) ? Security::remove_XSS($_GET['type']) : null;
} else {
$class="btn add";
$text=get_lang('AddQuestionToExercise');
@ -35,7 +35,7 @@ if (is_object($objQuestion)) {
}
$types_information = Question::get_question_type_list();
$form_title_extra = get_lang($types_information[$type][1]);
$form_title_extra = isset($types_information[$type][1]) ? get_lang($types_information[$type][1]) : null;
// form title
$form->addElement('header', $text.': '.$form_title_extra);
@ -59,6 +59,7 @@ if (is_object($objQuestion)) {
$objQuestion->processCreation($form, $objExercise);
// answers
$nb_answers = isset($nb_answers) ? $nb_answers : 0;
$objQuestion->processAnswersCreation($form, $nb_answers);
// TODO: maybe here is the better place to index this tool, including answers text

@ -83,7 +83,7 @@ class UniqueAnswerNoOption extends Question
$defaults = array();
$correct = 0;
$answer = false;
if (!empty($this -> id)) {
$answer = new Answer($this -> id);
$answer -> read();
@ -98,8 +98,8 @@ class UniqueAnswerNoOption extends Question
$nb_answers = 1;
Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
}
$_GET['editQuestion'] = isset($_GET['editQuestion']) ? $_GET['editQuestion'] : false;
if ($_GET['editQuestion']) {
//fixing $nb_answers
$new_list = array();
$count = 1;

Loading…
Cancel
Save