Преглед изворни кода

Merge branch 'beta' of https://git.cocorobo.cn/CocoRoboLabs/pbl-student-table into beta

SanHQin пре 6 месеци
родитељ
комит
67708a645d

+ 1 - 1
dist/index.html

@@ -27,7 +27,7 @@
     html,
     body{
       font-family: '黑体';
-    }</style><link href=./static/css/app.99e723e2460e896d1a5107cb819d6dfc.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.264e3d6e7c524117db80.js></script><script type=text/javascript src=./static/js/app.4b3908490bc4f2ed6be2.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.616f284dc3a81a8f8eb70ca6e78c13ba.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.264e3d6e7c524117db80.js></script><script type=text/javascript src=./static/js/app.fa1db9d2e46f40794b12.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/css/app.616f284dc3a81a8f8eb70ca6e78c13ba.css


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/css/app.616f284dc3a81a8f8eb70ca6e78c13ba.css.map


+ 0 - 0
dist/static/img/aiTalk.2196c9f.svg → dist/static/img/aiTalk.1469289.svg


+ 0 - 0
dist/static/img/aiVanish.9288360.svg → dist/static/img/aiVanish.cc2e3bf.svg


+ 0 - 0
dist/static/img/aiWait2.d0390d3.svg → dist/static/img/aiWait2.c8d31c6.svg


+ 0 - 0
dist/static/img/practice.01fb3fa.svg → dist/static/img/practice.25766a7.svg


+ 0 - 0
dist/static/img/robot3.e6b4e70.svg → dist/static/img/robot3.c50070a.svg


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/js/app.fa1db9d2e46f40794b12.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/js/app.fa1db9d2e46f40794b12.js.map


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map


+ 3 - 1
src/components/classRoomHelper/component/taskArea.vue

@@ -1172,7 +1172,9 @@ export default {
         });
         _textData += "\n";
       });
-      const _msg = `Language: Please use the same language as the user requirement, if the user speaks Chinese, the specific text of your answer should also be in Chinese.
+      const _msg = `NOTICE
+Role: 你是出题的老师,可以利用file_search的方式完整的去分析文件内容(注:如果文件内容里面不包含需要检索的内容,就不引用文件内容),并生成需要的JSON数据。
+Language: Please use the same language as the user requirement, if the user speaks Chinese, the specific text of your answer should also be in Chinese.
 ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
 Instruction: Based on the context, follow "Format example", write content
 

+ 62 - 41
src/components/easy2/commpont/markDialog.vue

@@ -8,7 +8,7 @@
           <div class="scoreTit">
             <div>任务得分</div>
             <div>
-              <span style="color: rgba(54, 129, 252, 1);margin-right: 3px;">{{
+              <span style="color: #4380F8;margin-right: 3px;">{{
                 totalScore ? totalScore : 0
               }}</span
               >分
@@ -590,12 +590,11 @@ export default {
     this.selectSWorksData();
   },
   methods: {
+    setZero(index){
+      console.log(index);
+      console.log('scoTitList',this.scoTitList);
+    },
     async anewEva() {
-      // if (!this.textarea) {
-      //   return this.$message.info("请先进行AI评分获取评语~");
-      // }
-      // return console.log('this.scoTitList',this.scoTitList);
-
       this.ScLoading = true;
 
       let _fileid = "";
@@ -607,16 +606,16 @@ export default {
         _fileid = await this.createFileid(this.currentUid.content);
       }
 
-      let sco = "";
+      let sco = ""; //分数
       this.scoTitList.forEach(e => {
-        sco += `${e.detail}:${e.cog}星`;
+        sco += `${e.detail}:${e.cog}星`;
       });
 
       let con = this.cuScoCon;
 
-      let std = "";
+      let std = ""; //维度
       let tit = [];
-      let laws = "";
+      let laws = ""; //细则
       if (this.tool.eList && this.tool.eList.length) {
         tit = JSON.parse(JSON.stringify(this.tool.eList));
       } else {
@@ -626,7 +625,7 @@ export default {
       if (this.tool.eList && this.tool.eList.length) {
         for (let i = 0; i < this.tool.eList.length; i++) {
           if (this.tool.eList[i].isai == 1) {
-            laws += `细则${i}:${this.tool.eList[i].rule}, \n`;
+            laws += `${this.tool.eList[i].rule}。 \n`;
           }
         }
         for (let i = 0; i < this.tool.eList.length; i++) {
@@ -639,21 +638,13 @@ export default {
             } else {
               result = a;
             }
-            std += `纬度${i}:“${result}”,  \n`;
+            std += `${result}。  \n`;
           }
         }
       } else {
         for (let i = 0; i < tit.length; i++) {
           if (tit[i].isai == 1) {
-            let a = tit[i].detail;
-            let result = "";
-
-            if (isNaN(parseFloat(a)) && a) {
-              result = a.match(/[\u4e00-\u9fa5a-zA-Z]+/g).join("");
-            } else {
-              result = a;
-            }
-            laws += ` 细则${i}:${tit[i].rule}, \n`;
+            laws += ` ${tit[i].rule}。 \n`;
           }
         }
         for (let i = 0; i < tit.length; i++) {
@@ -666,7 +657,7 @@ export default {
             } else {
               result = a;
             }
-            std += `纬度${i}:“${result}”,  \n`;
+            std += `${result}。  \n`;
           }
         }
       }
@@ -680,31 +671,33 @@ export default {
 
         #目标#
         你要结合<作业内容><评价标准>和该标准对应的<等级>写评语。
-        当作业内容与<评价细则>无关,或者缺乏原创性会被直接评为0星。此时你可以输出评语“==期待看到你自己的想法!必要时,可以请教老师哦~==”
+        当作业内容与评价细则无关,或者缺乏原创性会被直接评为0星。此时你可以输出评语“期待看到你自己的想法!必要时,可以请教老师哦~”
+        ${this.currentUid.type == 1 ? "提取图片内容进行评价" : ""}
       
           
         #评分资料#
         评价标准:${std}
+        评价细则:${laws}
         等级:${sco}
         作业内容:${_fileid ? "上传的文件内容" : con}
 
 
         #输出要求#
         “评语”字数控制在150字左右,参考输出范例。
-        只输出评价内容,不要输出其他无关内容
+        严格输出按照格式输出json格式。只输出json格式的内容,其他内容不要输出
         
           
         #输出格式#
-        ==
-        学生能够全面且正确地描述光合作用中氧气和葡萄糖的生成过程,涵盖光反应和暗反应的每个阶段和主要反应物及产物。同时,学生也能够全面、准确地解释氧气和葡萄糖在植物生命活动中的重要作用,并展示了对光合作用的深入理解。论文结构良好,内容详实,逻辑清晰,论据充分。
-        ==
+        [{'comment':'评语(150个汉字左右)'}]
+
 
         #输出范例#
-        学生能够全面且正确地描述光合作用中氧气和葡萄糖的生成过程,涵盖光反应和暗反应的每个阶段和主要反应物及产物。同时,学生也能够全面、准确地解释氧气和葡萄糖在植物生命活动中的重要作用,并展示了对光合作用的深入理解。论文结构良好,内容详实,逻辑清晰,论据充分。
+        [{'comment':'学生能够全面且正确地描述光合作用中氧气和葡萄糖的生成过程,涵盖光反应和暗反应的每个阶段和主要反应物及产物。同时,学生也能够全面、准确地解释氧气和葡萄糖在植物生命活动中的重要作用,并展示了对光合作用的深入理解。论文结构良好,内容详实,逻辑清晰,论据充分。'}]
         `;
+      // console.log("messages", messages);
 
       let params = {
-        assistant_id: "f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b",
+        assistant_id: "6063369f-289a-11ef-8bf4-12e77c4cb76b",
         message: [
           {
             type: "text",
@@ -722,17 +715,47 @@ export default {
         .then(response => {
           let data = response.data.FunctionResponse;
           console.log("data", data);
-          // 找到第一个等号的位置
-          const startIndex = data.message.indexOf("==") + 2;
-          // 找到最后一个等号的位置
-          const endIndex = data.message.lastIndexOf("==");
+          if (data.message) {
+            let dArray = {};
+            try {
+              dArray = JSON.parse(
+                data.message.replaceAll("```json", "").replaceAll("```", "")
+              );
+            } catch (error) {
+              console.log("error_________________" + error);
+              try {
+                let regex = new RegExp("(?<=```json)([\\s\\S]*?)(?=```)");
 
-          // 提取中间的文字
-          const extractedText = data.message
-            .substring(startIndex, endIndex)
-            .trim();
+                let match = data.message.match(regex);
+                dArray = JSON.parse(
+                  match[0]
+                    .replace(/\n/g, "")
+                    .replace(/\s{2,}/g, "")
+                    .replace(/\'/g, '"')
+                );
+              } catch (error) {
+                try {
+                  dArray = JSON.parse(
+                    data.message
+                      .replaceAll("```json", "")
+                      .replaceAll("# Solution", "")
+                      .replaceAll("```", "")
+                      .replace(/\n/g, "")
+                      .replace(/\s{2,}/g, "")
+                      .replace(/\'/g, '"')
+                  );
+                } catch (error) {
+                  console.log("error_________________" + error);
 
-          this.textarea = extractedText;
+                  this.anewEva();
+                  return;
+                }
+                console.log("error_________________" + error);
+              }
+            }
+            console.log("dArray", dArray);
+            this.textarea = dArray[0].comment;
+          }
           this.submit()
           this.$message.success("重新生成完成");
 
@@ -740,9 +763,7 @@ export default {
         })
         .catch(error => {
           this.ScLoading = false;
-
           this.$message.error("重新生成失败");
-
           console.log(error);
         });
     },
@@ -1906,7 +1927,7 @@ export default {
   right: 22px;
   color: #12b0ff;
   cursor: pointer;
-  font-size: 16px;
+  font-size: 14px;
   transform: translate(0px, 2px);
 }
 </style>

+ 4 - 4
src/components/easy2/studyStudent.vue

@@ -1357,7 +1357,7 @@
                       @click="openWordCloud(toolIndex)"
                       >生成词云</el-button
                     >
-                    <!-- <el-button
+                    <el-button
                       type="primary"
                       v-if="
                         tool.tool[0] == 16 && worksStudent[toolIndex].length > 0
@@ -1365,7 +1365,7 @@
                       style="position: absolute; right: 30px; top: -45px"
                       @click="uploadWorks(toolIndex)"
                       >导出作业</el-button
-                    >  -->
+                    > 
                     <!-- <el-button type="primary" v-if="tool.tool[0] == 57" style="
                         position: absolute;
                         right: 30px;
@@ -13742,9 +13742,9 @@ export default {
             continue;
           }
         }
-        console.log('con[i].type',con[i])
+        // console.log('con[i].type',con[i]) 
 
-        console.log('con[i].type',con[i].type)
+        // console.log('con[i].type',con[i].type)
         
         if(_fileid == 1 || con[i].type == 3){
           this.AIloading[toolIndex][i].loading=false;

+ 2 - 2
src/components/easy3/studyStudent.vue

@@ -1387,7 +1387,7 @@
                       @click="openWordCloud(toolIndex)"
                       >生成词云</el-button
                     >
-                    <!-- <el-button
+                    <el-button
                       type="primary"
                       v-if="
                         tool.tool[0] == 16 && worksStudent[toolIndex].length > 0
@@ -1395,7 +1395,7 @@
                       style="position: absolute; right: 30px; top: -45px"
                       @click="uploadWorks(toolIndex)"
                       >导出作业</el-button
-                    > -->
+                    >
                     <!-- <el-button type="primary" v-if="tool.tool[0] == 57" style="
                         position: absolute;
                         right: 30px;

+ 2 - 1
src/components/index.vue

@@ -711,9 +711,10 @@ export default {
       let params = {
         org: this.org && this.org != "" ? this.org : "",
         oid: this.oid && this.oid != "" ? this.oid : "",
+        stand: "cn"
       };
       this.ajax
-        .get(this.$store.state.api + "selectAllType", params)
+        .get(this.$store.state.api + "selectAllTypeStand", params)
         .then((res) => {
           if(this.oid == "69893dca-1d47-11ed-8c78-005056b86db5"){
             res.data[0] = [...res.data[0],...res.data[4]]

+ 2 - 2
src/components/studyStudent.vue

@@ -1356,7 +1356,7 @@
                       @click="openWordCloud(toolIndex)"
                       >生成词云</el-button
                     >
-                    <!-- <el-button
+                    <el-button
                       type="primary"
                       v-if="
                         tool.tool[0] == 16 && worksStudent[toolIndex].length > 0
@@ -1364,7 +1364,7 @@
                       style="position: absolute; right: 30px; top: -45px"
                       @click="uploadWorks(toolIndex)"
                       >导出作业</el-button
-                    > -->
+                    >
                     <!-- <el-button type="primary" v-if="tool.tool[0] == 57" style="
                         position: absolute;
                         right: 30px;

Неке датотеке нису приказане због велике количине промена