Exercise: Fix condition when update questions

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

@ -785,19 +785,16 @@ 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
c_id = {$this->course_id} AND
question_id = '".$questionId."' AND question_id = '".$questionId."' AND
position ='$position'"; position ='$position'";
Database::query($sql); Database::query($sql);
$i++; $i++;
} }
} }
}
// moves $new_* arrays // moves $new_* arrays
$this->answer = $this->new_answer; $this->answer = $this->new_answer;

Loading…
Cancel
Save