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

feat: 新增投票题型78的相关处理逻辑

1.  在可折叠工具栏组件中,上传完成后延迟2秒调用解析关闭方法
2.  扩展学生页面题目框架判断逻辑,新增toolType78的支持
3.  在AI聊天组件中添加toolType78的选项映射和答题信息拼接逻辑
lsc 1 неделя назад
Родитель
Сommit
8239fb1a32

+ 3 - 0
src/components/CollapsibleToolbar/index2.vue

@@ -1257,6 +1257,9 @@ const confirmFileUpload = async () => {
           clearInterval(progressInterval.value)
           clearInterval(progressInterval.value)
           importProgress.value = 100
           importProgress.value = 100
           progressInterval.value = null
           progressInterval.value = null
+          setTimeout(() => {
+            handleParsingClose()
+          }, 2000)
         }
         }
       }
       }
     }, 100)
     }, 100)

+ 18 - 0
src/views/Student/components/aiChat.vue

@@ -462,6 +462,9 @@ const sendAction = async (action: string) => {
     case '15':
     case '15':
       choice = '问答题'
       choice = '问答题'
       break
       break
+    case '78':
+      choice = '投票'
+      break
     default:
     default:
       choice = ''
       choice = ''
       break
       break
@@ -479,6 +482,13 @@ const sendAction = async (action: string) => {
       student_answer += `第${i + 1}题:${testJson[i].userAnswer}` + '\n'
       student_answer += `第${i + 1}题:${testJson[i].userAnswer}` + '\n'
     }
     }
   }
   }
+  else if (props.workJson.atool === '78') {
+    const testJson = workContent.testJson || []
+    for (let i = 0; i < testJson.length; i++) {
+      question_content += `第${i + 1}题:${testJson[i].teststitle}\n 选项:${testJson[i].checkList}`
+      student_answer += `第${i + 1}题:${testJson[i].userAnswer}` + '\n'
+    }
+  }
   else if (props.workJson.atool === '15') {
   else if (props.workJson.atool === '15') {
     question_content = workContent.answerQ || ''
     question_content = workContent.answerQ || ''
     correct_answer = workContent.evaluationCriteria || '无'
     correct_answer = workContent.evaluationCriteria || '无'
@@ -495,6 +505,14 @@ const sendAction = async (action: string) => {
     - 学生提交的回答:${student_answer}
     - 学生提交的回答:${student_answer}
     `
     `
   }
   }
+  else if (props.workJson.atool === '78') {
+    promptText += `
+      当前题目信息:
+      - 题目类型:${choice}
+      - 投票题目:${question_content}
+      - 学生提交的投票:${student_answer}
+    `
+  }
   else if (props.workJson.atool === '15') {
   else if (props.workJson.atool === '15') {
     promptText += `
     promptText += `
       当前题目信息:
       当前题目信息:

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

@@ -927,7 +927,7 @@ const isChoiceQuestion = computed(() => {
 
 
 const isQuestionFrame = computed(() => {
 const isQuestionFrame = computed(() => {
   const frame = elementList.value.find(element => element.type === ElementTypes.FRAME)
   const frame = elementList.value.find(element => element.type === ElementTypes.FRAME)
-  return frame?.toolType === 45 || frame?.toolType === 15
+  return frame?.toolType === 45 || frame?.toolType === 15 || frame?.toolType === 78  
 })
 })
 
 
 const hasWork = computed(() => {
 const hasWork = computed(() => {