diff --git a/src/components/exam/ExamDialog.vue b/src/components/exam/ExamDialog.vue index 2f7e5e3..d36db11 100644 --- a/src/components/exam/ExamDialog.vue +++ b/src/components/exam/ExamDialog.vue @@ -71,6 +71,7 @@ const confirmClick = async (formEl: FormInstance | undefined) => { } const generateExam = async () => { + libraryStore.selectedSubject = examStore.config.subject questionStore.questionContent = '' const loading = ElLoading.service({ diff --git a/src/components/question/QuestionList.vue b/src/components/question/QuestionList.vue index 8bec346..173aa60 100644 --- a/src/components/question/QuestionList.vue +++ b/src/components/question/QuestionList.vue @@ -83,7 +83,7 @@ const addRecord = async () => { correctCount, wrongCount } - await recordStore.addRecord(libraryStore.currentFile.subject) + await recordStore.addRecord(libraryStore.selectedSubject as string) await ElMessageBox.alert( `共 ${totalCount} 题 · 正确 ${correctCount} · 错误 ${wrongCount}`, @@ -107,7 +107,7 @@ const addMistakeList = async () => { } mistakeStore.currentMistakes.push(mistake) }) - await mistakeStore.addMistakeList(libraryStore.currentFile.subject) + await mistakeStore.addMistakeList(libraryStore.selectedSubject as string) }