diff --git a/Project/php/controller/StudentController.php b/Project/php/controller/StudentController.php index e6efe62..e79c5b6 100755 --- a/Project/php/controller/StudentController.php +++ b/Project/php/controller/StudentController.php @@ -22,7 +22,7 @@ class StudentController extends UserController global $user; $jeu = $_POST['jeu']; $model = new MdlStudent(); - $voc = $model->getAll(); + $voc = $model->getVocByGroup($user->getGroup()); echo $twig->render('vocabList.html', ['jeu' => $jeu, 'vocabularies' => $voc, 'userID' => $user->getId(), 'userRole' => $user->getRoles()]); } diff --git a/Project/php/model/MdlStudent.php b/Project/php/model/MdlStudent.php index fc113be..fef1550 100755 --- a/Project/php/model/MdlStudent.php +++ b/Project/php/model/MdlStudent.php @@ -19,6 +19,11 @@ class MdlStudent extends MdlUser return $res; } + public function getVocByGroup(int $group): array{ + $gtw = new VocabularyListGateway(); + return $gtw->findByGroup($group); + } + public function is(string $login, array $roles): ?User { $gtw = new UserGateway();