1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-24 04:28:46 +02:00

Design phases 1 & 2

This commit is contained in:
galaxyoyo
2019-09-27 19:18:54 +02:00
parent 5c5c670958
commit 8df4c71119
6 changed files with 213 additions and 167 deletions

View File

@ -2,66 +2,86 @@
require_once "header.php";
?>
<h1>Veuillez toujours enregistrer votre travail ailleurs que sur la plateforme !</h1>
<hr />
<div class="mt-4 mb-4">
<h1 class="display-4">Poser des questions</h1>
</div>
<?php
if (isset($give_questions) && !$has_error) { ?>
<div class="alert alert-success">
Vos questions ont bien été mises à jour !
</div>
<?php } ?>
<div class="alert alert-warning">
<h1>Veuillez toujours enregistrer votre travail ailleurs que sur la plateforme !</h1>
</div>
<?php
for ($i = 0; $i < 2; ++$i) {
$receiver = $receivers[$i];
$video = $videos[$i]; ?>
<h2>Questions pour l'équipe <?= $receiver->getName() ?> (<?= $receiver->getTrigram() ?>) :</h2>
Lien de la vidéo : <a href="<?= $video->getLink() ?>"><?= $video->getLink() ?></a><br/>
<?php displayVideo($video->getLink()) ?>
<br/>
<form method="POST" enctype="multipart/form-data">
<input type="hidden" name="to" value="<?= $receiver->getTrigram() ?>"/>
<table >
<tbody>
<div class="jumbotron">
<h2>Questions pour l'équipe <?= $receiver->getName() ?> (<?= $receiver->getTrigram() ?>) :</h2>
<div class="alert alert-info">
Lien de la vidéo : <a href="<?= $video->getLink() ?>"><?= $video->getLink() ?></a>
</div>
<?php displayVideo($video->getLink()) ?>
<br/>
<form method="POST" enctype="multipart/form-data">
<input type="hidden" name="to" value="<?= $receiver->getTrigram() ?>"/>
<?php
for ($j = 0; $j < 6; ++$j) {
$question = $questions[$i][$j]; ?>
<tr>
<td style="width: 30%;">
<label for="question_<?= $j + 1 ?>">Question <?= $j + 1 ?> <?= $j >= 3 ? "(<em>facultatif</em>)" : "" ?> :</label>
</td>
<td style="width: 70%;">
<textarea id="question_<?= $j + 1 ?>" name="question_<?= $j + 1 ?>"><?= $question->getQuestion() ?></textarea>
</td>
</tr>
<?php
if ($question->getAttachedFile() != null) { ?>
<tr>
<td>
Pièce jointe :
</td>
<td>
<a href=/file/<?= $question->getAttachedFile() ?>">Télécharger</a>
</td>
</tr>
<?php } ?>
<tr>
<td>
<label for="file_<?= $j + 1 ?>">Ajouter une pièce jointe (<em>facultatif</em>) :</label>
</td>
<td>
<input type="file" name="file_<?= $j + 1 ?>" id="file_<?= $j + 1 ?>" />
</td>
</tr>
$question = $questions[$i][$j];
if ($question->getQuestion() == null && $j) { ?>
<a id="button_<?= $i ?>_<?= $j ?>" class="btn btn-secondary btn-lg btn-block"
style="display: <?= $j == 0 || $questions[$i][$j - 1]->getQuestion() != null ? "block" : "none" ?>"
onclick="addQuestion(<?= $i ?>, <?= $j ?>)">Ajouter une question</a>
<br/>
<?php
}
?>
<div id="block_<?= $i ?>_<?= $j ?>" style="display: <?= $question->getQuestion() == null ? "none" : "block" ?>;">
<div class="form-group-row">
<label for="question_<?= $j + 1 ?>_<?= $i ?>">Question <?= $j + 1 ?> :</label>
<textarea class="form-control" id="question_<?= $j + 1 ?>_<?= $i ?>"
name="question_<?= $j + 1 ?>"><?= $question->getQuestion() ?></textarea>
</div>
<?php
if ($question->getAttachedFile() != null) { ?>
<br/>
<div class="alert alert-info">
Pièce jointe : <a href="/file/<?= $question->getAttachedFile() ?>">Télécharger</a>
</div>
<?php } ?>
<div class="form-group-row">
<label for="file_<?= $j + 1 ?>_<?= $i ?>">Ajouter une pièce jointe (<em>facultatif</em>)
:</label>
<input type="file" name="file_<?= $j + 1 ?>" id="file_<?= $j + 1 ?>"/>
</div>
</div>
<?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 type="submit" name="give_questions" value="Poser les questions" />
</td>
</tr>
</tbody>
</table>
</form>
<hr/>
<input type="checkbox" name="no_drawing" id="no_drawing_<?= $i ?>"/> <label for="no_drawing_<?= $i ?>">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="give_questions"
value="Poser les questions"/>
</form>
</div>
<script>
function addQuestion(i, j) {
document.getElementById("button_" + i + "_" + j).style.display = "none";
document.getElementById("block_" + i + "_" + j).style.display = "block";
document.getElementById("button_" + i + "_" + (j + 1)).style.display = "block";
}
</script>
<?php }
require_once "footer.php";