plateforme-corres2math/server_files/views/repondre_questions.php

87 lines
2.3 KiB
PHP
Raw Normal View History

2019-09-21 18:39:40 +00:00
<?php
require_once "header.php";
?>
Lien de la vidéo : <a href="<?= $video->getLink() ?>"><?= $video->getLink() ?></a>
<?php displayVideo($video->getLink()); ?>
<?php
foreach ($questions as $questions_team) {
$from = Team::fromId($questions_team[0]->getFrom());
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() ?>" />
<table style="width: 100%;">
<tbody>
<?php
for ($i = 0; $i < sizeof($questions_team); ++$i) {
$question = $questions_team[$i];
if ($question->getQuestion() == null)
continue;
?>
<tr>
<td>
Question <?= $i + 1 ?> :
</td>
<td>
<?= $question->getQuestion() ?>
</td>
</tr>
<?php
if ($question->getAttachedFile() != null) { ?>
<tr>
<td>
Pièce jointe :
</td>
<td>
<a href="<?= $URL_BASE . "/file/" . $question->getAttachedFile() ?>">Télécharger</a>
</td>
</tr>
<?php } ?>
<tr>
<td>
<label for="answer_<?= $i + 1 ?>">Réponse :</label>
</td>
<td>
<textarea style="width: 100%;" id="answer_<?= $i + 1 ?>" name="answer_<?= $i + 1 ?>"><?= $question->getAnswer() ?></textarea>
</td>
</tr>
<?php
if ($question->getAttachedFileAnswer() != null) { ?>
<tr>
<td>
Pièce jointe :
</td>
<td>
<a href="<?= $URL_BASE . "/file/" . $question->getAttachedFileAnswer() ?>">Télécharger</a>
</td>
</tr>
<?php } ?>
<tr>
<td>
<label for="file_<?= $i + 1 ?>">Ajouter une pièce jointe (<em>facultatif</em>) :</label>
</td>
<td>
<input style="width: 100%;" type="file" name="file_<?= $i + 1 ?>" id="file_<?= $i + 1 ?>" />
</td>
</tr>
<?php } ?>
<tr>
<td style="text-align: center" colspan="2">
<input type="checkbox" name="no_drawing" id="no_drawing" /> <label for="no_drawing">Je confirme que mes pièces jointes ne contiennent pas de texte.</label>
</td>
</tr>
<tr>
<td colspan="2">
<input style="width: 100%;" type="submit" name="answer" value="Répondre aux questions posées" />
</td>
</tr>
</tbody>
</table>
</form>
<?php } ?>
<?php
require_once "footer.php";