1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-25 13:37:22 +02: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

@ -34,50 +34,59 @@ foreach ($questions as $questions_team) {
$from = Team::fromId($questions_team[0]->getFrom());
$remark = $questions_team[0];
echo "<h4>Questions de l'équipe " . $from->getName() . " (" . $from->getTrigram() . ") :</h4>\n";
?>
<form method="POST" enctype="multipart/form-data">
<input type="hidden" name="from" value="<?= $from->getTrigram() ?>"/>
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">
<input type="hidden" name="from" value="<?= $from->getTrigram() ?>"/>
<?php
for ($i = 0; $i < sizeof($questions_team); ++$i) {
$question = $questions_team[$i];
if ($i > 0 && $question->getQuestion() == null)
continue;
?>
<div class="alert alert-info">
<strong><?= $i == 0 ? "Remarques générales :" : "Question " . $question->getNumber() . " :" ?></strong>
<?= $question->getQuestion() ?><br/>
<?php
if ($question->getAttachedFile() != null) { ?>
Pièce jointe :
<a href="/file/<?= $question->getAttachedFile() ?>"><strong>Télécharger</strong></a><br/>
<?php } ?>
<div class="form-group row">
<div class="form-group col-md-12">
<label for="answer_<?= $i ?>"><strong>Réponse :</strong></label>
<textarea class="form-control" id="answer_<?= $i ?>"
name="answer_<?= $i ?>"><?= $question->getAnswer() ?></textarea>
<?php
for ($i = 0; $i < sizeof($questions_team); ++$i) {
$question = $questions_team[$i];
if ($i > 0 && $question->getQuestion() == null)
continue;
?>
<div class="alert alert-info">
<strong><?= $i == 0 ? "Remarques générales :" : "Question " . $question->getNumber() . " :" ?></strong>
<?= $question->getQuestion() ?><br/>
<?php
if ($question->getAttachedFile() != null) { ?>
Pièce jointe :
<a href="/file/<?= $question->getAttachedFile() ?>"><strong>Télécharger</strong></a><br/>
<?php } ?>
<div class="form-group row">
<div class="form-group col-md-12">
<label for="answer_<?= $i ?>"><strong>Réponse :</strong></label>
<textarea class="form-control" id="answer_<?= $i ?>"
name="answer_<?= $i ?>"><?= $question->getAnswer() ?></textarea>
</div>
</div>
<?php
if ($question->getAttachedFileAnswer() != null) { ?>
Pièce jointe :
<a href="/file/<?= $question->getAttachedFileAnswer() ?>"><strong>Télécharger</strong></a>
<?php } ?>
<div class="form-group row">
<div class="form-group col-md-12">
<label for="file_<?= $i ?>">Ajouter une pièce jointe (<em>facultatif</em>) :</label>
<input type="file" name="file_<?= $i ?>" id="file_<?= $i ?>"/>
</div>
</div>
</div>
<?php
if ($question->getAttachedFileAnswer() != null) { ?>
Pièce jointe :
<a href="/file/<?= $question->getAttachedFileAnswer() ?>"><strong>Télécharger</strong></a>
<?php } ?>
<div class="form-group row">
<div class="form-group col-md-12">
<label for="file_<?= $i ?>">Ajouter une pièce jointe (<em>facultatif</em>) :</label>
<input type="file" name="file_<?= $i ?>" id="file_<?= $i ?>"/>
</div>
</div>
</div>
<?php } ?>
<input type="checkbox" name="no_drawing" id="no_drawing_<?= $from->getTrigram() ?>"/> <label for="no_drawing_<?= $from->getTrigram() ?>">Je confirme que mes
pièces jointes ne contiennent pas de texte.</label>
<?php } ?>
<input type="checkbox" name="no_drawing" id="no_drawing_<?= $from->getTrigram() ?>"/> <label for="no_drawing_<?= $from->getTrigram() ?>">Je confirme que mes
pièces jointes ne contiennent pas de texte.</label>
<input class="btn btn-primary btn-lg btn-block" type="submit" name="answer" value="Répondre aux questions posées"/>
</form>
<hr />
<input class="btn btn-primary btn-lg btn-block" type="submit" name="answer" value="Répondre aux questions posées"/>
</form>
<hr />
<?php } ?>
<?php } ?>
<?php