Remove e_notice when editing multiple answer question

pull/2495/head
Angel Fernando Quiroz Campos 8 years ago
parent 3917be86c1
commit 9a498d576b
  1. 2
      main/exercise/Draggable.php
  2. 4
      main/exercise/MatchingDraggable.php
  3. 2
      main/exercise/UniqueAnswerImage.php
  4. 1
      main/exercise/answer.class.php
  5. 2
      main/exercise/global_multiple_answer.class.php
  6. 4
      main/exercise/matching.class.php
  7. 2
      main/exercise/multiple_answer.class.php
  8. 2
      main/exercise/multiple_answer_combination.class.php
  9. 2
      main/exercise/multiple_answer_true_false.class.php
  10. 2
      main/exercise/unique_answer.class.php
  11. 2
      main/exercise/unique_answer_no_option.class.php

@ -55,7 +55,7 @@ class Draggable extends Question
$answer = new Answer($this->id); $answer = new Answer($this->id);
$answer->read(); $answer->read();
if (count($answer->nbrAnswers) > 0) { if ($answer->nbrAnswers > 0) {
$nb_matches = $nb_options = 0; $nb_matches = $nb_options = 0;
for ($i = 1; $i <= $answer->nbrAnswers; $i++) { for ($i = 1; $i <= $answer->nbrAnswers; $i++) {
if ($answer->isCorrect($i)) { if ($answer->isCorrect($i)) {

@ -35,7 +35,7 @@ class MatchingDraggable extends Question
$answer = new Answer($this->id); $answer = new Answer($this->id);
$answer->read(); $answer->read();
if (!empty($answer->nbrAnswers) && count($answer->nbrAnswers) > 0) { if ($answer->nbrAnswers > 0) {
for ($i = 1; $i <= $answer->nbrAnswers; $i++) { for ($i = 1; $i <= $answer->nbrAnswers; $i++) {
$correct = $answer->isCorrect($i); $correct = $answer->isCorrect($i);
if (empty($correct)) { if (empty($correct)) {
@ -58,7 +58,7 @@ class MatchingDraggable extends Question
$nb_options++; $nb_options++;
} }
} elseif (!empty($this->id)) { } elseif (!empty($this->id)) {
if (count($answer->nbrAnswers) > 0) { if ($answer->nbrAnswers > 0) {
$nb_matches = $nb_options = 0; $nb_matches = $nb_options = 0;
for ($i = 1; $i <= $answer->nbrAnswers; $i++) { for ($i = 1; $i <= $answer->nbrAnswers; $i++) {
if ($answer->isCorrect($i)) { if ($answer->isCorrect($i)) {

@ -77,7 +77,7 @@ class UniqueAnswerImage extends UniqueAnswer
$answer = new Answer($this->id); $answer = new Answer($this->id);
$answer->read(); $answer->read();
if (count($answer->nbrAnswers) > 0 && !$form->isSubmitted()) { if ($answer->nbrAnswers > 0 && !$form->isSubmitted()) {
$numberAnswers = $answer->nbrAnswers; $numberAnswers = $answer->nbrAnswers;
} }
} }

@ -35,6 +35,7 @@ class Answer
public $new_hotspot_coordinates; public $new_hotspot_coordinates;
public $new_hotspot_type; public $new_hotspot_type;
public $autoId; public $autoId;
/** @var int Number of answers in the question */
public $nbrAnswers; public $nbrAnswers;
public $new_nbrAnswers; public $new_nbrAnswers;
public $new_destination; // id of the next question if feedback option is set to Directfeedback public $new_destination; // id of the next question if feedback option is set to Directfeedback

@ -58,7 +58,7 @@ class GlobalMultipleAnswer extends Question
if (!empty($this->id)) { if (!empty($this->id)) {
$answer = new Answer($this->id); $answer = new Answer($this->id);
$answer->read(); $answer->read();
if (count($answer->nbrAnswers) > 0 && !$form->isSubmitted()) { if ($answer->nbrAnswers > 0 && !$form->isSubmitted()) {
$nb_answers = $answer->nbrAnswers; $nb_answers = $answer->nbrAnswers;
} }
} }

@ -42,7 +42,7 @@ class Matching extends Question
if (isset($this->id)) { if (isset($this->id)) {
$answer = new Answer($this->id); $answer = new Answer($this->id);
$answer->read(); $answer->read();
if (!empty($answer->nbrAnswers) && count($answer->nbrAnswers) > 0) { if ($answer->nbrAnswers > 0) {
for ($i = 1; $i <= $answer->nbrAnswers; $i++) { for ($i = 1; $i <= $answer->nbrAnswers; $i++) {
$correct = $answer->isCorrect($i); $correct = $answer->isCorrect($i);
if (empty($correct)) { if (empty($correct)) {
@ -65,7 +65,7 @@ class Matching extends Question
$nb_options++; $nb_options++;
} }
} elseif (!empty($this->id)) { } elseif (!empty($this->id)) {
if (count($answer->nbrAnswers) > 0) { if ($answer->nbrAnswers > 0) {
$nb_matches = $nb_options = 0; $nb_matches = $nb_options = 0;
for ($i = 1; $i <= $answer->nbrAnswers; $i++) { for ($i = 1; $i <= $answer->nbrAnswers; $i++) {
if ($answer->isCorrect($i)) { if ($answer->isCorrect($i)) {

@ -67,7 +67,7 @@ class MultipleAnswer extends Question
if (!empty($this->id)) { if (!empty($this->id)) {
$answer = new Answer($this->id); $answer = new Answer($this->id);
$answer->read(); $answer->read();
if (count($answer->nbrAnswers) > 0 && !$form->isSubmitted()) { if ($answer->nbrAnswers > 0 && !$form->isSubmitted()) {
$nb_answers = $answer->nbrAnswers; $nb_answers = $answer->nbrAnswers;
} }
} }

@ -59,7 +59,7 @@ class MultipleAnswerCombination extends Question
if (!empty($this->id)) { if (!empty($this->id)) {
$answer = new Answer($this->id); $answer = new Answer($this->id);
$answer->read(); $answer->read();
if (count($answer->nbrAnswers) > 0 && !$form->isSubmitted()) { if ($answer->nbrAnswers > 0 && !$form->isSubmitted()) {
$nb_answers = $answer->nbrAnswers; $nb_answers = $answer->nbrAnswers;
} }
} }

@ -69,7 +69,7 @@ class MultipleAnswerTrueFalse extends Question
$answer = new Answer($this->id); $answer = new Answer($this->id);
$answer->read(); $answer->read();
if (count($answer->nbrAnswers) > 0 && !$form->isSubmitted()) { if ($answer->nbrAnswers > 0 && !$form->isSubmitted()) {
$nb_answers = $answer->nbrAnswers; $nb_answers = $answer->nbrAnswers;
} }
} }

@ -87,7 +87,7 @@ class UniqueAnswer extends Question
if (!empty($this->id)) { if (!empty($this->id)) {
$answer = new Answer($this->id); $answer = new Answer($this->id);
$answer->read(); $answer->read();
if (count($answer->nbrAnswers) > 0 && !$form->isSubmitted()) { if ($answer->nbrAnswers > 0 && !$form->isSubmitted()) {
$nb_answers = $answer->nbrAnswers; $nb_answers = $answer->nbrAnswers;
} }
} }

@ -84,7 +84,7 @@ class UniqueAnswerNoOption extends Question
if (!empty($this->id)) { if (!empty($this->id)) {
$answer = new Answer($this->id); $answer = new Answer($this->id);
$answer->read(); $answer->read();
if (count($answer->nbrAnswers) > 0 && !$form->isSubmitted()) { if ($answer->nbrAnswers > 0 && !$form->isSubmitted()) {
$nb_answers = $answer->nbrAnswers; $nb_answers = $answer->nbrAnswers;
} }
} }

Loading…
Cancel
Save