fix: 上一题/下一题不再调 AI API,改为保存后关闭并推进索引
This commit is contained in:
@@ -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')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user