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

fix(aiChat,student): 优化题目信息里的下标说明并修复接口调用

1. 补充aiChat.vue中选择题和投票题的数组下标说明,让规则更清晰
2. 在Student/index.vue中添加对特定toolType页面调用selectSWorks接口的逻辑
lsc 1 неделя назад
Родитель
Сommit
05e9476281
2 измененных файлов с 15 добавлено и 3 удалено
  1. 2 2
      src/views/Student/components/aiChat.vue
  2. 13 1
      src/views/Student/index.vue

+ 2 - 2
src/views/Student/components/aiChat.vue

@@ -501,7 +501,7 @@ const sendAction = async (action: string) => {
      当前题目信息:
     - 题目类型:${choice}
     - 题目内容:${question_content}
-    - 正确答案:${correct_answer}(0,1,3是选项的下标,学生的答案也是)
+    - 正确答案:${correct_answer}(0,1,3是选项的下标,数组的下标,相当于第一选项是0,第二选项是1,第三选项是2,第四选项是3,学生的答案也是数组的下标)
     - 学生提交的回答:${student_answer}
     `
   }
@@ -510,7 +510,7 @@ const sendAction = async (action: string) => {
       当前题目信息:
       - 题目类型:${choice}
       - 投票题目:${question_content}
-      - 学生提交的投票:${student_answer}
+      - 学生提交的投票:${student_answer}(0,1,2是选项的下标,数组的下标,相当于第一选项是0,第二选项是1,第三选项是2)
     `
   }
   else if (props.workJson.atool === '15') {

+ 13 - 1
src/views/Student/index.vue

@@ -422,7 +422,7 @@ import CountdownTimer from '@/views/Screen/CountdownTimer.vue'
 import useSlideBackgroundStyle from '@/hooks/useSlideBackgroundStyle'
 import useImport from '@/hooks/useImport'
 import message from '@/utils/message'
-import api, { API_URL } from '@/services/course'
+import api, { API_URL, selectSWorks } from '@/services/course'
 import axios from '@/services/config'
 import {currentVersion, lang} from '@/main'
 import ShotWorkModal from './components/ShotWorkModal.vue'
@@ -2514,6 +2514,18 @@ const handleRefreshPage = () => {
   console.log('刷新iframe按钮被点击')
   
   try {
+
+    const element = elementList.value.find((i:any) => i.type === 'frame')
+    console.log(element)
+    if (
+      element &&
+    typeof element === 'object' &&
+    ('toolType' in element) &&
+    (element as any).toolType !== undefined &&
+    ((element as any).toolType === 45 || (element as any).toolType === 15 || (element as any).toolType === 73 || (element as any).toolType === 72 || (element as any).toolType === 78 || (element as any).toolType === 79)
+    ) {
+      selectSWorks()
+    }
     // 获取当前幻灯片中的所有iframe元素
     const iframes = document.querySelectorAll('.viewer-canvas .screen-slide')[slideIndex.value].querySelectorAll('iframe')
     console.log('找到iframe元素数量:', iframes.length)