diff --git a/src/app/components/pages/quizzes/MyQuizzes.tsx b/src/app/components/pages/quizzes/MyQuizzes.tsx index a7745a65a..4edfe730a 100644 --- a/src/app/components/pages/quizzes/MyQuizzes.tsx +++ b/src/app/components/pages/quizzes/MyQuizzes.tsx @@ -14,6 +14,7 @@ import {AppQuizAssignment} from "../../../../IsaacAppTypes"; import { extractTeacherName, isAttempt, + isEventLeaderOrStaff, isFound, isTutorOrAbove, partitionCompleteAndIncompleteQuizzes, @@ -150,6 +151,13 @@ const MyQuizzesPageComponent = ({user}: MyQuizzesPageProps) => { } }; + // If the user is event admin or above, and the quiz is hidden from teachers, then show that + // If the user is teacher or above, show if the quiz is visible to students + const roleVisibilitySummary = (quiz: QuizSummaryDTO) => <> + {isEventLeaderOrStaff(user) && quiz.hiddenFromRoles && quiz.hiddenFromRoles?.includes("TEACHER") &&
hidden from teachers
} + {isTutorOrAbove(user) && ((quiz.hiddenFromRoles && !quiz.hiddenFromRoles?.includes("STUDENT")) || quiz.visibleToStudents) &&
visible to students
} + ; + const tabAnchors = ["#in-progress", "#completed", "#practice"]; const anchorMap = tabAnchors.reduce((acc, anchor, index) => @@ -208,8 +216,11 @@ const MyQuizzesPageComponent = ({user}: MyQuizzesPageProps) => { {quizzes.filter((quiz) => showQuiz(quiz) && quiz.title?.toLowerCase().includes(filterText.toLowerCase())).map(quiz =>
- {quiz.title} - {quiz.summary &&
{quiz.summary}
} +
+ {quiz.title} + {roleVisibilitySummary(quiz)} + {quiz.summary &&
{quiz.summary}
} +
{isTutorOrAbove(user) &&