Les admins ne verront plus les questions par défaut

This commit is contained in:
Yohann 2020-01-14 11:29:15 +01:00
parent 0d0d82a878
commit a5ef81ae24
1 changed files with 108 additions and 92 deletions

View File

@ -9,6 +9,8 @@ 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
@ -20,10 +22,12 @@ if (sizeof($waiting_teams) > 0) { ?>
</li>
<?php } ?>
</ul>
<a href="mailto:contact@correspondances-maths.fr?<? foreach ($waiting_emails as $email) echo "bcc=" . $email . "&" ?>subject=Correspondances de Jeunes Mathématicien·ne·s" target="_blank">Leur envoyer un mail</a>
<a href="mailto:contact@correspondances-maths.fr?<? foreach ($waiting_emails as $email) echo "bcc=" . $email . "&" ?>subject=Correspondances de Jeunes Mathématicien·ne·s"
target="_blank">Leur envoyer un mail</a>
</div>
<?php } ?>
<hr/>
<a href="mailto:contact@correspondances-maths.fr?<? foreach ($all_emails as $email) echo "bcc=" . $email . "&" ?>subject=Correspondances de Jeunes Mathématicien·ne·s" target="_blank">
<button class="btn btn-block btn-primary">Envoyer un mail à tous les participants</button>
</a>
@ -62,7 +66,8 @@ for ($problem = 1; $problem <= 4; ++$problem) { ?>
<textarea class="form-control" id="message" name="message"></textarea>
</div>
<input class="btn btn-primary btn-lg" style="width: <?= $video->getValidation() == 0 ? 49 : 100 ?>%;" type="submit" name="accept"
<input class="btn btn-primary btn-lg"
style="width: <?= $video->getValidation() == 0 ? 49 : 100 ?>%;" type="submit" name="accept"
value="Accepter la vidéo"/>
<?php if ($video->getValidation() == 0) { ?>
<input class="btn btn-light btn-lg" style="width: 49%;" type="submit" name="reject"
@ -93,8 +98,16 @@ for ($problem = 1; $problem <= 4; ++$problem) { ?>
if (Phase::getCurrentPhase() > Phase::PHASE1) {
/** @var Question[] $from_questions */
foreach (Question::getQuestionsTo($team) as $from_questions) {
$from = Team::fromId($from_questions[0]->getFrom());
echo "<h5>Questions posées par l'équipe " . $from->getName() . " (" . $from->getTrigram() . ") :</h5>\n";
if (!strcmp($from_questions[1]->getQuestion(), Question::DEFAULT_QUESTIONS[0])
&& !strcmp($from_questions[2]->getQuestion(), Question::DEFAULT_QUESTIONS[1])
&& !strcmp($from_questions[3]->getQuestion(), Question::DEFAULT_QUESTIONS[2])) { ?>
<div class="alert alert-warning">
Cette équipe n'a pas encore envoyé ses questions.
</div>
<?php } else {
for ($i = 0; $i < sizeof($from_questions); ++$i) {
$question = $from_questions[$i];
if ($i > 0 && $question->getQuestion() == null)
@ -131,10 +144,12 @@ for ($problem = 1; $problem <= 4; ++$problem) { ?>
<textarea class="form-control" id="message" name="message"></textarea>
</div>
<input class="btn btn-primary btn-lg" style="width: <?= $answer->getValidation() == 0 ? 49 : 100 ?>%;"
<input class="btn btn-primary btn-lg"
style="width: <?= $answer->getValidation() == 0 ? 49 : 100 ?>%;"
type="submit" name="accept" value="Accepter la vidéo"/>
<?php if ($answer->getValidation() == 0) { ?>
<input class="btn btn-light btn-lg" style="width: 49%;" type="submit" name="reject"
<input class="btn btn-light btn-lg" style="width: 49%;" type="submit"
name="reject"
value="Refuser la vidéo"/>
<?php } ?>
</form>
@ -155,6 +170,7 @@ for ($problem = 1; $problem <= 4; ++$problem) { ?>
}
}
}
}
} ?>
</div>
<?php }