From 9ba0b168d7175b48218c96a194003bea443695f1 Mon Sep 17 00:00:00 2001 From: heikki Date: Wed, 21 Apr 2021 11:47:10 +0300 Subject: [PATCH 1/7] initial idea --- .../quizzes-dashboard/components/Answer/AnswerList.tsx | 5 +++-- .../components/Answer/AnswerListWrapper.tsx | 4 +++- .../components/Answer/CardContent/index.tsx | 2 +- packages/quizzes-dashboard/components/Answer/index.tsx | 3 ++- .../components/quizPages/answers/all.tsx | 9 +++++++++ 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/packages/quizzes-dashboard/components/Answer/AnswerList.tsx b/packages/quizzes-dashboard/components/Answer/AnswerList.tsx index 29144dd85..b7b11430f 100644 --- a/packages/quizzes-dashboard/components/Answer/AnswerList.tsx +++ b/packages/quizzes-dashboard/components/Answer/AnswerList.tsx @@ -14,6 +14,7 @@ import { ButtonFieldWrapper } from "../Shared/ButtonFieldWrapper" export interface AnswerListProps { data: Answer[] + quizItemTypes: { [quizItemId: string]: string }[] } const BulkActionWrapper = styled.div` @@ -27,7 +28,7 @@ const BulkActionWrapper = styled.div` } ` -export const AnswerList = ({ data }: AnswerListProps) => { +export const AnswerList = ({ data, quizItemTypes }: AnswerListProps) => { const [showSnacks, setShowSnacks] = useState(false) const [answers, setAnswers] = useState([]) @@ -128,7 +129,7 @@ export const AnswerList = ({ data }: AnswerListProps) => { )} {answers.map(answer => ( - + ))} ) diff --git a/packages/quizzes-dashboard/components/Answer/AnswerListWrapper.tsx b/packages/quizzes-dashboard/components/Answer/AnswerListWrapper.tsx index e4edf1c32..47e9d50a6 100644 --- a/packages/quizzes-dashboard/components/Answer/AnswerListWrapper.tsx +++ b/packages/quizzes-dashboard/components/Answer/AnswerListWrapper.tsx @@ -21,6 +21,7 @@ interface WrapperProps { total: number } handlePageChange: (nextPage: number) => void + quizItemTypes: { [quizItemId: string]: string }[] } export const AnswerListWrapper = ({ @@ -28,6 +29,7 @@ export const AnswerListWrapper = ({ page, handlePageChange, answers, + quizItemTypes, }: WrapperProps) => { return ( <> @@ -44,7 +46,7 @@ export const AnswerListWrapper = ({ onChange={(_, nextPage) => handlePageChange(nextPage)} /> - + { const [height, setHeight] = useState(0) const ref = useRef(null) const [showAnswerDeletionModal, setShowAnswerDeletionModal] = useState(false) - + useEffect(() => { setShowMore(expandAll) }, [handledAnswers, expandAll]) diff --git a/packages/quizzes-dashboard/components/Answer/index.tsx b/packages/quizzes-dashboard/components/Answer/index.tsx index 197d16968..2fb8e49cc 100644 --- a/packages/quizzes-dashboard/components/Answer/index.tsx +++ b/packages/quizzes-dashboard/components/Answer/index.tsx @@ -66,9 +66,10 @@ export const StyledAnswerCard = styled(Card)` export interface AnswerProps { answer: Answer + quizItemTypes: { [quizItemId: string]: string }[] } -export const AnswerCard = ({ answer }: AnswerProps) => { +export const AnswerCard = ({ answer, quizItemTypes }: AnswerProps) => { const [faded, setFaded] = useState(false) const [statusChange, setStatusChange] = useState("") const [checked, setChecked] = useState(false) diff --git a/packages/quizzes-dashboard/components/quizPages/answers/all.tsx b/packages/quizzes-dashboard/components/quizPages/answers/all.tsx index 79ed1c371..eb9bc8caa 100644 --- a/packages/quizzes-dashboard/components/quizPages/answers/all.tsx +++ b/packages/quizzes-dashboard/components/quizPages/answers/all.tsx @@ -64,6 +64,14 @@ export const AllAnswers = ({ quiz, course }: IQuizTabProps) => { const quizId = quiz?.id + const quizItemTypes: { + [itemId: string]: string + }[] = quiz.items.map(item => { + return { [item.id]: item.type } + }) + + console.log(quizItemTypes) + const pathname = `/quizzes/${quizId}/all-answers/` const [currentPage, setCurrentPage] = useState(Number(pageNo) || 1) @@ -427,6 +435,7 @@ export const AllAnswers = ({ quiz, course }: IQuizTabProps) => { handlePageChange={handlePageChange} page={currentPage} answers={answersToDisplay} + quizItemTypes={quizItemTypes} /> ) : answersAreBeingFetched ? ( From 0fb9616042d62dc8e5c9372a4342d3e046fae101 Mon Sep 17 00:00:00 2001 From: heikki Date: Wed, 21 Apr 2021 11:47:39 +0300 Subject: [PATCH 2/7] lint fixes --- packages/quizzes-dashboard/components/Answer/AnswerList.tsx | 6 +++++- .../components/Answer/CardContent/index.tsx | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/quizzes-dashboard/components/Answer/AnswerList.tsx b/packages/quizzes-dashboard/components/Answer/AnswerList.tsx index b7b11430f..bbe13ec2d 100644 --- a/packages/quizzes-dashboard/components/Answer/AnswerList.tsx +++ b/packages/quizzes-dashboard/components/Answer/AnswerList.tsx @@ -129,7 +129,11 @@ export const AnswerList = ({ data, quizItemTypes }: AnswerListProps) => { )} {answers.map(answer => ( - + ))} ) diff --git a/packages/quizzes-dashboard/components/Answer/CardContent/index.tsx b/packages/quizzes-dashboard/components/Answer/CardContent/index.tsx index 2eb9dd6a2..0612bcd90 100644 --- a/packages/quizzes-dashboard/components/Answer/CardContent/index.tsx +++ b/packages/quizzes-dashboard/components/Answer/CardContent/index.tsx @@ -109,7 +109,7 @@ export const AnswerContent = ({ answer }: AnswerContentProps) => { const [height, setHeight] = useState(0) const ref = useRef(null) const [showAnswerDeletionModal, setShowAnswerDeletionModal] = useState(false) - + useEffect(() => { setShowMore(expandAll) }, [handledAnswers, expandAll]) From 76b2dc1e9cdc4a51a978f327a7e2eaba03d8d740 Mon Sep 17 00:00:00 2001 From: heikki Date: Thu, 6 May 2021 08:17:54 +0300 Subject: [PATCH 3/7] manual review filtering based on quizItem type --- .../components/Answer/AnswerList.tsx | 2 +- .../components/Answer/AnswerListWrapper.tsx | 2 +- .../components/Answer/CardContent/index.tsx | 16 ++++++++++++---- .../components/Answer/index.tsx | 4 ++-- .../components/quizPages/answers/all.tsx | 8 +------- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/packages/quizzes-dashboard/components/Answer/AnswerList.tsx b/packages/quizzes-dashboard/components/Answer/AnswerList.tsx index bbe13ec2d..c4751b39f 100644 --- a/packages/quizzes-dashboard/components/Answer/AnswerList.tsx +++ b/packages/quizzes-dashboard/components/Answer/AnswerList.tsx @@ -14,7 +14,7 @@ import { ButtonFieldWrapper } from "../Shared/ButtonFieldWrapper" export interface AnswerListProps { data: Answer[] - quizItemTypes: { [quizItemId: string]: string }[] + quizItemTypes: string[] } const BulkActionWrapper = styled.div` diff --git a/packages/quizzes-dashboard/components/Answer/AnswerListWrapper.tsx b/packages/quizzes-dashboard/components/Answer/AnswerListWrapper.tsx index 47e9d50a6..7d5e1f3d1 100644 --- a/packages/quizzes-dashboard/components/Answer/AnswerListWrapper.tsx +++ b/packages/quizzes-dashboard/components/Answer/AnswerListWrapper.tsx @@ -21,7 +21,7 @@ interface WrapperProps { total: number } handlePageChange: (nextPage: number) => void - quizItemTypes: { [quizItemId: string]: string }[] + quizItemTypes: string[] } export const AnswerListWrapper = ({ diff --git a/packages/quizzes-dashboard/components/Answer/CardContent/index.tsx b/packages/quizzes-dashboard/components/Answer/CardContent/index.tsx index 0612bcd90..347c8caa6 100644 --- a/packages/quizzes-dashboard/components/Answer/CardContent/index.tsx +++ b/packages/quizzes-dashboard/components/Answer/CardContent/index.tsx @@ -100,9 +100,13 @@ const DeleteButton = styled(Button)` export interface AnswerContentProps { answer: Answer + quizItemTypes: string[] } -export const AnswerContent = ({ answer }: AnswerContentProps) => { +export const AnswerContent = ({ + answer, + quizItemTypes, +}: AnswerContentProps) => { const [{ expandAll, handledAnswers }] = useAnswerListState() const [showMore, setShowMore] = useState(expandAll) const [showPeerreviewModal, setShowPeerreviewModal] = useState(false) @@ -120,6 +124,8 @@ export const AnswerContent = ({ answer }: AnswerContentProps) => { } }, []) + const values = Object.values(quizItemTypes) + return ( <> { )} - {editableAnswerStates.includes(answer.status) && ( - - )} + {editableAnswerStates.includes(answer.status) && + !values.includes("open") && + !values.includes("multiple-choice") && ( + + )} ) } diff --git a/packages/quizzes-dashboard/components/Answer/index.tsx b/packages/quizzes-dashboard/components/Answer/index.tsx index 2fb8e49cc..f57ce07a8 100644 --- a/packages/quizzes-dashboard/components/Answer/index.tsx +++ b/packages/quizzes-dashboard/components/Answer/index.tsx @@ -66,7 +66,7 @@ export const StyledAnswerCard = styled(Card)` export interface AnswerProps { answer: Answer - quizItemTypes: { [quizItemId: string]: string }[] + quizItemTypes: string[] } export const AnswerCard = ({ answer, quizItemTypes }: AnswerProps) => { @@ -122,7 +122,7 @@ export const AnswerCard = ({ answer, quizItemTypes }: AnswerProps) => { $status={statusChange} $deleted={answer.deleted} > - + ) diff --git a/packages/quizzes-dashboard/components/quizPages/answers/all.tsx b/packages/quizzes-dashboard/components/quizPages/answers/all.tsx index eb9bc8caa..5cd3aa935 100644 --- a/packages/quizzes-dashboard/components/quizPages/answers/all.tsx +++ b/packages/quizzes-dashboard/components/quizPages/answers/all.tsx @@ -64,13 +64,7 @@ export const AllAnswers = ({ quiz, course }: IQuizTabProps) => { const quizId = quiz?.id - const quizItemTypes: { - [itemId: string]: string - }[] = quiz.items.map(item => { - return { [item.id]: item.type } - }) - - console.log(quizItemTypes) + const quizItemTypes = quiz.items.map(i => i.type) const pathname = `/quizzes/${quizId}/all-answers/` From c7736245e1923bd3bc32d7e2456efafeca969322 Mon Sep 17 00:00:00 2001 From: heikki Date: Thu, 6 May 2021 08:45:22 +0300 Subject: [PATCH 4/7] added missing quizItemTypes --- .../quizPages/answers/requiring-attention.tsx | 3 +++ .../pages/quizzes/[quizId]/answers/[...answerId].tsx | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/quizzes-dashboard/components/quizPages/answers/requiring-attention.tsx b/packages/quizzes-dashboard/components/quizPages/answers/requiring-attention.tsx index f8ab3a3ba..ab4783711 100644 --- a/packages/quizzes-dashboard/components/quizPages/answers/requiring-attention.tsx +++ b/packages/quizzes-dashboard/components/quizPages/answers/requiring-attention.tsx @@ -143,6 +143,8 @@ export const RequiringAttention = ({ quiz, course }: IQuizTabProps) => { ? searchResults : answersRequiringAttention + const quizItemTypes = quiz.items.map(i => i.type) + return ( <> @@ -198,6 +200,7 @@ export const RequiringAttention = ({ quiz, course }: IQuizTabProps) => { handlePageChange={handlePageChange} page={currentPage} answers={answersToDisplay} + quizItemTypes={quizItemTypes} /> ) : answersAreBeingFetched ? ( diff --git a/packages/quizzes-dashboard/pages/quizzes/[quizId]/answers/[...answerId].tsx b/packages/quizzes-dashboard/pages/quizzes/[quizId]/answers/[...answerId].tsx index 9a13583db..c2082fcab 100644 --- a/packages/quizzes-dashboard/pages/quizzes/[quizId]/answers/[...answerId].tsx +++ b/packages/quizzes-dashboard/pages/quizzes/[quizId]/answers/[...answerId].tsx @@ -38,7 +38,7 @@ interface IAnswerStatusChange { updatedAt: Date } -const StyledTableContainer = styled(TableContainer)<{ +const StyledTableContainer = styled(TableContainer) <{ component: React.ReactNode }>` margin-top: 3rem; @@ -136,6 +136,13 @@ export const AnswerById = () => { ) const { quiz, quizLoading, quizError } = useQuiz(quizId, "quiz") + let quizItemTypes: string[] = [] + + if (quiz) { + quizItemTypes = quiz.items.map(i => i.type) + } + + /* for when tab is loaded through url*/ useEffect(() => { if (route.query.answerId) { @@ -214,7 +221,7 @@ export const AnswerById = () => { /> {currentTab === "overview" && answer ? ( - + ) : ( )} From 7d89389e65adfe6fa43a0cef23bf9095742bee7e Mon Sep 17 00:00:00 2001 From: heikki Date: Thu, 6 May 2021 08:48:44 +0300 Subject: [PATCH 5/7] fixed linting --- .../components/Answer/CardContent/index.tsx | 6 ++---- .../pages/quizzes/[quizId]/answers/[...answerId].tsx | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/quizzes-dashboard/components/Answer/CardContent/index.tsx b/packages/quizzes-dashboard/components/Answer/CardContent/index.tsx index 347c8caa6..d60eeadd0 100644 --- a/packages/quizzes-dashboard/components/Answer/CardContent/index.tsx +++ b/packages/quizzes-dashboard/components/Answer/CardContent/index.tsx @@ -124,8 +124,6 @@ export const AnswerContent = ({ } }, []) - const values = Object.values(quizItemTypes) - return ( <> {editableAnswerStates.includes(answer.status) && - !values.includes("open") && - !values.includes("multiple-choice") && ( + !quizItemTypes.includes("open") && + !quizItemTypes.includes("multiple-choice") && ( )} diff --git a/packages/quizzes-dashboard/pages/quizzes/[quizId]/answers/[...answerId].tsx b/packages/quizzes-dashboard/pages/quizzes/[quizId]/answers/[...answerId].tsx index c2082fcab..19d9b59e6 100644 --- a/packages/quizzes-dashboard/pages/quizzes/[quizId]/answers/[...answerId].tsx +++ b/packages/quizzes-dashboard/pages/quizzes/[quizId]/answers/[...answerId].tsx @@ -38,7 +38,7 @@ interface IAnswerStatusChange { updatedAt: Date } -const StyledTableContainer = styled(TableContainer) <{ +const StyledTableContainer = styled(TableContainer)<{ component: React.ReactNode }>` margin-top: 3rem; @@ -142,7 +142,6 @@ export const AnswerById = () => { quizItemTypes = quiz.items.map(i => i.type) } - /* for when tab is loaded through url*/ useEffect(() => { if (route.query.answerId) { From b53156d0d211c6dfd0a74251a54945cf2f98ecf8 Mon Sep 17 00:00:00 2001 From: Heikki Date: Wed, 12 May 2021 11:34:21 +0300 Subject: [PATCH 6/7] manualReviewField filtering based if any peerReviewCollections exists --- packages/backendv2/src/models/quiz_answer.ts | 6 ++++-- packages/backendv2/src/models/quiz_item_answer.ts | 13 ++++++++++++- .../components/Answer/AnswerList.tsx | 9 ++------- .../components/Answer/CardContent/index.tsx | 9 ++------- .../quizzes-dashboard/components/Answer/index.tsx | 5 ++--- packages/quizzes-dashboard/types/Answer.d.ts | 3 +++ 6 files changed, 25 insertions(+), 20 deletions(-) diff --git a/packages/backendv2/src/models/quiz_answer.ts b/packages/backendv2/src/models/quiz_answer.ts index b8b64034c..110bf2a48 100644 --- a/packages/backendv2/src/models/quiz_answer.ts +++ b/packages/backendv2/src/models/quiz_answer.ts @@ -213,8 +213,9 @@ class QuizAnswer extends mixin(BaseModel, [ .whereIn("deleted", deleteConditions) .orderBy([{ column: "created_at", order: order }]) .page(page, pageSize) + .withGraphFetched("quiz.[peerReviewCollections]") .withGraphFetched("userQuizState") - .withGraphFetched("itemAnswers.[optionAnswers]") + .withGraphFetched("itemAnswers.[quizItem, optionAnswers]") .withGraphFetched("peerReviews.[answers.[question.[texts]]]") } else { paginated = await this.query() @@ -223,8 +224,9 @@ class QuizAnswer extends mixin(BaseModel, [ .whereIn("status", filters) .orderBy([{ column: "created_at", order: order }]) .page(page, pageSize) + .withGraphFetched("quiz.[peerReviewCollections]") .withGraphFetched("userQuizState") - .withGraphFetched("itemAnswers.[optionAnswers]") + .withGraphFetched("itemAnswers.[quizItem, optionAnswers]") .withGraphFetched("peerReviews.[answers.[question.[texts]]]") } diff --git a/packages/backendv2/src/models/quiz_item_answer.ts b/packages/backendv2/src/models/quiz_item_answer.ts index d142d78b0..36ac1d398 100644 --- a/packages/backendv2/src/models/quiz_item_answer.ts +++ b/packages/backendv2/src/models/quiz_item_answer.ts @@ -1,10 +1,13 @@ import BaseModel from "./base_model" import QuizAnswer from "./quiz_answer" +import QuizItem from "./quiz_item" import QuizOptionAnswer from "./quiz_option_answer" class QuizItemAnswer extends BaseModel { id!: string + quizAnswer!: QuizAnswer quizItemId!: string + quizItem!: QuizItem textData!: string correct!: boolean optionAnswers!: QuizOptionAnswer[] @@ -16,7 +19,7 @@ class QuizItemAnswer extends BaseModel { static relationMappings = { quizAnswer: { - relation: BaseModel.BelongsToOneRelation, + relation: BaseModel.HasOneRelation, modelClass: QuizAnswer, join: { from: "quiz_item_answer.quiz_answer_id", @@ -31,6 +34,14 @@ class QuizItemAnswer extends BaseModel { to: "quiz_option_answer.quiz_item_answer_id", }, }, + quizItem: { + relation: BaseModel.HasOneRelation, + modelClass: QuizItem, + join: { + from: "quiz_item_answer.quiz_item_id", + to: "quiz_item.id", + }, + }, } } diff --git a/packages/quizzes-dashboard/components/Answer/AnswerList.tsx b/packages/quizzes-dashboard/components/Answer/AnswerList.tsx index c4751b39f..29144dd85 100644 --- a/packages/quizzes-dashboard/components/Answer/AnswerList.tsx +++ b/packages/quizzes-dashboard/components/Answer/AnswerList.tsx @@ -14,7 +14,6 @@ import { ButtonFieldWrapper } from "../Shared/ButtonFieldWrapper" export interface AnswerListProps { data: Answer[] - quizItemTypes: string[] } const BulkActionWrapper = styled.div` @@ -28,7 +27,7 @@ const BulkActionWrapper = styled.div` } ` -export const AnswerList = ({ data, quizItemTypes }: AnswerListProps) => { +export const AnswerList = ({ data }: AnswerListProps) => { const [showSnacks, setShowSnacks] = useState(false) const [answers, setAnswers] = useState([]) @@ -129,11 +128,7 @@ export const AnswerList = ({ data, quizItemTypes }: AnswerListProps) => { )} {answers.map(answer => ( - + ))} ) diff --git a/packages/quizzes-dashboard/components/Answer/CardContent/index.tsx b/packages/quizzes-dashboard/components/Answer/CardContent/index.tsx index d60eeadd0..0a3399f15 100644 --- a/packages/quizzes-dashboard/components/Answer/CardContent/index.tsx +++ b/packages/quizzes-dashboard/components/Answer/CardContent/index.tsx @@ -100,13 +100,9 @@ const DeleteButton = styled(Button)` export interface AnswerContentProps { answer: Answer - quizItemTypes: string[] } -export const AnswerContent = ({ - answer, - quizItemTypes, -}: AnswerContentProps) => { +export const AnswerContent = ({ answer }: AnswerContentProps) => { const [{ expandAll, handledAnswers }] = useAnswerListState() const [showMore, setShowMore] = useState(expandAll) const [showPeerreviewModal, setShowPeerreviewModal] = useState(false) @@ -209,8 +205,7 @@ export const AnswerContent = ({ )} {editableAnswerStates.includes(answer.status) && - !quizItemTypes.includes("open") && - !quizItemTypes.includes("multiple-choice") && ( + answer.quiz.peerReviewCollections.length > 0 && ( )} diff --git a/packages/quizzes-dashboard/components/Answer/index.tsx b/packages/quizzes-dashboard/components/Answer/index.tsx index f57ce07a8..197d16968 100644 --- a/packages/quizzes-dashboard/components/Answer/index.tsx +++ b/packages/quizzes-dashboard/components/Answer/index.tsx @@ -66,10 +66,9 @@ export const StyledAnswerCard = styled(Card)` export interface AnswerProps { answer: Answer - quizItemTypes: string[] } -export const AnswerCard = ({ answer, quizItemTypes }: AnswerProps) => { +export const AnswerCard = ({ answer }: AnswerProps) => { const [faded, setFaded] = useState(false) const [statusChange, setStatusChange] = useState("") const [checked, setChecked] = useState(false) @@ -122,7 +121,7 @@ export const AnswerCard = ({ answer, quizItemTypes }: AnswerProps) => { $status={statusChange} $deleted={answer.deleted} > - + ) diff --git a/packages/quizzes-dashboard/types/Answer.d.ts b/packages/quizzes-dashboard/types/Answer.d.ts index 19df9082b..b93e04c2c 100644 --- a/packages/quizzes-dashboard/types/Answer.d.ts +++ b/packages/quizzes-dashboard/types/Answer.d.ts @@ -1,3 +1,5 @@ +import { Quiz } from "./Quiz" + export interface Answer { id: string quizId: string @@ -9,6 +11,7 @@ export interface Answer { userQuizState: UserQuizState itemAnswers: ItemAnswer[] peerReviews: PeerReview[] + quiz: Quiz deleted: boolean } From e844c470a768bb49ba24697e21660c46f6091f4d Mon Sep 17 00:00:00 2001 From: Heikki Date: Wed, 12 May 2021 11:41:59 +0300 Subject: [PATCH 7/7] removed quizItemTypes --- .../components/Answer/AnswerListWrapper.tsx | 4 +--- .../components/quizPages/answers/all.tsx | 3 --- .../components/quizPages/answers/requiring-attention.tsx | 3 --- .../pages/quizzes/[quizId]/answers/[...answerId].tsx | 8 +------- 4 files changed, 2 insertions(+), 16 deletions(-) diff --git a/packages/quizzes-dashboard/components/Answer/AnswerListWrapper.tsx b/packages/quizzes-dashboard/components/Answer/AnswerListWrapper.tsx index 7d5e1f3d1..e4edf1c32 100644 --- a/packages/quizzes-dashboard/components/Answer/AnswerListWrapper.tsx +++ b/packages/quizzes-dashboard/components/Answer/AnswerListWrapper.tsx @@ -21,7 +21,6 @@ interface WrapperProps { total: number } handlePageChange: (nextPage: number) => void - quizItemTypes: string[] } export const AnswerListWrapper = ({ @@ -29,7 +28,6 @@ export const AnswerListWrapper = ({ page, handlePageChange, answers, - quizItemTypes, }: WrapperProps) => { return ( <> @@ -46,7 +44,7 @@ export const AnswerListWrapper = ({ onChange={(_, nextPage) => handlePageChange(nextPage)} /> - + { const quizId = quiz?.id - const quizItemTypes = quiz.items.map(i => i.type) - const pathname = `/quizzes/${quizId}/all-answers/` const [currentPage, setCurrentPage] = useState(Number(pageNo) || 1) @@ -429,7 +427,6 @@ export const AllAnswers = ({ quiz, course }: IQuizTabProps) => { handlePageChange={handlePageChange} page={currentPage} answers={answersToDisplay} - quizItemTypes={quizItemTypes} /> ) : answersAreBeingFetched ? ( diff --git a/packages/quizzes-dashboard/components/quizPages/answers/requiring-attention.tsx b/packages/quizzes-dashboard/components/quizPages/answers/requiring-attention.tsx index ab4783711..f8ab3a3ba 100644 --- a/packages/quizzes-dashboard/components/quizPages/answers/requiring-attention.tsx +++ b/packages/quizzes-dashboard/components/quizPages/answers/requiring-attention.tsx @@ -143,8 +143,6 @@ export const RequiringAttention = ({ quiz, course }: IQuizTabProps) => { ? searchResults : answersRequiringAttention - const quizItemTypes = quiz.items.map(i => i.type) - return ( <> @@ -200,7 +198,6 @@ export const RequiringAttention = ({ quiz, course }: IQuizTabProps) => { handlePageChange={handlePageChange} page={currentPage} answers={answersToDisplay} - quizItemTypes={quizItemTypes} /> ) : answersAreBeingFetched ? ( diff --git a/packages/quizzes-dashboard/pages/quizzes/[quizId]/answers/[...answerId].tsx b/packages/quizzes-dashboard/pages/quizzes/[quizId]/answers/[...answerId].tsx index 19d9b59e6..9a13583db 100644 --- a/packages/quizzes-dashboard/pages/quizzes/[quizId]/answers/[...answerId].tsx +++ b/packages/quizzes-dashboard/pages/quizzes/[quizId]/answers/[...answerId].tsx @@ -136,12 +136,6 @@ export const AnswerById = () => { ) const { quiz, quizLoading, quizError } = useQuiz(quizId, "quiz") - let quizItemTypes: string[] = [] - - if (quiz) { - quizItemTypes = quiz.items.map(i => i.type) - } - /* for when tab is loaded through url*/ useEffect(() => { if (route.query.answerId) { @@ -220,7 +214,7 @@ export const AnswerById = () => { /> {currentTab === "overview" && answer ? ( - + ) : ( )}