Bladeren bron

Merge branch 'beta'

lsc 13 uur geleden
bovenliggende
commit
b207685776

+ 1 - 1
src/components/CollapsibleToolbar/componets/aiChat.vue

@@ -426,7 +426,7 @@ const generate = (message: ChatMessage) => {
     const prompt = [
     const prompt = [
       {
       {
         role: 'user',
         role: 'user',
-        content: `这是用户输入的内容:“${message.aiContent}”,根据用户输入的内容,生成选择题的json。输出一个json格式的回复,格式如下:{"testCount":1,"testTitle":"","testJson":[{"id":"7de1fdb4-bec3-4324-8986-4623f838e3d7","type":"2","teststitle":"1+1?","checkList":["1","2","3"],"timuList":[],"answer":[1],"userAnswer":[],"explanation":"解析"}]}。输出语言为${lang.lang === 'en' ? '英文' : lang.lang === 'hk' ? '繁体中文' : '简体中文'}`,
+        content: `这是用户输入的内容:“${message.aiContent}”,根据用户输入的内容,生成选择题的json。输出一个json格式的回复,格式如下:{"testCount":1,"testTitle":"","testJson":[{"id":"7de1fdb4-bec3-4324-8986-4623f838e3d7","type":"2","teststitle":"1+1?","checkList":["1","2","3"],"timuList":[],"answer":[1],"userAnswer":[],"explanation":"解析"}]}。`, // 输出语言为${lang.lang === 'en' ? '英文' : lang.lang === 'hk' ? '繁体中文' : '简体中文'}
       },
       },
     ]
     ]
     chat_no_stream2(prompt, { type: 'json_object' }).then(async (res: any) => {
     chat_no_stream2(prompt, { type: 'json_object' }).then(async (res: any) => {

+ 25 - 23
src/components/CreateCourseDialog.vue

@@ -12,18 +12,6 @@
       <h2>{{ lang.ssCreateCourse }}</h2>
       <h2>{{ lang.ssCreateCourse }}</h2>
       <p class="subtitle">{{ lang.ssCreateCourseSubtitle }}</p>
       <p class="subtitle">{{ lang.ssCreateCourseSubtitle }}</p>
       <div class="options-grid">
       <div class="options-grid">
-        <div class="option-card disabled">
-          <div class="option-icon">
-            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
-              <path d="M12 2L2 7l10 5 10-5-10-5z" />
-              <path d="M2 17l10 5 10-5" />
-              <path d="M2 12l10 5 10-5" />
-            </svg>
-          </div>
-          <h3>{{ lang.ssCreateFromAI }}</h3>
-          <p>{{ lang.ssAIGenerateContent }}</p>
-          <div class="coming-soon">{{ lang.ssComingSoon }}</div>
-        </div>
         <FileInput accept="application/vnd.openxmlformats-officedocument.presentationml.presentation"
         <FileInput accept="application/vnd.openxmlformats-officedocument.presentationml.presentation"
           @change="handleFileUpload">
           @change="handleFileUpload">
           <div class="option-card">
           <div class="option-card">
@@ -38,34 +26,46 @@
             <p>{{ lang.ssUploadPPTFile }}</p>
             <p>{{ lang.ssUploadPPTFile }}</p>
           </div>
           </div>
         </FileInput>
         </FileInput>
-        <div class="option-card disabled">
+        <div class="option-card" @click="handleOptionClick('blank')">
           <div class="option-icon">
           <div class="option-icon">
             <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
             <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
               <g id="Component 1">
               <g id="Component 1">
                 <path id="Vector"
                 <path id="Vector"
-                  d="M3.5 10.5007L14 2.33398L24.5 10.5007V23.334C24.5 23.9528 24.2542 24.5463 23.8166 24.9839C23.379 25.4215 22.7855 25.6673 22.1667 25.6673H5.83333C5.21449 25.6673 4.621 25.4215 4.18342 24.9839C3.74583 24.5463 3.5 23.9528 3.5 23.334V10.5007Z"
+                  d="M16.3332 2.33398H6.99984C6.381 2.33398 5.78751 2.57982 5.34992 3.0174C4.91234 3.45499 4.6665 4.04848 4.6665 4.66732V23.334C4.6665 23.9528 4.91234 24.5463 5.34992 24.9839C5.78751 25.4215 6.381 25.6673 6.99984 25.6673H20.9998C21.6187 25.6673 22.2122 25.4215 22.6498 24.9839C23.0873 24.5463 23.3332 23.9528 23.3332 23.334V9.33398L16.3332 2.33398Z"
                   stroke="currentColor" stroke-width="2.33333" />
                   stroke="currentColor" stroke-width="2.33333" />
-                <path id="Vector_2" d="M10.5 25.6667V14H17.5V25.6667" stroke="currentColor" stroke-width="2.33333" />
+                <path id="Vector_2" d="M16.3335 2.33398V9.33398H23.3335" stroke="currentColor" stroke-width="2.33333" />
               </g>
               </g>
             </svg>
             </svg>
           </div>
           </div>
-          <h3>{{ lang.ssImportFromLibrary }}</h3>
-          <p>{{ lang.ssSelectExistingContent }}</p>
+          <h3>{{ lang.ssCreateBlank }}</h3>
+          <p>{{ lang.ssStartFromScratch }}</p>
+        </div>
+        <div class="option-card disabled">
+          <div class="option-icon">
+            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
+              <path d="M12 2L2 7l10 5 10-5-10-5z" />
+              <path d="M2 17l10 5 10-5" />
+              <path d="M2 12l10 5 10-5" />
+            </svg>
+          </div>
+          <h3>{{ lang.ssCreateFromAI }}</h3>
+          <p>{{ lang.ssAIGenerateContent }}</p>
           <div class="coming-soon">{{ lang.ssComingSoon }}</div>
           <div class="coming-soon">{{ lang.ssComingSoon }}</div>
         </div>
         </div>
-        <div class="option-card" @click="handleOptionClick('blank')">
+        <div class="option-card disabled">
           <div class="option-icon">
           <div class="option-icon">
             <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
             <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
               <g id="Component 1">
               <g id="Component 1">
                 <path id="Vector"
                 <path id="Vector"
-                  d="M16.3332 2.33398H6.99984C6.381 2.33398 5.78751 2.57982 5.34992 3.0174C4.91234 3.45499 4.6665 4.04848 4.6665 4.66732V23.334C4.6665 23.9528 4.91234 24.5463 5.34992 24.9839C5.78751 25.4215 6.381 25.6673 6.99984 25.6673H20.9998C21.6187 25.6673 22.2122 25.4215 22.6498 24.9839C23.0873 24.5463 23.3332 23.9528 23.3332 23.334V9.33398L16.3332 2.33398Z"
+                  d="M3.5 10.5007L14 2.33398L24.5 10.5007V23.334C24.5 23.9528 24.2542 24.5463 23.8166 24.9839C23.379 25.4215 22.7855 25.6673 22.1667 25.6673H5.83333C5.21449 25.6673 4.621 25.4215 4.18342 24.9839C3.74583 24.5463 3.5 23.9528 3.5 23.334V10.5007Z"
                   stroke="currentColor" stroke-width="2.33333" />
                   stroke="currentColor" stroke-width="2.33333" />
-                <path id="Vector_2" d="M16.3335 2.33398V9.33398H23.3335" stroke="currentColor" stroke-width="2.33333" />
+                <path id="Vector_2" d="M10.5 25.6667V14H17.5V25.6667" stroke="currentColor" stroke-width="2.33333" />
               </g>
               </g>
             </svg>
             </svg>
           </div>
           </div>
-          <h3>{{ lang.ssCreateBlank }}</h3>
-          <p>{{ lang.ssStartFromScratch }}</p>
+          <h3>{{ lang.ssImportFromLibrary }}</h3>
+          <p>{{ lang.ssSelectExistingContent }}</p>
+          <div class="coming-soon">{{ lang.ssComingSoon }}</div>
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>
@@ -137,7 +137,9 @@ const handleFileUpload = async (files: FileList) => {
     const signal = parsingAbortController.value.signal
     const signal = parsingAbortController.value.signal
 
 
     // 调用importPPTXFile并传入signal
     // 调用importPPTXFile并传入signal
-    await importPPTXFile(files, { signal, onclose: () => {emit('setTitle', file.name.replace(/\.[^/.]+$/, '')); emit('close')} })
+    await importPPTXFile(files, { signal, onclose: () => {
+      emit('setTitle', file.name.replace(/\.[^/.]+$/, '')); emit('close')
+    } })
   }
   }
   catch (error) {
   catch (error) {
     if (error instanceof DOMException && error.name === 'AbortError') {
     if (error instanceof DOMException && error.name === 'AbortError') {

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

@@ -71,7 +71,7 @@
             </button>
             </button>
           </div>
           </div>
         </div>
         </div>
-        <textarea class="ai-input" placeholder="请输入你的问题..." v-model="inputText" @keyup.enter.exact="sendMessage"
+        <textarea class="ai-input" :placeholder="lang.ssEnterQuestion" v-model="inputText" @keyup.enter.exact="sendMessage"
           />
           />
 
 
       </div>
       </div>

+ 1 - 1
src/views/Student/components/choiceQuestionDetailDialog.vue

@@ -251,7 +251,7 @@
                           {{ item.type }}
                           {{ item.type }}
                         </div>
                         </div>
                         <div class="na_m_i_content">
                         <div class="na_m_i_content">
-                          <img style="height: 100px;width: auto;" :src="item3" />
+                          <img @click="lookImage(item3)" style="height: 100px;width: auto;cursor: pointer;" :src="item3" />
                         </div>
                         </div>
                       </div>
                       </div>
                     </template>
                     </template>

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

@@ -2477,6 +2477,12 @@ const getRefreshButtonRight = () => {
 
 
 // 键盘快捷键
 // 键盘快捷键
 const handleKeydown = (e: KeyboardEvent) => {
 const handleKeydown = (e: KeyboardEvent) => {
+  // 如果事件发生在输入框中,不处理快捷键
+  const target = e.target as HTMLElement
+  if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {
+    return
+  }
+
   console.log('键盘事件:', e.key)
   console.log('键盘事件:', e.key)
   switch (e.key) {
   switch (e.key) {
     case 'ArrowLeft':
     case 'ArrowLeft':
@@ -3320,7 +3326,6 @@ const getMessages = (msgObj: any) => {
       }
       }
     }, 1000)
     }, 1000)
   }
   }
-
   // 计时器消息 - 学生与老师端实时显示
   // 计时器消息 - 学生与老师端实时显示
   if (msgObj.type === 'timer_start' && msgObj.courseid === props.courseid) {
   if (msgObj.type === 'timer_start' && msgObj.courseid === props.courseid) {
     applyTimerStart(msgObj.payload)
     applyTimerStart(msgObj.payload)

+ 2 - 1
src/views/lang/cn.json

@@ -756,5 +756,6 @@
   "ssSubmitStatus":"提交情况",
   "ssSubmitStatus":"提交情况",
   "ssSubStu2":"已提交学生",
   "ssSubStu2":"已提交学生",
   "ssUnsubStu2":"未提交学生",
   "ssUnsubStu2":"未提交学生",
-  "ssViewSubmitStatus2":"点击查看提交情况"
+  "ssViewSubmitStatus2":"点击查看提交情况",
+  "ssEnterQuestion":"请输入你的问题..."
 }
 }

+ 2 - 1
src/views/lang/en.json

@@ -756,5 +756,6 @@
   "ssSubmitStatus":"Submission Status",
   "ssSubmitStatus":"Submission Status",
   "ssSubStu2":"Submitted Students",
   "ssSubStu2":"Submitted Students",
   "ssUnsubStu2":"Unsubmitted Students",
   "ssUnsubStu2":"Unsubmitted Students",
-  "ssViewSubmitStatus2":"Click to view submission status"
+  "ssViewSubmitStatus2":"Click to view submission status",
+  "ssEnterQuestion":"Please enter your question..."
 }
 }

+ 2 - 1
src/views/lang/hk.json

@@ -756,5 +756,6 @@
   "ssSubmitStatus":"提交狀態",
   "ssSubmitStatus":"提交狀態",
   "ssSubStu2":"已提交學生",
   "ssSubStu2":"已提交學生",
   "ssUnsubStu2":"未提交學生",
   "ssUnsubStu2":"未提交學生",
-  "ssViewSubmitStatus2":"點擊查看提交狀態"
+  "ssViewSubmitStatus2":"點擊查看提交狀態",
+  "ssEnterQuestion":"請輸入你的問題..."
 }
 }