()
| 309 | } |
| 310 | |
| 311 | function submitAllAnswers() { |
| 312 | if (!currentQuestionItem || questionSubmitting) return; |
| 313 | if (!S.ws || S.ws.readyState !== WebSocket.OPEN) { |
| 314 | showToast('Connection unavailable'); |
| 315 | return; |
| 316 | } |
| 317 | |
| 318 | const firstIncompleteIdx = currentQuestionItem.questions.findIndex((_, index) => !hasAnswerAt(index)); |
| 319 | if (firstIncompleteIdx >= 0) { |
| 320 | focusQuestion(firstIncompleteIdx); |
| 321 | showToast('请先完成所有问题'); |
| 322 | return; |
| 323 | } |
| 324 | |
| 325 | questionSubmitting = true; |
| 326 | renderCurrentQuestion(); |
| 327 | S.ws.send(JSON.stringify({ |
| 328 | type: 'answer_questions', |
| 329 | toolUseId: currentQuestionItem.toolUseId || '', |
| 330 | questions: currentQuestionItem.questions, |
| 331 | responses: buildQuestionResponses(), |
| 332 | })); |
| 333 | } |
| 334 | |
| 335 | // ---- Plan approval ---- |
| 336 | export function normalizePlanContent(plan) { |
no test coverage detected