This commit is contained in:
@@ -23,6 +23,7 @@ async function QuestionBankResults({ searchParams }: { searchParams: Promise<Sea
|
||||
const q = getParam(params, "q")
|
||||
const type = getParam(params, "type")
|
||||
const difficulty = getParam(params, "difficulty")
|
||||
const knowledgePointId = getParam(params, "kp")
|
||||
|
||||
const questionType: QuestionType | undefined =
|
||||
type === "single_choice" ||
|
||||
@@ -37,10 +38,16 @@ async function QuestionBankResults({ searchParams }: { searchParams: Promise<Sea
|
||||
q: q || undefined,
|
||||
type: questionType,
|
||||
difficulty: difficulty && difficulty !== "all" ? Number(difficulty) : undefined,
|
||||
knowledgePointId: knowledgePointId && knowledgePointId !== "all" ? knowledgePointId : undefined,
|
||||
pageSize: 200,
|
||||
})
|
||||
|
||||
const hasFilters = Boolean(q || (type && type !== "all") || (difficulty && difficulty !== "all"))
|
||||
const hasFilters = Boolean(
|
||||
q ||
|
||||
(type && type !== "all") ||
|
||||
(difficulty && difficulty !== "all") ||
|
||||
(knowledgePointId && knowledgePointId !== "all")
|
||||
)
|
||||
|
||||
if (questions.length === 0) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user