mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-01-05 23:42:21 +00:00
Design "Mon tournoi"
This commit is contained in:
parent
a050956614
commit
cbcc29cb68
@ -48,6 +48,7 @@ $ROUTES["^mon-compte/?$"] = ["server_files/controllers/mon_compte.php"];
|
||||
$ROUTES["^mon-equipe/(diffusion-videos)/?$"] = ["server_files/controllers/mon_equipe.php", "publish_videos"];
|
||||
$ROUTES["^mon-equipe/(modifier)/?$"] = ["server_files/controllers/mon_equipe.php", "modifier"];
|
||||
$ROUTES["^mon-equipe/?$"] = ["server_files/controllers/mon_equipe.php"];
|
||||
$ROUTES["^mon-tournoi/?$"] = ["server_files/controllers/mon_tournoi.php"];
|
||||
$ROUTES["^poser-questions-2$"] = ["server_files/controllers/poser_questions.php"];
|
||||
$ROUTES["^probleme/([1-4])/?$"] = ["server_files/controllers/probleme.php", "probleme"];
|
||||
$ROUTES["^rejoindre-equipe/?$"] = ["server_files/controllers/rejoindre_equipe.php"];
|
||||
|
@ -58,8 +58,6 @@ if (isset($_SESSION["user_id"]) && isset($_SESSION["team"]) && $_SESSION["team"]
|
||||
$team = $_SESSION["team"];
|
||||
|
||||
$documents = $user->getAllDocuments($team->getProblem());
|
||||
$video = Video::getVideo(Reason::SOLUTION, $team);
|
||||
$questions_received = Question::getQuestionsTo($team);
|
||||
}
|
||||
else
|
||||
require_once "server_files/403.php";
|
||||
|
17
server_files/controllers/mon_tournoi.php
Normal file
17
server_files/controllers/mon_tournoi.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
if (isset($_SESSION["user_id"]) && isset($_SESSION["team"]) && $_SESSION["team"] !== null) {
|
||||
/**
|
||||
* @var User $user
|
||||
* @var Team $team
|
||||
*/
|
||||
$user = $_SESSION["user"];
|
||||
$team = $_SESSION["team"];
|
||||
|
||||
$video = Video::getVideo(Reason::SOLUTION, $team);
|
||||
$questions_received = Question::getQuestionsTo($team);
|
||||
}
|
||||
else
|
||||
require_once "server_files/403.php";
|
||||
|
||||
require_once "server_files/views/mon_tournoi.php";
|
@ -51,7 +51,9 @@
|
||||
<?php }
|
||||
} else { ?>
|
||||
<li class="nav-item active"><a class="nav-link" href="/mon-equipe">Mon équipe</a></li>
|
||||
<?php if ($_SESSION["team"]->getValidationStatus() == ValidationStatus::VALIDATED) {
|
||||
<?php if ($_SESSION["team"]->getValidationStatus() == ValidationStatus::VALIDATED) { ?>
|
||||
<li class="nav-item active"><a class="nav-link" href="/mon-tournoi">Mon tournoi</a></li>
|
||||
<?php
|
||||
switch (Phase::getCurrentPhase()) {
|
||||
case Phase::PHASE1: ?>
|
||||
<li class="nav-item active"><a class="nav-link" href="/envoyer-video-1">
|
||||
|
@ -146,166 +146,7 @@ require_once "header.php";
|
||||
<div class="alert alert-warning">
|
||||
Votre équipe est en attente de validation.
|
||||
</div>
|
||||
<?php } elseif (Phase::getCurrentPhase() >= Phase::PHASE1) { ?>
|
||||
<hr/>
|
||||
<h2>Déroulement du tournoi</h2>
|
||||
<?php if ($video != null) { ?>
|
||||
<h4>Vidéo de solution proposée :</h4>
|
||||
Lien de la vidéo : <a href="<?= $video->getLink() ?>"><?= $video->getLink() ?></a><br/>
|
||||
<?php displayVideo($video->getLink()) ?>
|
||||
<br/>
|
||||
<?php if (Phase::getCurrentPhase() >= Phase::PHASE3) { ?>
|
||||
<h4>Questions reçues :</h4>
|
||||
<?php
|
||||
for ($i = 0; $i < 2; ++$i) {
|
||||
if ($questions_received[$i] == null)
|
||||
continue;
|
||||
$asker = Team::fromId($questions_received[$i][0]->getFrom());
|
||||
$answer = Video::getVideo($asker->getVideoTeamIds()[0] == $team->getId() ? Reason::ANSWER1 : Reason::ANSWER2, $asker);
|
||||
?>
|
||||
<h5>Questions de l'équipe <?= $asker->getName() ?> (<?= $asker->getTrigram() ?>) :</h5>
|
||||
<table>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($j = 0; $j < 6; ++$j) {
|
||||
/** @var Question $question */
|
||||
$question = $questions_received[$i][$j];
|
||||
if ($question->getQuestion() === null)
|
||||
continue;
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
Question <?= $question->getNumber() ?> :
|
||||
</td>
|
||||
<td>
|
||||
<?= $question->getQuestion() ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($question->getAttachedFile() !== null) { ?>
|
||||
<tr>
|
||||
<td>
|
||||
<em>Pièce jointe attachée :</em>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/file/<?= $question->getAttachedFile() ?>">Télécharger</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<td>
|
||||
Réponse :
|
||||
</td>
|
||||
<td>
|
||||
<?= $question->getAnswer() ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($question->getAttachedFileAnswer() !== null) { ?>
|
||||
<tr>
|
||||
<td>
|
||||
<em>Pièce jointe attachée :</em>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/file/<?= $question->getAttachedFileAnswer() ?>">Télécharger</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<br/>
|
||||
<?php if (Phase::getCurrentPhase() >= Phase::PHASE4 && $answer != null) { ?>
|
||||
<h6>Vidéo de réponse proposée par l'équipe :</h6>
|
||||
Lien de la vidéo : <a href="<?= $answer->getLink() ?>"><?= $answer->getLink() ?></a><br/>
|
||||
<?php displayVideo($answer->getLink()) ?>
|
||||
<br/>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<hr/>
|
||||
|
||||
<?php
|
||||
if (Phase::getCurrentPhase() >= 2) {
|
||||
for ($i = 0; $i < 2; ++$i) {
|
||||
$defender = Team::fromId($team->getVideoTeamIds()[$i]);
|
||||
if ($defender == null)
|
||||
continue;
|
||||
$sol = Video::getVideo(Reason::SOLUTION, $defender);
|
||||
$answer = Video::getVideo($i == 0 ? Reason::ANSWER1 : Reason::ANSWER2, $team);
|
||||
$questions = Question::getQuestions($team, $defender);
|
||||
?>
|
||||
<h4>Vidéo de solution proposée par l'équipe <?= $defender->getName() ?>
|
||||
(<?= $defender->getTrigram() ?>) :</h4>
|
||||
Lien de la vidéo : <a href="<?= $sol->getLink() ?>"><?= $sol->getLink() ?></a><br/>
|
||||
<?php displayVideo($sol->getLink()) ?>
|
||||
<br/>
|
||||
<h5>Vos questions :</h5>
|
||||
<br/>
|
||||
<table>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($j = 0; $j < 6; ++$j) {
|
||||
/** @var Question $question */
|
||||
$question = $questions[$j];
|
||||
if ($question->getQuestion() === null)
|
||||
continue;
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
Question <?= $question->getNumber() ?> :
|
||||
</td>
|
||||
<td>
|
||||
<?= $question->getQuestion() ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($question->getAttachedFile() !== null) { ?>
|
||||
<tr>
|
||||
<td>
|
||||
<em>Pièce jointe attachée :</em>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/file/<?= $question->getAttachedFile() ?>">Télécharger</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if (Phase::getCurrentPhase() >= Phase::PHASE3) { ?>
|
||||
<tr>
|
||||
<td>
|
||||
Réponse :
|
||||
</td>
|
||||
<td>
|
||||
<?= $question->getAnswer() ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($question->getAttachedFileAnswer() !== null) { ?>
|
||||
<tr>
|
||||
<td>
|
||||
<em>Pièce jointe attachée :</em>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/file/<?= $question->getAttachedFileAnswer() ?>">Télécharger</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<br/>
|
||||
<?php if (Phase::getCurrentPhase() >= Phase::PHASE4 && $answer != null) { ?>
|
||||
<h5>Votre vidéo de réponse :</h5>
|
||||
Lien de la vidéo : <a href="<?= $answer->getLink() ?>"><?= $answer->getLink() ?></a><br/>
|
||||
<?php displayVideo($answer->getLink()) ?>
|
||||
<hr/>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
|
134
server_files/views/mon_tournoi.php
Normal file
134
server_files/views/mon_tournoi.php
Normal file
@ -0,0 +1,134 @@
|
||||
<?php
|
||||
require_once "header.php";
|
||||
?>
|
||||
<?php
|
||||
if (false) {
|
||||
} elseif (Phase::getCurrentPhase() >= Phase::PHASE1) { ?>
|
||||
<div class="mt-4 mb-4">
|
||||
<h1 class="display-4">Mon tournoi</h1>
|
||||
</div>
|
||||
<?php if ($video != null) { ?>
|
||||
<div class="jumbotron">
|
||||
<h4>Vidéo de solution proposée :</h4>
|
||||
<div class="alert alert-info">
|
||||
<strong>Lien de la vidéo :</strong> <a href="<?= $video->getLink() ?>"><?= $video->getLink() ?></a>
|
||||
</div>
|
||||
<?php displayVideo($video->getLink()) ?>
|
||||
<br/>
|
||||
<?php if (Phase::getCurrentPhase() >= Phase::PHASE3) { ?>
|
||||
<h4>Questions reçues :</h4>
|
||||
<?php
|
||||
for ($i = 0; $i < 2; ++$i) {
|
||||
if ($questions_received[$i] == null)
|
||||
continue;
|
||||
$asker = Team::fromId($questions_received[$i][0]->getFrom());
|
||||
$answer = Video::getVideo($asker->getVideoTeamIds()[0] == $team->getId() ? Reason::ANSWER1 : Reason::ANSWER2,
|
||||
$asker, Video::ACCEPTED);
|
||||
?>
|
||||
<h5>Questions de l'équipe <?= $asker->getName() ?> (<?= $asker->getTrigram() ?>) :</h5>
|
||||
<?php
|
||||
for ($j = 0; $j < 6; ++$j) {
|
||||
/** @var Question $question */
|
||||
$question = $questions_received[$i][$j];
|
||||
if ($question->getQuestion() === null)
|
||||
continue;
|
||||
?>
|
||||
<div class="alert alert-info">
|
||||
<strong>Question <?= $question->getNumber() + 1 ?>
|
||||
:</strong> <?= $question->getQuestion() ?>
|
||||
<br/>
|
||||
<?php
|
||||
if ($question->getAttachedFile() !== null) { ?>
|
||||
<em>Pièce jointe attachée :</em>
|
||||
<a href="/file/<?= $question->getAttachedFile() ?>"><strong>Télécharger</strong></a>
|
||||
<br/>
|
||||
<?php } ?>
|
||||
<strong>Réponse :</strong> <?= $question->getAnswer() ?><br/>
|
||||
<?php
|
||||
if ($question->getAttachedFile() !== null) { ?>
|
||||
<em>Pièce jointe attachée :</em>
|
||||
<a href="/file/<?= $question->getAttachedFileAnswer() ?>"><strong>Télécharger</strong></a>
|
||||
<br/>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<br/>
|
||||
<?php if (Phase::getCurrentPhase() > Phase::PHASE4 && $answer != null) { ?>
|
||||
<h6>Vidéo de réponse proposée par l'équipe :</h6>
|
||||
<div class="alert alert-info">
|
||||
<strong>Lien de la vidéo :</strong> <a
|
||||
href="<?= $answer->getLink() ?>"><?= $answer->getLink() ?></a>
|
||||
</div>
|
||||
<?php displayVideo($answer->getLink()) ?>
|
||||
<?= $i == 0 ? "<hr />" : "" ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if (Phase::getCurrentPhase() >= 2) { ?>
|
||||
<hr/>
|
||||
<div class="jumbotron">
|
||||
<?php
|
||||
for ($i = 0; $i < 2; ++$i) {
|
||||
$defender = Team::fromId($team->getVideoTeamIds()[$i]);
|
||||
if ($defender == null)
|
||||
continue;
|
||||
$sol = Video::getVideo(Reason::SOLUTION, $defender, Video::ACCEPTED);
|
||||
$answer = Video::getVideo($i == 0 ? Reason::ANSWER1 : Reason::ANSWER2, $team, Video::ACCEPTED);
|
||||
$questions = Question::getQuestions($team, $defender);
|
||||
?>
|
||||
<h4>Vidéo de solution proposée par l'équipe <?= $defender->getName() ?>
|
||||
(<?= $defender->getTrigram() ?>) :</h4>
|
||||
<div class="alert alert-info">
|
||||
<strong>Lien de la vidéo :</strong> <a href="<?= $sol->getLink() ?>"><?= $sol->getLink() ?></a>
|
||||
</div>
|
||||
<?php displayVideo($sol->getLink()) ?>
|
||||
<br/>
|
||||
<h5>Vos questions :</h5>
|
||||
<br/>
|
||||
<?php
|
||||
for ($j = 0; $j < 6; ++$j) {
|
||||
/** @var Question $question */
|
||||
$question = $questions[$j];
|
||||
if ($question->getQuestion() === null)
|
||||
continue;
|
||||
?>
|
||||
<div class="alert alert-info">
|
||||
<strong>Question <?= $question->getNumber() + 1 ?>
|
||||
:</strong> <?= $question->getQuestion() ?>
|
||||
<br/>
|
||||
<?php
|
||||
if ($question->getAttachedFile() !== null) { ?>
|
||||
<em>Pièce jointe attachée :</em>
|
||||
<a href="/file/<?= $question->getAttachedFile() ?>"><strong>Télécharger</strong></a>
|
||||
<br/>
|
||||
<?php } ?>
|
||||
<?php if (Phase::getCurrentPhase() >= Phase::PHASE4) { ?>
|
||||
<strong>Réponse :</strong> <?= $question->getAnswer() ?><br/>
|
||||
<?php
|
||||
if ($question->getAttachedFile() !== null) { ?>
|
||||
<em>Pièce jointe attachée :</em>
|
||||
<a href="/file/<?= $question->getAttachedFileAnswer() ?>"><strong>Télécharger</strong></a>
|
||||
<br/>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<br/>
|
||||
<?php if (Phase::getCurrentPhase() >= Phase::PHASE4 && $answer != null) { ?>
|
||||
<h5>Votre vidéo de réponse :</h5>
|
||||
<div class="alert alert-info">
|
||||
<strong>Lien de la vidéo :</strong> <a href="<?= $answer->getLink() ?>"><?= $answer->getLink() ?></a>
|
||||
</div>
|
||||
<?php displayVideo($answer->getLink()) ?>
|
||||
<?php } ?>
|
||||
<?= $i == 0 ? "<hr/>" : "" ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php
|
||||
require_once "footer.php";
|
Loading…
Reference in New Issue
Block a user