1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-02-11 15:41:18 +00:00

Affichage pour les équipes qui n'ont pas de réponse à fournir

This commit is contained in:
Yohann 2020-01-20 12:16:49 +01:00
parent 0dd0f8461b
commit 72f8637fb2
3 changed files with 118 additions and 100 deletions

View File

@ -46,6 +46,14 @@ for ($i = 0; $i < 2; ++$i) {
<h5>Questions échangées :</h5> <h5>Questions échangées :</h5>
<?php <?php
if (!strcmp($questions[1]->getQuestion(), Question::DEFAULT_QUESTIONS[0])
&& !strcmp($questions[2]->getQuestion(), Question::DEFAULT_QUESTIONS[1])
&& !strcmp($questions[3]->getQuestion(), Question::DEFAULT_QUESTIONS[2])) { ?>
<div class="alert alert-danger">
L'équipe n'a malheureusement transmis aucune question. Vous n'avez donc pas de réponse à donner.
</div>
<?php } else {
for ($j = 0; $j <= 6; ++$j) { for ($j = 0; $j <= 6; ++$j) {
/** @var Question $question */ /** @var Question $question */
$question = $questions[$j]; $question = $questions[$j];
@ -118,5 +126,6 @@ for ($i = 0; $i < 2; ++$i) {
</div> </div>
<?php <?php
} }
}
require_once "footer.php"; require_once "footer.php";

View File

@ -34,6 +34,14 @@ foreach ($questions as $questions_team) {
$from = Team::fromId($questions_team[0]->getFrom()); $from = Team::fromId($questions_team[0]->getFrom());
$remark = $questions_team[0]; $remark = $questions_team[0];
echo "<h4>Questions de l'équipe " . $from->getName() . " (" . $from->getTrigram() . ") :</h4>\n"; echo "<h4>Questions de l'équipe " . $from->getName() . " (" . $from->getTrigram() . ") :</h4>\n";
if (!strcmp($questions_team[1]->getQuestion(), Question::DEFAULT_QUESTIONS[0])
&& !strcmp($questions_team[2]->getQuestion(), Question::DEFAULT_QUESTIONS[1])
&& !strcmp($questions_team[3]->getQuestion(), Question::DEFAULT_QUESTIONS[2])) { ?>
<div class="alert alert-danger">
L'équipe n'a malheureusement transmis aucune question. Vous n'avez donc pas de réponse à donner.
</div>
<?php }
else {
?> ?>
<form method="POST" enctype="multipart/form-data"> <form method="POST" enctype="multipart/form-data">
<input type="hidden" name="from" value="<?= $from->getTrigram() ?>"/> <input type="hidden" name="from" value="<?= $from->getTrigram() ?>"/>
@ -79,6 +87,7 @@ foreach ($questions as $questions_team) {
</form> </form>
<hr /> <hr />
<?php } ?> <?php } ?>
<?php } ?>
<?php <?php
require_once "footer.php"; require_once "footer.php";

View File

@ -104,8 +104,8 @@ for ($problem = 1; $problem <= 4; ++$problem) { ?>
if (!strcmp($from_questions[1]->getQuestion(), Question::DEFAULT_QUESTIONS[0]) if (!strcmp($from_questions[1]->getQuestion(), Question::DEFAULT_QUESTIONS[0])
&& !strcmp($from_questions[2]->getQuestion(), Question::DEFAULT_QUESTIONS[1]) && !strcmp($from_questions[2]->getQuestion(), Question::DEFAULT_QUESTIONS[1])
&& !strcmp($from_questions[3]->getQuestion(), Question::DEFAULT_QUESTIONS[2])) { ?> && !strcmp($from_questions[3]->getQuestion(), Question::DEFAULT_QUESTIONS[2])) { ?>
<div class="alert alert-warning"> <div class="alert alert-<?= Phase::getCurrentPhase() == Phase::PHASE2 ? "warning" : "danger" ?>">
Cette équipe n'a pas encore envoyé ses questions. Cette équipe n'a pas <?= Phase::getCurrentPhase() == Phase::PHASE2 ? "encore" : "" ?> envoyé ses questions.
</div> </div>
<?php } else { <?php } else {
for ($i = 0; $i < sizeof($from_questions); ++$i) { for ($i = 0; $i < sizeof($from_questions); ++$i) {