diff --git a/server_files/classes/Question.php b/server_files/classes/Question.php index 06a6362..78490b7 100644 --- a/server_files/classes/Question.php +++ b/server_files/classes/Question.php @@ -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; diff --git a/server_files/views/poser_questions.php b/server_files/views/poser_questions.php index c7d1e7a..41741e4 100644 --- a/server_files/views/poser_questions.php +++ b/server_files/views/poser_questions.php @@ -1,6 +1,11 @@ +

Veuillez toujours enregistrer votre travail ailleurs que sur la plateforme !

+
+ + diff --git a/server_files/views/videos_solutions.php b/server_files/views/videos_solutions.php index 8c09fc7..f3f07f4 100644 --- a/server_files/views/videos_solutions.php +++ b/server_files/views/videos_solutions.php @@ -30,6 +30,24 @@ for ($problem = 1; $problem <= 4; ++$problem) { echo "\nLien de la dernière vidéo validée de cette équipe : $link
\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 "
\n
Questions posées par l'équipe " . $from->getName() . " (" . $from->getTrigram() . ") :
\n"; + for ($i = 0; $i < sizeof($from_questions); ++$i) { + $question = $from_questions[$i]; + if ($question->getQuestion() == null) + continue; + + echo "Question " . ($i + 1) . " : " . $question->getQuestion() . "
\n"; + if ($question->getAttachedFile() != null) { + echo "Pièce jointe attachée : getAttachedFile() . "\">Télécharger
\n"; + } + } + } + } } echo "
\n"; }