fix: 上一题/下一题不再调 AI API,改为保存后关闭并推进索引
This commit is contained in:
@@ -314,6 +314,12 @@ export function setupIpc(win: BrowserWindow): void {
|
||||
return { questions, currentIndex: 0 }
|
||||
})
|
||||
|
||||
// --- Rubric next question index (persisted between grading cycles) ---
|
||||
let rubricNextIndex = 0
|
||||
ipcMain.handle('rubric:getNextIndex', () => rubricNextIndex)
|
||||
ipcMain.handle('rubric:setNextIndex', (_event, idx: number) => { rubricNextIndex = idx })
|
||||
ipcMain.handle('rubric:resetNextIndex', () => { rubricNextIndex = 0 })
|
||||
|
||||
// --- Grading data bridge (toolbar → result window) ---
|
||||
ipcMain.handle('grading:storeData', (_event, data: any) => {
|
||||
gradingPayload = data
|
||||
|
||||
@@ -52,7 +52,10 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
||||
storeData: (data: any) => ipcRenderer.invoke('rubric:storeData', data),
|
||||
getData: () => ipcRenderer.invoke('rubric:getData'),
|
||||
exportJson: () => ipcRenderer.invoke('rubric:exportJson'),
|
||||
importJson: () => ipcRenderer.invoke('rubric:importJson')
|
||||
importJson: () => ipcRenderer.invoke('rubric:importJson'),
|
||||
getNextIndex: () => ipcRenderer.invoke('rubric:getNextIndex'),
|
||||
setNextIndex: (idx: number) => ipcRenderer.invoke('rubric:setNextIndex', idx),
|
||||
resetNextIndex: () => ipcRenderer.invoke('rubric:resetNextIndex')
|
||||
},
|
||||
|
||||
template: {
|
||||
|
||||
Reference in New Issue
Block a user