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

Meilleur aperçu des équipes en retard

This commit is contained in:
Yohann 2020-01-01 21:11:28 +01:00
parent b44c789dc8
commit eb53514eb9
3 changed files with 14 additions and 3 deletions

View File

@ -199,6 +199,11 @@ class Team
$DB->prepare("UPDATE `teams` SET `validation_status` = ? WHERE `id` = ?;")->execute([ValidationStatus::getName($status), $this->id]);
}
public function getSolution()
{
return Video::getVideo(Reason::SOLUTION, $this);
}
public function getVideoTeamIds()
{
return $this->video_team_ids;

View File

@ -58,11 +58,13 @@ $waiting_emails = [];
switch (Phase::getCurrentPhase()) {
case Phase::PHASE1:
case Phase::PHASE12:
$req = $DB->query("SELECT DISTINCT `teams`.`id`, `teams`.`problem`, `teams`.`trigram` FROM `teams` WHERE `validation_status` = '" . ValidationStatus::getName(ValidationStatus::VALIDATED) . "'"
. " AND `id` NOT IN (SELECT DISTINCT `team` FROM `videos` WHERE `reason` = 'SOLUTION' AND `validation` = " . Video::ACCEPTED . ")"
. " AND `year` = $YEAR ORDER BY `problem`, `trigram`;");
break;
case Phase::PHASE2:
case Phase::PHASE23:
$req = $DB->query("SELECT DISTINCT `teams`.`id`, `teams`.`problem`, `teams`.`trigram` FROM `teams`"
. " WHERE `id` NOT IN (SELECT `q1`.`from` FROM `questions` AS `q1`"
. " JOIN `questions` AS `q2` ON `q2`.`from` = `q1`.`from` AND `q2`.`number` = 2"
@ -81,6 +83,7 @@ switch (Phase::getCurrentPhase()) {
. " AND `year` = $YEAR ORDER BY `problem`, `trigram`;");
break;
case Phase::PHASE3:
case Phase::PHASE34:
$req = $DB->query("SELECT DISTINCT `teams`.`id`, `teams`.`problem`, `teams`.`trigram` FROM `teams`"
. " WHERE `id` NOT IN (SELECT `q1`.`to` FROM `questions` AS `q1`"
. " JOIN `questions` AS `q2` ON `q2`.`to` = `q1`.`to` AND `q2`.`number` = 2"
@ -99,6 +102,7 @@ switch (Phase::getCurrentPhase()) {
. " AND `year` = $YEAR ORDER BY `problem`, `trigram`;");
break;
case Phase::PHASE4:
case Phase::END:
$req = $DB->query("SELECT DISTINCT `teams`.`id`, `teams`.`problem`, `teams`.`trigram` FROM `teams` WHERE `validation_status` = '" . ValidationStatus::getName(ValidationStatus::VALIDATED) . "'"
. " AND (`id` NOT IN (SELECT DISTINCT `team` FROM `videos` WHERE `reason` = 'ANSWER1' AND `validation` = " . Video::ACCEPTED . ")"
. " OR `id` NOT IN (SELECT DISTINCT `team` FROM `videos` WHERE `reason` = 'ANSWER2' AND `validation` = " . Video::ACCEPTED . "))"
@ -110,6 +114,8 @@ if (isset($req)) {
$waiting_emails = [];
while (($data = $req->fetch()) !== false) {
$team = Team::fromId($data["id"]);
if (Phase::getCurrentPhase() >= Phase::PHASE12 && $team->getSolution() == null)
continue;
$waiting_teams[] = $team;
$waiting_emails = array_merge($waiting_emails, $team->getAllEmails());
}

View File

@ -9,12 +9,12 @@ require_once "header.php";
<?php
if (sizeof($waiting_teams) > 0) { ?>
<div class="alert alert-warning">
<?= sizeof($waiting_teams) == 1 ? "L'équipe suivante n'a" : "Les équipes suivantes n'ont" ?> pas encore participé à la phase en cours :
<?= sizeof($waiting_teams) == 1 ? "L'équipe suivante n'a" : "Les équipes suivantes n'ont" ?> pas encore participé à la phase en cours, ou leurs vidéos n'ont pas encore été validées :
<ul>
<?php
foreach ($waiting_teams as $team) { ?>
<li>
<a href="/equipe/<?= $team->getTrigram() ?>">
<a href="#team-<?= $team->getTrigram() ?>">
Équipe <?= $team->getName() ?> (<?= $team->getTrigram() ?>)
</a>
</li>
@ -40,7 +40,7 @@ for ($problem = 1; $problem <= 4; ++$problem) { ?>
?>
<div class="jumbotron" id="team-<?= $team->getTrigram() ?>">
<h2>
Équipe « <?= $team->getName() ?> » (<?= $team->getTrigram() ?>)
<a style="color: black" href="/equipe/<?= $team->getTrigram() ?>">Équipe « <?= $team->getName() ?> » (<?= $team->getTrigram() ?>)</a>
</h2>
<div class="alert alert-info">
<strong>Lien de la vidéo (version <?= $version ?>) :</strong> <a href="<?= $link ?>"><?= $link ?></a>