fix: 上一题/下一题不再调 AI API,改为保存后关闭并推进索引

This commit is contained in:
2026-07-16 07:30:51 +08:00
parent 8ea2dd38d7
commit cfe906bb60
6 changed files with 40 additions and 9 deletions
+4 -3
View File
@@ -118,12 +118,13 @@ async function startGrading() {
const questions = rubricData?.questions?.length
? JSON.parse(JSON.stringify(rubricData.questions))
: [{ questionTitle: '', maxScore: 100, referenceAnswer: '', rubric: '' }]
const nextIdx = Math.min(await window.electronAPI?.rubric.getNextIndex() ?? 0, questions.length - 1)
gradingStore.setQuestions(questions)
gradingStore.setCurrentQuestionIndex(0)
gradingStore.setCurrentQuestionIndex(nextIdx)
appStore.isGrading = true
try {
const result = await gradeQuestion(0)
const result = await gradeQuestion(nextIdx)
if (!result) return
gradingStore.setResult(result)
@@ -133,7 +134,7 @@ async function startGrading() {
result,
image: gradingStore.currentImage,
questions,
currentQuestionIndex: 0
currentQuestionIndex: nextIdx
})
await window.electronAPI.dialog.open('result')
}