mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-01-07 09:42:20 +00:00
Phase 2 : envoi des questions
This commit is contained in:
parent
81acf09fbf
commit
0885141db5
@ -71,7 +71,12 @@ class Question
|
||||
}
|
||||
|
||||
if (sizeof($questions) == 0) {
|
||||
$default_questions = ["Slogan ?", "Est-ce que les blagues de R-ev sont drôles ?", "C'est où le WEI ?", "Qui est le plus lourd ?", "Quelle est la réponse à la vie, à l'univers et à tout le reste ?", "Que préférez-vous entre la pratique et la théorie ?"];
|
||||
$default_questions = ["Comment avez-vous obtenu vos résultats ?",
|
||||
"Peut-on rendre votre algorithme plus efficace ? Pourquoi ?",
|
||||
"Comment élargir vos travaux ?",
|
||||
null,
|
||||
null,
|
||||
null];
|
||||
for ($_ = 0; $_ < 6; ++$_) {
|
||||
$req = $DB->prepare("INSERT INTO `questions`(`from`, `to`, `problem`, `question`) VALUES (?, ?, ?, ?);");
|
||||
$req->execute([$from->getId(), $to->getId(), $from->getProblem(), $default_questions[$_]]);
|
||||
@ -82,6 +87,20 @@ class Question
|
||||
return $questions;
|
||||
}
|
||||
|
||||
public static function getQuestionsTo(Team $to)
|
||||
{
|
||||
global $DB, $YEAR;
|
||||
$id = $to->getId();
|
||||
$req = $DB->query("SELECT `id` from `teams` WHERE (`video_team1` = $id OR `video_team2` = $id) AND `year` = $YEAR;");
|
||||
|
||||
$questions = [];
|
||||
|
||||
while (($data = $req->fetch()) !== false)
|
||||
$questions[] = self::getQuestions(Team::fromId($data["id"]), $to);
|
||||
|
||||
return $questions;
|
||||
}
|
||||
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
|
@ -1,6 +1,11 @@
|
||||
<?php
|
||||
require_once "header.php";
|
||||
?>
|
||||
|
||||
<h1>Veuillez toujours enregistrer votre travail ailleurs que sur la plateforme !</h1>
|
||||
<hr />
|
||||
|
||||
<?php
|
||||
for ($i = 0; $i < 2; ++$i) {
|
||||
$receiver = $receivers[$i];
|
||||
$video = $videos[$i]; ?>
|
||||
|
@ -30,6 +30,24 @@ for ($problem = 1; $problem <= 4; ++$problem) {
|
||||
echo "\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";
|
||||
for ($i = 0; $i < sizeof($from_questions); ++$i) {
|
||||
$question = $from_questions[$i];
|
||||
if ($question->getQuestion() == null)
|
||||
continue;
|
||||
|
||||
echo "Question " . ($i + 1) . " : " . $question->getQuestion() . "<br />\n";
|
||||
if ($question->getAttachedFile() != null) {
|
||||
echo "<em>Pièce jointe attachée :</em> <a href=\"$URL_BASE/file/" . $question->getAttachedFile() . "\">Télécharger</a><br />\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "<hr />\n";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user