Skip to content

Commit 09567dd

Browse files
authored
Merge pull request #1239 from isaacphysics/hotfix/remove-non-practice-tests
Remove non-attemptable practice tests for teachers
2 parents 70532a0 + 5a4f12a commit 09567dd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/app/components/pages/quizzes/PracticeQuizzes.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@ const PracticeQuizzesComponent = ({user}: QuizzesPageProps) => {
2929
const showQuiz = (quiz: QuizSummaryDTO) => {
3030
switch (user.role) {
3131
case "STUDENT":
32-
// Tutors should see the same tests as students can
33-
// eslint-disable-next-line no-fallthrough
3432
case "TUTOR":
35-
return (quiz.hiddenFromRoles && !quiz.hiddenFromRoles?.includes("STUDENT")) || quiz.visibleToStudents;
3633
case "TEACHER":
37-
return (quiz.hiddenFromRoles && !quiz.hiddenFromRoles?.includes("TEACHER")) ?? true;
34+
// Practice attempts are only possible on quizzes that are visible to students
35+
// (most quizzes that are hidden from students may be previewed by teachers, but may not be practised)
36+
return (quiz.hiddenFromRoles && !quiz.hiddenFromRoles?.includes("STUDENT")) || quiz.visibleToStudents;
3837
default:
3938
return true;
4039
}

0 commit comments

Comments
 (0)