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 @@ +