mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-01-07 10:22:21 +00:00
Phase 4 & fin des correspondances
This commit is contained in:
parent
b0ea84c4c0
commit
22c90369e8
@ -33,6 +33,7 @@ $ROUTES["^ajouter_equipe$"] = ["server_files/controllers/ajouter_equipe.php"];
|
||||
$ROUTES["^ajouter_admin$"] = ["server_files/controllers/ajouter_admin.php"];
|
||||
$ROUTES["^calendrier/(modifier)$"] = ["server_files/controllers/calendrier.php", "edit"];
|
||||
$ROUTES["^calendrier/?$"] = ["server_files/controllers/calendrier.php"];
|
||||
$ROUTES["^commenter-echange-4$"] = ["server_files/controllers/commenter_echange.php"];
|
||||
$ROUTES["^confirmer-mail/([a-z0-9]*)/?$"] = ["server_files/controllers/confirmer_mail.php", "token"];
|
||||
$ROUTES["^connexion/(confirmation-mail)/?$"] = ["server_files/controllers/connexion.php", "confirmation-mail"];
|
||||
$ROUTES["^connexion/(mdp-oublie)/?$"] = ["server_files/controllers/connexion.php", "mdp_oublie"];
|
||||
|
@ -4,11 +4,13 @@ class Phase
|
||||
{
|
||||
const INSCRIPTION = 0;
|
||||
const PHASE1 = 1;
|
||||
const PHASE2 = 2;
|
||||
const PHASE3 = 3;
|
||||
const PHASE4 = 4;
|
||||
const END = 5;
|
||||
const BETWEEN_PHASES = 6;
|
||||
const PHASE12 = 2;
|
||||
const PHASE2 = 3;
|
||||
const PHASE23 = 4;
|
||||
const PHASE3 = 5;
|
||||
const PHASE34 = 6;
|
||||
const PHASE4 = 7;
|
||||
const END = 8;
|
||||
|
||||
public static function getCurrentPhase()
|
||||
{
|
||||
@ -23,19 +25,19 @@ class Phase
|
||||
return self::PHASE1;
|
||||
|
||||
if ($date < $CONFIG->getStartPhase2Date())
|
||||
return self::BETWEEN_PHASES;
|
||||
return self::PHASE12;
|
||||
|
||||
if ($date < $CONFIG->getEndPhase2Date())
|
||||
return self::PHASE2;
|
||||
|
||||
if ($date < $CONFIG->getStartPhase3Date())
|
||||
return self::BETWEEN_PHASES;
|
||||
return self::PHASE23;
|
||||
|
||||
if ($date < $CONFIG->getEndPhase3Date())
|
||||
return self::PHASE3;
|
||||
|
||||
if ($date < $CONFIG->getStartPhase4Date())
|
||||
return self::BETWEEN_PHASES;
|
||||
return self::PHASE34;
|
||||
|
||||
if ($date < $CONFIG->getEndPhase4Date())
|
||||
return self::PHASE4;
|
||||
@ -57,10 +59,10 @@ class Phase
|
||||
return "Phase 3 (réponses)";
|
||||
case self::PHASE4:
|
||||
return "Phase 4 (vidéo de réponse)";
|
||||
case self::BETWEEN_PHASES:
|
||||
return "Entre deux phases";
|
||||
default:
|
||||
case self::END:
|
||||
return "Le tournoi est terminé";
|
||||
default:
|
||||
return "Entre deux phases";
|
||||
}
|
||||
}
|
||||
}
|
@ -61,7 +61,7 @@ class Question
|
||||
|
||||
ensure($from->getProblem() == $to->getProblem(), "Les deux équipes doivent travailler sur le même problème.");
|
||||
|
||||
$req = $DB->prepare("SELECT * FROM `questions` WHERE `from` = ? AND `to` = ?;");
|
||||
$req = $DB->prepare("SELECT * FROM `questions` WHERE `from` = ? AND `to` = ? ORDER BY `from`;");
|
||||
$req->execute([$from->getId(), $to->getId()]);
|
||||
|
||||
$questions = [];
|
||||
|
@ -4,11 +4,13 @@
|
||||
class Reason
|
||||
{
|
||||
const SOLUTION = 0;
|
||||
const ANSWER = 1;
|
||||
const ANSWER1 = 1;
|
||||
const ANSWER2 = 2;
|
||||
|
||||
public static function getTranslatedName($class) {
|
||||
switch ($class) {
|
||||
case self::ANSWER:
|
||||
case self::ANSWER1:
|
||||
case self::ANSWER2:
|
||||
return "Réponse";
|
||||
default:
|
||||
return "Solution";
|
||||
@ -17,8 +19,10 @@ class Reason
|
||||
|
||||
public static function getName($class) {
|
||||
switch ($class) {
|
||||
case self::ANSWER:
|
||||
return "ANSWER";
|
||||
case self::ANSWER1:
|
||||
return "ANSWER1";
|
||||
case self::ANSWER2:
|
||||
return "ANSWER2";
|
||||
default:
|
||||
return "SOLUTION";
|
||||
}
|
||||
@ -26,8 +30,10 @@ class Reason
|
||||
|
||||
public static function fromName($name) {
|
||||
switch ($name) {
|
||||
case "ANSWER":
|
||||
return self::ANSWER;
|
||||
case "ANSWER1":
|
||||
return self::ANSWER1;
|
||||
case "ANSWER2":
|
||||
return self::ANSWER2;
|
||||
default:
|
||||
return self::SOLUTION;
|
||||
}
|
||||
|
67
server_files/controllers/commenter_echange.php
Normal file
67
server_files/controllers/commenter_echange.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
/** @var Team $team */
|
||||
$team = $_SESSION["team"];
|
||||
|
||||
if (!isset($_SESSION["user_id"]) || $_SESSION["role"] != Role::PARTICIPANT && $_SESSION["role"] != Role::ENCADRANT || $team == null || Phase::getCurrentPhase() != Phase::PHASE4)
|
||||
require_once "server_files/403.php";
|
||||
|
||||
if (isset($_POST["upload_answer"])) {
|
||||
$new_video = new NewAnswer($_POST);
|
||||
try {
|
||||
$new_video->makeVerifications();
|
||||
$new_video->uploadVideo();
|
||||
} catch (AssertionError $e) {
|
||||
$has_error = true;
|
||||
$error_message = $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
class NewAnswer
|
||||
{
|
||||
public $link;
|
||||
public $team;
|
||||
private $valid_link;
|
||||
private $no_change;
|
||||
|
||||
public function __construct($data)
|
||||
{
|
||||
foreach ($data as $key => $value)
|
||||
$this->$key = $value;
|
||||
}
|
||||
|
||||
public function makeVerifications()
|
||||
{
|
||||
ensure(preg_match("#(https?\:\/\/|)[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?#", $this->link), "Ce n'est pas une URL valide.");
|
||||
$this->link = preg_replace('/^(?!https?:\/\/)/', 'https://', $this->link);
|
||||
ensure(preg_match("#[1|2]#", $this->team), "L'équipe n'a pas été trouvée.");
|
||||
ensure($this->valid_link != null, "Vous devez confirmer que le lien est valide.");
|
||||
ensure($this->no_change != null, "Vous devez vous engager à ne pas changer le contenu du lien et de la vidéo.");
|
||||
}
|
||||
|
||||
public function uploadVideo()
|
||||
{
|
||||
global $DB, $YEAR, $team;
|
||||
|
||||
$req = $DB->prepare("INSERT INTO `videos`(`team`, `problem`, `link`, `reason`, `year`) VALUES (?, ?, ?, ?, ?)");
|
||||
$req->execute([$team->getId(), $team->getProblem(), $this->link, "ANSWER" . $this->team, $YEAR]);
|
||||
|
||||
Mailer::sendNewAnswer($this, $team);
|
||||
}
|
||||
}
|
||||
|
||||
$team1 = Team::fromId($team->getVideoTeamIds()[0]);
|
||||
$sol1 = Video::getVideo(Reason::SOLUTION, $team1);
|
||||
$answer1 = Video::getVideo(Reason::ANSWER1, $team);
|
||||
$answer1_validated = Video::getVideo(Reason::ANSWER1, $team, Video::ACCEPTED);
|
||||
$team2 = Team::fromId($team->getVideoTeamIds()[1]);
|
||||
$sol2 = Video::getVideo(Reason::SOLUTION, $team2);
|
||||
$answer2 = Video::getVideo(Reason::ANSWER2, $team);
|
||||
$answer2_validated = Video::getVideo(Reason::ANSWER2, $team, Video::ACCEPTED);
|
||||
|
||||
$teams = [$team1, $team2];
|
||||
$sols = [$sol1, $sol2];
|
||||
$answers = [$answer1, $answer2];
|
||||
$answers_validated = [$answer1_validated, $answer2_validated];
|
||||
|
||||
require_once "server_files/views/commenter_echange.php";
|
@ -45,7 +45,7 @@ class NewVideo
|
||||
global $DB, $YEAR, $team;
|
||||
|
||||
$req = $DB->prepare("INSERT INTO `videos`(`team`, `problem`, `link`, `reason`, `year`) VALUES (?, ?, ?, ?, ?)");
|
||||
$req->execute([$team->getId(), $team->getProblem(), $this->link, "SOLUTION", $YEAR]);
|
||||
$req->execute([$team->getId(), $team->getProblem(), $this->link, Reason::getName(Reason::SOLUTION), $YEAR]);
|
||||
|
||||
Mailer::sendNewVideo($this, $team);
|
||||
}
|
||||
|
@ -162,13 +162,31 @@ class Mailer
|
||||
self::broadcastToAdmins("Nouvelle vidéo Correspondances des Jeunes Mathématicien·ne·s $YEAR", $content);
|
||||
}
|
||||
|
||||
public static function sendNewAnswer(NewAnswer $video, Team $team)
|
||||
{
|
||||
global $YEAR;
|
||||
|
||||
$content = self::getTemplate("new_answer");
|
||||
$content = preg_replace("#{TEAM_NAME}#", $team->getName(), $content);
|
||||
$content = preg_replace("#{TRIGRAM}#", $team->getTrigram(), $content);
|
||||
$dest = Team::fromId($team->getVideoTeamIds()[$video->team - 1]);
|
||||
$content = preg_replace("#{DEST_TEAM_NAME}#", $dest->getName(), $content);
|
||||
$content = preg_replace("#{DEST_TRIGRAM}#", $dest->getTrigram(), $content);
|
||||
$content = preg_replace("#{PROBLEM}#", $team->getProblem(), $content);
|
||||
$content = preg_replace("#{VIDEO_LINK}#", $video->link, $content);
|
||||
self::broadcastToAdmins("Nouvelle vidéo de réponse Correspondances des Jeunes Mathématicien·ne·s $YEAR", $content);
|
||||
}
|
||||
|
||||
public static function validateVideo(Video $video)
|
||||
{
|
||||
global $YEAR;
|
||||
|
||||
$team = Team::fromId($video->getTeam());
|
||||
|
||||
$content = self::getTemplate($video->getValidation() == Video::ACCEPTED ? "video_accepted" : "video_rejected");
|
||||
$template = "video_";
|
||||
$template .= $video->getValidation() == Video::ACCEPTED ? "accepted" : "rejected";
|
||||
$template .= $video->getReason() == Reason::SOLUTION ? "_solution" : "_answer";
|
||||
$content = self::getTemplate($template);
|
||||
$content = preg_replace("#{TRIGRAM}#", $team->getTrigram(), $content);
|
||||
$content = preg_replace("#{PROBLEM}#", $team->getProblem(), $content);
|
||||
$content = preg_replace("#{VIDEO_LINK}#", $video->getLink(), $content);
|
||||
|
19
server_files/services/mail_templates/new_answer.html
Normal file
19
server_files/services/mail_templates/new_answer.html
Normal file
@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Nouvelle vidéo – Correspondances des Jeunes Mathématicien·ne·s {YEAR}</title>
|
||||
</head>
|
||||
<body>
|
||||
Bonjour {FIRST_NAME} {SURNAME},<br/>
|
||||
<br/>
|
||||
L'équipe « {TEAM_NAME} » ({TRIGRAM}) vient d'ajouter une vidéo de réponse destinée à l'équipe « {DEST_TEAM_NAME} » ({DEST_TRIGRAM})
|
||||
pour le problème {PROBLEM} des Correspondances des Jeunes Mathématicien·ne·s : <a href="{VIDEO_LINK}">{VIDEO_LINK}</a>.
|
||||
Vous êtes désormais invité avant que quelqu'un d'autre ne le fasse à accepter ou refuser cette vidéo via la plateforme d'inscription (accessible après connexion) :
|
||||
<a href="{URL_BASE}/videos-solutions">{URL_BASE}/videos-solutions</a><br/>
|
||||
<br/>
|
||||
Cordialement,<br/>
|
||||
<br/>
|
||||
Le comité d'organisation des Correspondances des Jeunes Mathématicien·ne·s
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Vidéo acceptée – Correspondances des Jeunes Mathématicien·ne·s {YEAR}</title>
|
||||
</head>
|
||||
<body>
|
||||
Bonjour {FIRST_NAME} {SURNAME},<br/>
|
||||
<br/>
|
||||
Félicitations, votre vidéo de réponse pour le problème {PROBLEM} a été validée ! Pour rappel, vous aviez soumis ce lien : <a href="{VIDEO_LINK}">{VIDEO_LINK}</a>.<br />
|
||||
Vous avez à présent terminé l'aventure des Correspondances. Bravo à vous ! Nous vous recontacterons dans les prochains jours pour vous tenir au courant des résultats.<br />
|
||||
Si toutefois vous le souhaitez, vous pouvez à nouveau soumettre une vidéo avant la fin de la phase. Cette nouvelle vidéo ne remplacera l'actuelle qu'au moment de la validation de celle-ci.<br />
|
||||
<br/>
|
||||
Cordialement,<br/>
|
||||
<br/>
|
||||
Le comité d'organisation des Correspondances des Jeunes Mathématicien·ne·s
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Vidéo refusée – Correspondances des Jeunes Mathématicien·ne·s {YEAR}</title>
|
||||
</head>
|
||||
<body>
|
||||
Bonjour {FIRST_NAME} {SURNAME},<br/>
|
||||
<br/>
|
||||
Malheureusement, votre vidéo de réponse pour le problème {PROBLEM} n'a pas été validée. Pour rappel, vous aviez soumis ce lien : <a href="{VIDEO_LINK}">{VIDEO_LINK}</a>.<br />
|
||||
Si vous aviez soumis une précédente vidéo qui a été validée, elle reste conservée.
|
||||
Vous êtes désormais invités à retravailler vos réponses ou votre présentation orale afin que votre prestation soit validée par les organisateurs.
|
||||
N'hésitez pas à nous contacter à <a href="mailto:contact@correspondances-maths.fr">contact@correspondances-maths.fr</a> si vous souhaitez avoir plus d'informations ou contester ce refus.
|
||||
<br/>
|
||||
Cordialement,<br/>
|
||||
<br/>
|
||||
Le comité d'organisation des Correspondances des Jeunes Mathématicien·ne·s
|
||||
</body>
|
||||
</html>
|
132
server_files/views/commenter_echange.php
Normal file
132
server_files/views/commenter_echange.php
Normal file
@ -0,0 +1,132 @@
|
||||
<?php
|
||||
require_once "header.php";
|
||||
|
||||
for ($i = 0; $i < 2; ++$i) {
|
||||
/** @var Team $answer_team */
|
||||
$answer_team = $teams[$i];
|
||||
/** @var Video $sol */
|
||||
$sol = $sols[$i];
|
||||
/** @var Video $answer */
|
||||
$answer = $answers[$i];
|
||||
/** @var Video $answer_validated */
|
||||
$answer_validated = $answers_validated[$i];
|
||||
/** @var Question[] $questions */
|
||||
$questions = Question::getQuestions($team, $answer_team);
|
||||
?>
|
||||
<h2>Vidéo de l'équipe <?= $answer_team->getName() ?> (<?= $answer_team->getTrigram() ?>) :</h2>
|
||||
<h5>Lien de la vidéo de présentation de la solution au problème : <a href="<?= $sol->getLink() ?>"><?= $sol->getLink() ?></a></h5>
|
||||
<?php displayVideo($sol->getLink()) ?>
|
||||
|
||||
<h5>Questions échangées :</h5>
|
||||
<table style="width: 100%;">
|
||||
<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="<?= $URL_BASE ?>/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="<?= $URL_BASE ?>/file/<?= $question->getAttachedFileAnswer() ?>">Télécharger</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<br />
|
||||
<h5>Vidéo de réponse :</h5>
|
||||
|
||||
<?php
|
||||
if ($answer !== null) {
|
||||
$link = $answer->getLink();
|
||||
echo "Lien de la vidéo déjà envoyée : <a href=\"$link\">$link</a> (version " . $answer->getVersion() . ")<br />\n";
|
||||
displayVideo($link);
|
||||
switch ($answer->getValidation()) {
|
||||
case 0:
|
||||
echo "La vidéo n'a pas encore été contrôlée.<br />";
|
||||
break;
|
||||
case 1:
|
||||
echo "La vidéo a été acceptée.<br />";
|
||||
break;
|
||||
case -1:
|
||||
echo "La vidéo a été rejetée.<br />";
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($answer_validated != null && $answer_validated->getId() != $answer->getId()) {
|
||||
$link = $answer_validated->getLink();
|
||||
echo "<hr />\nLien de la dernière vidéo validée : <a href=\"$link\">$link</a><br />";
|
||||
displayVideo($link);
|
||||
}
|
||||
?>
|
||||
|
||||
<form method="POST">
|
||||
<input type="hidden" name="team" value="<?= $i + 1 ?>" />
|
||||
<table style="width: 100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 30%;">
|
||||
<label for="link">Lien de la vidéo à soumettre :</label>
|
||||
</td>
|
||||
<td style="width: 70%;">
|
||||
<input style="width: 100%;" type="url" id="link" name="link" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center;" colspan="2">
|
||||
<input type="checkbox" name="valid_link" id="valid_link" required /> <label for="valid_link">Je confirme que le lien est valide</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center;" colspan="2">
|
||||
<input type="checkbox" name="no_change" id="no_change" required /> <label for="no_change">Je m'engage à ne pas changer le contenu du lien et de la vidéo</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input style="width: 100%;" type="submit" name="upload_answer" value="Envoyer la vidéo" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<hr />
|
||||
<?php
|
||||
}
|
||||
|
||||
require_once "footer.php";
|
@ -66,6 +66,9 @@
|
||||
case Phase::PHASE3: ?>
|
||||
<li><a href="<?= $URL_BASE ?>/repondre-questions-3">Répondre aux questions (phase 3)</a></li>
|
||||
<?php break;
|
||||
case Phase::PHASE4: ?>
|
||||
<li><a href="<?= $URL_BASE ?>/commenter-echange-4">Commenter l'échange (phase 4)</a></li>
|
||||
<?php break;
|
||||
}
|
||||
} ?>
|
||||
<?php } ?>
|
||||
|
@ -26,16 +26,18 @@ for ($problem = 1; $problem <= 4; ++$problem) {
|
||||
|
||||
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);
|
||||
if ($last_validated_video !== null) {
|
||||
$link = $last_validated_video->getLink();
|
||||
echo "\n<br />\nLien de la dernière vidéo validée de cette équipe : <a href=\"$link\">$link</a><br />\n";
|
||||
displayVideo($link);
|
||||
}
|
||||
}
|
||||
|
||||
if (Phase::getCurrentPhase() > Phase::PHASE1) {
|
||||
/** @var Question[] $from_questions */
|
||||
foreach (Question::getQuestionsTo($team) as $from_questions) {
|
||||
$from = Team::fromId($from_questions[0]->getFrom());
|
||||
echo "<hr />\n<h5>Questions posées par l'équipe " . $from->getName() . " (" . $from->getTrigram() . ") :</h5>\n";
|
||||
echo "<h5>Questions posées par l'équipe " . $from->getName() . " (" . $from->getTrigram() . ") :</h5>\n";
|
||||
for ($i = 0; $i < sizeof($from_questions); ++$i) {
|
||||
$question = $from_questions[$i];
|
||||
if ($question->getQuestion() == null)
|
||||
@ -49,6 +51,35 @@ for ($problem = 1; $problem <= 4; ++$problem) {
|
||||
if ($question->getAttachedFileAnswer() != null)
|
||||
echo "<em>Pièce jointe attachée pour la réponse :</em> <a href=\"$URL_BASE/file/" . $question->getAttachedFileAnswer() . "\">Télécharger</a><br />\n";
|
||||
}
|
||||
echo "<br />\n";
|
||||
if (Phase::getCurrentPhase() >= Phase::PHASE4) {
|
||||
$answer = Video::getVideo($from->getVideoTeamIds()[0] == $team->getId() ? Reason::ANSWER1 : Reason::ANSWER2, $from);
|
||||
$link = $answer->getLink();
|
||||
$version = $answer->getVersion();
|
||||
echo "<h5>Vidéo de réponse :</h5>\n";
|
||||
echo "Lien de la vidéo (version $version) : <a href=\"$link\">$link</a>";
|
||||
displayVideo($link);
|
||||
|
||||
if ($answer->getValidation() == 0) { ?>
|
||||
<form method="POST">
|
||||
<input type="hidden" name="validate_video" value="" />
|
||||
<input type="hidden" name="video_id" value="<?= $answer->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é " . ($answer->getValidation() == 1 ? "acceptée" : "refusée") . ".</h5><br />\n";
|
||||
|
||||
if ($answer->getValidation() != Video::ACCEPTED) {
|
||||
$last_validated_answer = Video::getVideo($from->getVideoTeamIds()[0] == $team->getId() ? Reason::ANSWER1 : Reason::ANSWER2, $team, Video::ACCEPTED);
|
||||
if ($last_validated_answer !== null) {
|
||||
$link = $last_validated_answer->getLink();
|
||||
echo "\n<br />\nLien de la dernière vidéo validée de cette équipe : <a href=\"$link\">$link</a><br />\n";
|
||||
displayVideo($link);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user