Fix c_quiz_answer's correct to matching question type

1.10.x
Angel Fernando Quiroz Campos 9 years ago
parent 899c5c7976
commit 23a7ee415f
  1. 18
      app/Migrations/Schema/V110/Version20151221150100.php

@ -19,17 +19,27 @@ class Version20151221150100 extends AbstractMigrationChamilo
$this->addSql("
UPDATE track_e_attempt a
INNER JOIN c_quiz_answer qa
ON (a.question_id = qa.question_id AND a.c_id = qa.c_id)
ON a.question_id = qa.question_id
INNER JOIN c_quiz_question q
ON qa.question_id = q.id
SET a.answer = qa.id_auto
WHERE a.answer = qa.id
WHERE
a.answer = qa.id AND
q.c_id = a.c_id AND
q.type IN (" . MATCHING . ", " . DRAGGABLE . ", " . MATCHING_DRAGGABLE . ")
");
$this->addSql("
UPDATE c_quiz_answer a
INNER JOIN c_quiz_answer b
ON (a.question_id = b.question_id AND a.c_id = b.c_id)
ON a.question_id = b.question_id
INNER JOIN c_quiz_question q
ON b.question_id = q.id
SET a.correct = b.id_auto
WHERE a.correct = b.id
WHERE
a.correct = b.id AND
q.c_id = a.c_id AND
q.type IN (" . MATCHING . ", " . DRAGGABLE . ", " . MATCHING_DRAGGABLE . ")
");
}

Loading…
Cancel
Save