Просмотр исходного кода

feat(speaking): provide recordSpeakingStart for course-work entry

Adds a provider that posts addCourseWorks_workPage once with
content=sessionId, atool='77', type='21' for the student client only.
Failure is logged and swallowed; the dialogue is not blocked.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
jimmylee 2 месяцев назад
Родитель
Сommit
f933414469
1 измененных файлов с 20 добавлено и 0 удалено
  1. 20 0
      src/views/Student/index.vue

+ 20 - 0
src/views/Student/index.vue

@@ -592,6 +592,26 @@ provide('notifySpeakingProgress', (status: 'active' | 'completed', payload: { co
   })
 })
 
+provide('recordSpeakingStart', async (sessionId: string) => {
+  if (props.type !== '2') return // 只有学生客户端写作业记录
+  if (!sessionId || !props.courseid || !props.userid) return
+  try {
+    await api.submitWork({
+      uid: props.userid as string,
+      cid: props.courseid as string,
+      stage: '0',
+      task: String(slideIndex.value),
+      tool: '0',
+      atool: '77',
+      content: sessionId,
+      type: '21',
+    })
+  }
+  catch (err) {
+    console.error('[speaking] recordSpeakingStart failed:', err)
+  }
+})
+
 // 提供给子组件使用
 provide('choiceQuestionDetailDialogOpenList', choiceQuestionDetailDialogOpenList)