1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-25 16:57:23 +02:00

Flexibilité sur la validation des vidéos accrue

This commit is contained in:
galaxyoyo
2019-09-19 00:31:53 +02:00
parent 1e67b8569d
commit 5372350f46
13 changed files with 289 additions and 17 deletions

View File

@ -2,6 +2,10 @@
require_once "header.php";
if ($has_error) {
echo "<h2>Erreur : $error_message</h2>";
}
for ($problem = 1; $problem <= 4; ++$problem) {
echo "<h2>Vidéos pour le problème $problem</h2>\n";
/** @var Video $video */
@ -9,10 +13,26 @@ for ($problem = 1; $problem <= 4; ++$problem) {
$link = $video->getLink();
$team = Team::fromId($video->getTeam());
$version = $video->getVersion();
echo "Vidéo de présentation de l'équipe « " . $team->getName() . " » (" . $team->getTrigram() . "), version $version : <a href=\"$link\">$link</a>\n";
if (preg_match("#(https?\://|)(www\.|)youtube\.com\/watch\?v=(.*)#", $link, $matches)) {
$code = $matches[3];
echo "<center><iframe width=\"854px\" height=\"480px\" src=\"https://www.youtube.com/embed/$code\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe></center><br />\n";
echo "<h4>Vidéo de présentation de l'équipe « " . $team->getName() . " » (" . $team->getTrigram() . ") :</h4>\n";
echo "Lien de la vidéo (version $version) : <a href=\"$link\">$link</a>";
displayVideo($link);
if ($video->getValidation() == 0) { ?>
<form method="POST">
<input type="hidden" name="validate_video" value="" />
<input type="hidden" name="video_id" value="<?= $video->getId() ?>" />
<input style="width: 49%;" type="submit" name="accept" value="Accepter la vidéo" />
<input style="width: 49%;" type="submit" name="reject" value="Refuser la vidéo" />
</form>
<?php }
else
echo "<h5>La vidéo a été " . ($video->getValidation() == 1 ? "acceptée" : "refusée") . ".</h5><br />\n";
if ($video->getValidation() != Video::ACCEPTED) {
$last_validated_video = Video::getVideo(Reason::SOLUTION, $team, Video::ACCEPTED);
$link = $last_validated_video->getLink();
echo "\nLien de la dernière vidéo validée de cette équipe : <a href=\"$link\">$link</a><br />\n";
displayVideo($link);
}
}
echo "<hr />\n";