1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-25 11:00:29 +02:00

Possibilité de ne pas choisir de problème immédiatement

This commit is contained in:
Yohann
2019-10-04 21:41:12 +02:00
parent 1c33c84a3a
commit 7eba8b542b
7 changed files with 9 additions and 5 deletions

View File

@ -45,7 +45,7 @@ class NewTeam {
ensure(preg_match("#^[A-Z]{3}$#", $this->trigram), "Le trigramme entré n'est pas valide.");
ensure(!teamExists($this->name), "Une équipe existe déjà avec ce nom.");
ensure(!trigramExists($this->trigram), "Une équipe a déjà choisi ce trigramme.");
ensure(preg_match("#[1-4]#", $this->problem), "Le problème choisi n'a pas été reconnu.");
ensure(preg_match("#[0-4]#", $this->problem), "Le problème choisi n'a pas été reconnu.");
}
public function register() {

View File

@ -81,7 +81,7 @@ class MyTeam
ensure(preg_match("#^[\p{L} ]+$#ui", $this->name), "Le nom de l'équipe ne doit pas comporter de caractères spéciaux.");
ensure(preg_match("#^[A-Z]{3}$#", $this->trigram), "Le trigramme n'est pas valide.");
ensure($this->trigram == $this->team->getTrigram() || !trigramExists($this->trigram), "Une équipe a déjà choisi ce trigramme.");
ensure(preg_match("#^[1-4]$#", $this->problem), "Le problème indiqué n'existe pas.");
ensure(preg_match("#^[0-4]$#", $this->problem), "Le problème indiqué n'existe pas.");
ensure(date("Y-m-d H:i:s") <= $CONFIG->getInscriptionDate(), "Les inscriptions sont terminées.");
ensure($this->team->getValidationStatus() == ValidationStatus::NOT_READY, "Votre équipe est déjà validée ou en cours de validation.");
}

View File

@ -2,7 +2,7 @@
$problem = htmlspecialchars($_GET["probleme"]);
if (!preg_match("#[1-4]#", $problem))
if (!preg_match("#[0-4]#", $problem))
require_once "server_files/404.php";
if (isset($_GET["modifier"]) && $_SESSION["role"] != Role::ADMIN)