Exercise: Fix condition when update questions

pull/4004/head
Angel Fernando Quiroz Campos 4 years ago
parent 932c80e820
commit b55702fe6f
  1. 19
      public/main/exercise/answer.class.php

@ -785,17 +785,14 @@ class Answer
if (count($this->position) > $this->new_nbrAnswers) { if (count($this->position) > $this->new_nbrAnswers) {
$i = $this->new_nbrAnswers + 1; $i = $this->new_nbrAnswers + 1;
if (isset($this->position[$i])) { while (isset($this->position[$i])) {
while ($this->position[$i]) { $position = $this->position[$i];
$position = $this->position[$i]; $sql = "DELETE FROM $answerTable
$sql = "DELETE FROM $answerTable WHERE
WHERE question_id = '".$questionId."' AND
c_id = {$this->course_id} AND position ='$position'";
question_id = '".$questionId."' AND Database::query($sql);
position ='$position'"; $i++;
Database::query($sql);
$i++;
}
} }
} }

Loading…
Cancel
Save