mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-06-25 05:00:28 +02:00
Nombreuses petites corrections, ajout de texte.
Les Correspondances peuvent démarrer :)
This commit is contained in:
@ -30,7 +30,8 @@ class GiveQuestions
|
||||
* @var Team $to_team
|
||||
*/
|
||||
private $to_team;
|
||||
private $question_1;
|
||||
private $question_0;
|
||||
private $question_1;
|
||||
private $question_2;
|
||||
private $question_3;
|
||||
private $question_4;
|
||||
@ -50,7 +51,7 @@ class GiveQuestions
|
||||
$this->files = [];
|
||||
$this->has_files = false;
|
||||
|
||||
for ($i = 1; $i <= 6; ++$i) {
|
||||
for ($i = 0; $i <= 6; ++$i) {
|
||||
if (strlen($files["file_$i"]["name"]) > 0) {
|
||||
$this->files[] = $files["file_$i"];
|
||||
$this->has_files = true;
|
||||
@ -59,7 +60,7 @@ class GiveQuestions
|
||||
$this->files[] = null;
|
||||
}
|
||||
|
||||
$this->questions = [$this->question_1, $this->question_2, $this->question_3, $this->question_4, $this->question_5, $this->question_6];
|
||||
$this->questions = [$this->question_0, $this->question_1, $this->question_2, $this->question_3, $this->question_4, $this->question_5, $this->question_6];
|
||||
}
|
||||
|
||||
public function makeVerifications()
|
||||
@ -73,12 +74,12 @@ class GiveQuestions
|
||||
"Vous devez poser au moins 3 questions.");
|
||||
ensure(!$this->has_files || $this->no_drawing, "Vous devez confirmer ne pas avoir inclus de texte dans vos pièces jointes.");
|
||||
|
||||
for ($i = 3; $i < 6; ++$i) {
|
||||
for ($i = 4; $i <= 6; ++$i) {
|
||||
if ($this->questions[$i] == "")
|
||||
$this->questions[$i] = null;
|
||||
}
|
||||
|
||||
for ($i = 0; $i < 6; ++$i) {
|
||||
for ($i = 0; $i <= 6; ++$i) {
|
||||
ensure($this->files[$i]["size"] <= 2e6, "Le fichier doit peser moins que 2 Mo.");
|
||||
ensure(!$this->files[$i]["error"], "Une erreur est survenue. Veuillez vérifier vos pièces jointes. Elles ne doivent pas peser plus de 2 Mo chacune.");
|
||||
}
|
||||
@ -92,7 +93,7 @@ class GiveQuestions
|
||||
|
||||
/** @var Question[] $questions */
|
||||
$questions = Question::getQuestions($team, $this->to_team);
|
||||
for ($i = 0; $i < 6; ++$i) {
|
||||
for ($i = 0; $i <= 6; ++$i) {
|
||||
$question = $questions[$i];
|
||||
if ($question->getQuestion() != $this->questions[$i] && $question->getAttachedFile() != null) {
|
||||
unlink("$LOCAL_PATH/files/" . $question->getAttachedFile());
|
||||
|
Reference in New Issue
Block a user