mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-06-25 14:57:24 +02:00
Nombreuses petites corrections, ajout de texte.
Les Correspondances peuvent démarrer :)
This commit is contained in:
@ -68,7 +68,7 @@ class Question
|
||||
|
||||
ensure($from->getProblem() == $to->getProblem(), "Les deux équipes doivent travailler sur le même problème.");
|
||||
|
||||
$req = $DB->prepare("SELECT * FROM `questions` WHERE `from` = ? AND `to` = ? ORDER BY `from`;");
|
||||
$req = $DB->prepare("SELECT * FROM `questions` WHERE `from` = ? AND `to` = ? ORDER BY `from`, `number`;");
|
||||
$req->execute([$from->getId(), $to->getId()]);
|
||||
|
||||
$questions = [];
|
||||
@ -80,9 +80,11 @@ class Question
|
||||
}
|
||||
|
||||
if (sizeof($questions) == 0) {
|
||||
for ($i = 0; $i < 6; ++$i) {
|
||||
$req = $DB->prepare("INSERT INTO `questions`(`from`, `to`, `problem`, `number`, `question`) VALUES (?, ?, ?, ?, ?);");
|
||||
$req->execute([$from->getId(), $to->getId(), $from->getProblem(), 0, ""]);
|
||||
for ($i = 1; $i <= 6; ++$i) {
|
||||
$req = $DB->prepare("INSERT INTO `questions`(`from`, `to`, `problem`, `number`, `question`) VALUES (?, ?, ?, ?, ?);");
|
||||
$req->execute([$from->getId(), $to->getId(), $from->getProblem(), $i, self::DEFAULT_QUESTIONS[$i]]);
|
||||
$req->execute([$from->getId(), $to->getId(), $from->getProblem(), $i, self::DEFAULT_QUESTIONS[$i - 1]]);
|
||||
}
|
||||
return self::getQuestions($from, $to);
|
||||
}
|
||||
|
Reference in New Issue
Block a user