1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2024-12-05 02:06:52 +00:00

Sélection des équipes pour la phase 2

This commit is contained in:
Yohann 2020-01-01 21:41:22 +01:00
parent 8cab38e216
commit dcd1819cbe
3 changed files with 11 additions and 5 deletions

View File

@ -70,7 +70,7 @@ class Team
return $team;
}
public static function getAllTeams($problem = -1, $only_validated = false)
public static function getAllTeams($problem = -1, $only_validated = false, $only_with_solutions = true)
{
global $DB, $YEAR;
$req = $DB->prepare("SELECT * FROM `teams` WHERE " . ($problem < 0 ? "" : "`problem` = ? AND ") . ($only_validated ? "`validation_status` = 'VALIDATED' AND " : "") . "`year` = $YEAR;");
@ -81,7 +81,9 @@ class Team
while (($data = $req->fetch()) != false) {
$team = new Team();
$team->fill($data);
$teams[] = $team;
$sol = $team->getSolution();
if ($sol != null && $sol->getValidation() == ValidationStatus::VALIDATED - 1)
$teams[] = $team;
}
return $teams;

View File

@ -88,7 +88,11 @@ class UpdateVideoTeams
public function makeVerifications()
{
ensure(Phase::getCurrentPhase() < Phase::PHASE2, "Il est trop tard pour réaffecter les vidéos aux équipes.");
global $team;
ensure(Phase::getCurrentPhase() > Phase::PHASE2, "Il est trop tard pour réaffecter les vidéos aux équipes.");
ensure($team->getSolution() != null, "L'équipe doit avoir soumis une vidéo.");
ensure($team->getSolution()->getValidation() == ValidationStatus::VALIDATED - 1, "L'équipe doit avoir soumis une vidéo validée.");
ensure(sizeof($this->other_teams) == 2, "L'équipe doit recevoir exactement deux vidéos.");
ensure(Team::fromId($this->other_teams[0]) != null, "La première équipe n'existe pas.");
ensure(Team::fromId($this->other_teams[1]) != null, "La seconde équipe n'existe pas.");
@ -102,7 +106,7 @@ class UpdateVideoTeams
}
}
$other_teams = Team::getAllTeams($team->getProblem(), true);
$other_teams = Team::getAllTeams($team->getProblem(), true, true);
$documents = Document::getAllDocuments($team->getProblem(), $team->getId());
require_once "server_files/views/equipe.php";

View File

@ -57,7 +57,7 @@
<a href="mailto:contact@correspondances-maths.fr?<? foreach ($team->getAllEmails() as $email) echo "bcc=" . $email . "&" ?>subject=Correspondances de Jeunes Mathématicien·ne·s" target="_blank">Envoyer un mail à toute l'équipe</a>
</div>
<? if ($team->getValidationStatus() == ValidationStatus::VALIDATED) { ?>
<? if ($team->getValidationStatus() == ValidationStatus::VALIDATED && $team->getSolution() != null && $team->getSolution()->getValidation() == ValidationStatus::VALIDATED - 1) { ?>
<hr/>
<!--suppress HtmlUnknownTarget -->
<a href="/suivi-correspondances#team-<?= $team->getTrigram() ?>">