11wqe1 5 months ago
parent
commit
e4cd322e78

+ 194 - 53
src/components/easy2/commpont/markDialog.vue

@@ -5,7 +5,6 @@
     >
       <div class="left">
         <div
-          v-if="finalMarkList == toolIndex"
           v-loading="ScLoading"
         >
           <div class="scoreTit">
@@ -415,7 +414,9 @@ export default {
     "scoTit",
     "markScoreVisible",
     "markScoreworksStudent",
-    "finalMarkList"
+    "languageSetting",
+    "taskDetail",
+    "tool"
   ],
   data() {
     return {
@@ -464,17 +465,27 @@ export default {
           fullscreenToggle: true //全屏按钮
         }
       },
-      xianObj: ["DOCX", "MD", "TXT", "PDF"]
+      xianObj: ["DOCX", "MD", "TXT", "PDF",'JPG',"PNG"]
     };
   },
   watch: {
     markScoreVisible(newVal) {
+      
       this.workListShow = true;
       this.reveal = false;
       this.cutNum = 0;
       this.textarea = "";
-      this.scoTitList = JSON.parse(JSON.stringify(this.scoTit));
+      if (this.tool.eList && this.tool.eList.length) {
+        this.scoTitList = this.tool.eList;
+      }else{
+        this.scoTitList = JSON.parse(JSON.stringify(this.scoTit));
+      }
+
+      // this.scoTitList = JSON.parse(JSON.stringify(this.scoTit));
+
+
       this.selectSWorksData();
+      
     }
   },
   computed: {
@@ -486,10 +497,14 @@ export default {
         }
       });
       
-      return (a / this.scoTit.length).toFixed(1);
+      return (a / this.scoTitList.length).toFixed(1);
     },
+
+
     isMarkCom() {
-      if (this.currentUid.type == 4 || this.currentUid.type == 12) {
+      // console.log('this.currentUid',this.currentUid);
+      
+      if (this.currentUid.type == 1 || this.currentUid.type == 4 || this.currentUid.type == 12 ) {
         let a = this.currentUid.content.slice(
           this.currentUid.content.lastIndexOf(".") + 1
         );
@@ -503,6 +518,7 @@ export default {
         return 0;
       }
     },
+    // 如果评价标准都不是ai评分的话
     isMarkSco(){
       let c = 0
       
@@ -519,7 +535,13 @@ export default {
     }
   },
   mounted() {
-    this.scoTitList = JSON.parse(JSON.stringify(this.scoTit));
+    if (this.tool.eList && this.tool.eList.length) {
+      this.scoTitList = this.tool.eList;
+    }else{
+      this.scoTitList = JSON.parse(JSON.stringify(this.scoTit));
+    }
+    // this.scoTitList = JSON.parse(JSON.stringify(this.scoTit));
+    // console.log('toolIndex',this.toolIndex);
 
     this.selectSWorksData();
   },
@@ -579,21 +601,17 @@ export default {
         cid: this.cid,
         s: this.stage,
         t: this.task,
+        tool: this.toolIndex ? this.toolIndex : '',
         rate: JSON.stringify(processedData),
         uid: this.DgUid
       };
       // return console.log(params);
       this.ajax
-        .get(this.$store.state.api + "updateWorksEva", params)
+        .get(this.$store.state.api + "updateWorksEvaTwo", params)
         .then(res => {
-          // this.$message({
-          //   message: "评价成功",
-          //   type: "success"
-          // });
+       
           this.ScLoading = false;
 
-          // this.selectSWorksData();
-          // this.$emit("refreshOther", this.toolIndex);
         })
         .catch(err => {
           this.$message.error("评价失败");
@@ -621,63 +639,172 @@ export default {
 
     // ai评分
     async AIsubmit(work) {
-      // return console.log("con", this.scoTit, this.cuScoCon);
+      console.log('work',work);
+      
       this.ScLoading = true;
       let _fileid = "";
-      if (work.type == 4 || work.type == 12) {
+      if (work.type == 1 || work.type == 4 || work.type == 12) {
         _fileid = await this.createFileid(work.content);
       }
-      let tit = JSON.parse(JSON.stringify(this.scoTit));
-      tit.forEach((e, index) => {
-        if (!e.isai) {
-          e.isai = 1;
+
+      let tit = []
+      if (this.tool.eList && this.tool.eList.length) {
+        tit = JSON.parse(JSON.stringify(this.tool.eList));
+      }else{
+        tit = JSON.parse(JSON.stringify(this.scoTit));
+
+        let titRule = 0
+        let titRule2 = 0
+
+        tit.forEach((e, index) => {
+          if (!e.isai) {
+            e.isai = 1;
+          }
+        });
+
+        tit.forEach((e, index) => {
+          if (e.isai == 1) {
+            titRule2++
+            if (e.rule) {
+              titRule++
+            }
+          }
+        });
+
+        if (titRule != titRule2) {
+          this.ScLoading = false;
+          this.$message.info('细则努力生成中,请稍候……')
+          return
         }
-      });
+      }
+      
+
+      console.log('tit',JSON.parse(JSON.stringify(tit)));
+      
+  
+
       let con = this.cuScoCon;
 
-      let laws = "";
-      for (let i = 0; i < tit.length; i++) {
-        if (tit[i].isai == 1) {
-          let a = tit[i].detail
-          if (isNaN(parseFloat(a)) && a) {
-            var result = a.match(/[\u4e00-\u9fa5a-zA-Z]+/g).join("");
-          }else{
-            var result = a
+      let laws = ""
+      let std = ""
+      let text = ''
+
+      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`;
+          }
+        }
+
+        for (let i = 0; i < this.tool.eList.length; i++) {
+          if(this.tool.eList[i].isai == 1){
+            let a = this.tool.eList[i].detail
+            let result = ''
+
+            if (isNaN(parseFloat(a)) && a) {
+               result = a.match(/[\u4e00-\u9fa5a-zA-Z]+/g).join("");
+            }else{
+               result = a
+            }
+            std += `纬度${i}:“${result}”,  \n`;
+          }
+        }
+
+        for (let i = 0; i < this.tool.eList.length; i++) {
+          if(this.tool.eList[i].isai == 1){
+            let a = this.tool.eList[i].detail
+            let result = ''
+
+            if (isNaN(parseFloat(a)) && a) {
+               result = a.match(/[\u4e00-\u9fa5a-zA-Z]+/g).join("");
+            }else{
+               result = a
+            }
+            text += `{'${result}' : '评价等级0-5(数字)'},`;
+          }
+        }
+      }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`;
+          }
+        }
+
+        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
+            }
+            std += `纬度${i}:“${result}”,  \n`;
+          }
+        }
+
+        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
+            }
+            text += `{'${result}' : '评价等级0-5(数字)'},`;
+
           }
-        
-          laws += `评价维度:“${result}”, 评价细则:${tit[i].rule} \n`;
         }
       }
 
+ 
       let msg = `NOTICE
-      Role: 你是一个专业的项目式学习导师,你要对学生的评价高度负责。你要根据“六级评价细则”给学生作品评分,并生成需要的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".
+     Role: 你是一个资深的教师,你有丰富的项目式学习、跨学科学习、STEAM导师经验,你要对学生的评价高度负责
+      Language: ${this.getLang()}
+      ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced the "Format example".
       Instruction: Based on the context, follow "Format example", write content.
 
-      #Context
-      ##要求
-      根据<评价细则>和<作业内容>的相关性评价作业,判断该作业属于六级中的哪个等级,结合“评价细则”和等级写评语。如果作业内容与评价细则无关,则直接评为0星。
+      #目标#
+      你要根据“六级评价细则”点评学生作品,并生成需要的JSON数据。
+      你要根据<评价细则>和<作业内容>的相关性评价作业,判断该作业属于六级中的哪个等级。
+      你要结合<评价标准><评价细则>和<你判断的等级>写评语。
+      如果作业内容与评价细则无关,则直接评为0星。如果作业内容与<任务描述>或<工具描述>一致或者相似,则直接评为0星,并输出评语“期待看到你自己的想法!必要时,可以请教老师哦~”
+      
 
-      ##评分资料
+      #评分资料#
+      评价标准:${std}
       评价细则:${laws}
       作业内容:${_fileid ? "上传的文件内容" : con}
-
+      任务描述:${this.taskDetail ? this.taskDetail :''}
+      工具描述:${this.tool.toolDetail ? this.tool.toolDetail : ''}
+      
+   
       #输出要求#
-      输出每个维度的“等级”和作业的综合性“评语”
-      “评语”控制在150字左右
-      评价维度要按原样输出,只输出 ##评分资料 “评分细则”引号内的
-
+      输出每个评价标准角度的“等级”和作业的综合性“评语”。
+      “评语”控制在150字左右。
+      评价标准要按原样输出,严格按照输出格式输出json格式。只输出json格式的内容,其他内容不要输出!
 
-      # Format example
-      [{'评价维度':'评价等级0-5(数字)'},{'评价维度':'评价等级0-5(数字)'},{'评价维度':'评价等级0-5(数字)'},{'评价维度':'评价等级0-5(数字)'},{'评语':'评语(150个字左右)'}]
+      #输出格式#
+      [${text}{'comment':'评语(150个汉字左右)'}]
       `;
       // console.log(msg);
-      this.aiGet2(msg, _fileid);
+      this.aiGet2(msg, _fileid,work);
     },
 
     // ai打分
-    aiGet2(messages, _fileid) {
+    aiGet2(messages, _fileid,work) {
       let _this = this;
 
       let params = {
@@ -691,6 +818,7 @@ export default {
         session_name: uuidv4(),
         userId: this.cUserid,
         file_ids: _fileid ? [_fileid] : [],
+        isImage: work.type == 1 ? true : '',
         model: "gpt-4o-2024-08-06"
       };
       this.ajax
@@ -763,7 +891,7 @@ export default {
                 
 
 
-                if (key != "评语") {
+                if (key != "comment") {
                   let isNumK = /^\d+(\.\d+)?$/.test(processedData[key]);
                   if (result.indexOf(key2) != -1 && isNumK) {
                      IsAIsuccess++
@@ -825,7 +953,7 @@ export default {
               }
             }
             for (const key in processedData) {
-              if (key == "评语") {
+              if (key == "comment") {
                 processedDataCopy.content = processedData[key];
               }
             }
@@ -834,6 +962,7 @@ export default {
               cid: _this.cid,
               s: _this.stage,
               t: _this.task,
+              tool: _this.toolIndex ? _this.toolIndex : '',
               rate: JSON.stringify(processedDataCopy),
               uid: _this.DgUid
             };
@@ -841,7 +970,7 @@ export default {
             
             // return  _this.ScLoading = false;
             _this.ajax
-              .get(_this.$store.state.api + "updateWorksEva", params)
+              .get(_this.$store.state.api + "updateWorksEvaTwo", params)
               .then(res => {
                 _this.$message({
                   message: "评价成功",
@@ -959,11 +1088,23 @@ export default {
         );
       }
     },
+    getLang(){
+      let lang = ''
+      if(this.languageSetting == 0){
+        lang = 'Chinese.'
+      }else if(this.languageSetting == 1){
+        lang = 'Traditional Chinese.'
+      }else if(this.languageSetting == 2){
+        lang = 'English.'
+      }
+      return lang
+    },
     //全部作业
     selectSWorksData() {
       this.vLoading = true;
       this.textarea = "";
-      console.log(this.scoTitList);
+      // console.log(this.scoTitList);
+      // console.log('toolIndex',this.toolIndex);
       
 
       let params = {
@@ -975,7 +1116,7 @@ export default {
       };
       // return console.log(params);
       this.ajax
-        .get(this.$store.state.api + "selectMarkDialogWorks", params)
+        .get(this.$store.state.api + "selectMarkDialogWorksTwo", params)
         .then(res => {
           let data = res.data[0];
 
@@ -1082,7 +1223,7 @@ export default {
       };
       // return console.log(params);
       this.ajax
-        .get(this.$store.state.api + "selectMarkDialogWorks", params)
+        .get(this.$store.state.api + "selectMarkDialogWorksTwo", params)
         .then(res => {
           let data = res.data[0];
           console.log('data',data);

+ 52 - 249
src/components/easy2/commpont/markScore.vue

@@ -77,6 +77,7 @@ export default {
     "loading",
     "wIndex",
     "toolIndex",
+    "tool"
   ],
 
   data() {
@@ -87,7 +88,8 @@ export default {
       id: this.$route.query.courseId,
       stUid: this.scoCon.userid,
       userid: this.$route.query.userid,
-      total: 0
+      total: 0,
+      textarea:''
     };
   },
 
@@ -95,6 +97,7 @@ export default {
     totalScore() {
       let a = 0;
       let isPing = 0;
+      
       this.scoTitList.forEach(e => {
         if (e.cog || e.cog == "0") {
           a += e.cog * 1;
@@ -102,16 +105,17 @@ export default {
           isPing += 1;
         }
       });
+      
 
       let data = 0;
-      if (isPing == this.scoTit.length) {
+      if (isPing == this.scoTitList.length) {
         this.$emit("updateDocSco", {
           val: this.toolIndex,
           val2: this.wIndex,
           val3: null
         });
       } else {
-        data = (a / this.scoTit.length).toFixed(1);
+        data = (a / this.scoTitList.length).toFixed(1);
         this.$emit("updateDocSco", {
           val: this.toolIndex,
           val2: this.wIndex,
@@ -124,7 +128,12 @@ export default {
   },
 
   mounted() {
-    this.scoTitList = JSON.parse(JSON.stringify(this.scoTit));
+    
+    if (this.tool.eList && this.tool.eList.length) {
+      this.scoTitList = JSON.parse(JSON.stringify(this.tool.eList));
+    }else{
+      this.scoTitList = JSON.parse(JSON.stringify(this.scoTit));
+    }
     this.getData();
   },
 
@@ -158,19 +167,21 @@ export default {
 
     // 获取单个数据
     getData() {
-      // this.fileId =[]
-      // console.log(' this.scoCon', this.scoTitList);
-      
+
       let params = {
         uid: this.scoCon.userid,
-        cid: this.id
+        cid: this.id,
+        s:this.stage,
+        t:this.task,
+        tool:this.toolIndex ? this.toolIndex :''
       };
       this.ajax
-        .get(this.$store.state.api + "selectWorksEvaScore", params)
+        .get(this.$store.state.api + "selectWorksEvaScoreTwo", params)
         .then(res => {
           // console.log("res", res.data);
 
           if (res.data[0].length > 0) {
+            
             var data2 = [];
             res.data[0].forEach((val, index) => {
               if (val.task == this.task) {
@@ -178,18 +189,18 @@ export default {
                 this.homeworkVal = res.data[0][index];
               }
             });
-            // console.log('data2',data2);
             
             if (data2.length == 0) {
-              this.scoTitList = JSON.parse(JSON.stringify(this.scoTit));
+              if (this.tool.eList && this.tool.eList.length) {
+                this.scoTitList = JSON.parse(JSON.stringify(this.tool.eList));
+              }else{
+                this.scoTitList = JSON.parse(JSON.stringify(this.scoTit));
+              }
             } else {
               let data = JSON.parse(data2.rate);
               this.scoTitList.forEach((e, index) => {
                 e.cog = null;
                 for (const key in data) {
-                  // if (e.value.endsWith('。')) {
-                  //   e.value = e.value.slice(0, -1); // 如果字符串以句号结尾,则去除最后一个字符
-                  // }
 
                   if (isNaN(parseFloat(e.detail)) && e.detail) {
                     var result = e.detail.match(/[\u4e00-\u9fa5a-zA-Z]+/g).join("");
@@ -219,7 +230,11 @@ export default {
               // console.log(this.scoTitList);
             }
           } else {
-            this.scoTitList = JSON.parse(JSON.stringify(this.scoTit));
+            this.scoTitList.forEach((e, index) => {
+              e.cog = null;
+            })
+            this.scoTitList = JSON.parse(JSON.stringify(this.scoTitList));
+
           }
         })
         .catch(err => {
@@ -227,12 +242,21 @@ export default {
         });
     },
     markScoreDigBtn() {
-      this.$emit("markScoreDig", {
-        val: this.stUid,
-        val2: this.toolIndex,
-        tit: this.scoTit,
-        uname:this.scoCon.sName
-      });
+      if (this.tool.eList && this.tool.eList.length) {
+        this.$emit("markScoreDig", {
+          val: this.stUid,
+          val2: this.toolIndex,
+          tit: this.tool.eList,
+          uname:this.scoCon.sName
+        });
+      }else{
+        this.$emit("markScoreDig", {
+          val: this.stUid,
+          val2: this.toolIndex,
+          tit: this.scoTit,
+          uname:this.scoCon.sName
+        });
+      }
     },
     // 重置
     reset() {
@@ -242,233 +266,10 @@ export default {
       });
     },
 
-    // 老师提交评分
-    submit() {
-      let data = this.scoTitList.map(e => {
-        return e.detail + ":" + e.cog;
-      });
-      // console.log("data", data);
-      const processedData = {};
-
-      data.forEach(item => {
-        const [key, value] = item.split(":");
-        processedData[key] = Number(value) ? Number(value) : 0;
-      });
-
-      processedData.content = this.textarea;
-      // console.log(processedData);
-      let params = {
-        cid: this.id,
-        s: this.stage,
-        t: this.task,
-        rate: JSON.stringify(processedData),
-        uid: this.stUid
-      };
-      // return console.log(params);
-      this.ajax
-        .get(this.$store.state.api + "updateWorksEva", params)
-        .then(res => {
-          this.$message({
-            message: "评价成功",
-            type: "success"
-          });
-          this.$emit("refreshOther", this.toolIndex);
-        })
-        .catch(err => {
-          this.$message.error("评价失败");
-          console.error(err);
-        });
-    },
-
-    // ai评分
-    AIsubmit() {
-      let tit = this.scoTit;
-      tit.forEach((e, index) => {
-        if (!e.isai) {
-          e.isai = 1;
-        }
-      });
-      let con = JSON.parse(this.scoCon.works);
-      this.$emit("updateLoading", {
-        val: this.toolIndex,
-        val2: this.wIndex,
-        val3: true
-      });
-      let _text = "";
-      for (let i = 0; i < tit.length; i++) {
-        if (tit[i].isai == 1) {
-          _text += `评价名称:${tit[i].value} 评价描述:${tit[i].detail} \n`;
-        }
-      }
-      let laws = "";
-      for (let i = 0; i < tit.length; i++) {
-        if (tit[i].isai == 1) {
-          laws += `评价维度:${tit[i].value} 评价细则:${tit[i].rule} \n`;
-        }
-      }
-
-      //  console.log(_text);
-      let msg = `NOTICE
-      Role: 你是一个专业的项目式学习导师,你要对学生的评价高度负责。你要根据“六级评价细则”给学生作品评分,并生成需要的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.
-
-      #Context
-      ##要求
-      根据<评价细则>和<作业内容>的相关性评价作业,判根据细则评价作业,判断该作业属于六级中的哪个等级。如果作业内容与评价细则无关,则直接评为0星。
-      
-
-      
-      ##评分资料
-      评价细则:${laws}
-      作业内容:${con.text}
-
-      # Format example
-      [{'评价名称':'评价等级0-5(数字)'},{'评价名称':'评价等级0-5(数字)'},{'评价名称':'评价等级0-5(数字)'},{'评价名称':'评价等级0-5(数字)'}]
-      `;
-      // console.log(msg);
-      this.aiGet2(msg);
-    },
-
-    // ai打分
-    aiGet2(messages) {
-      // console.log(this.toolIndex, this.wIndex);
-      let _this = this;
-
-      let params = {
-        assistant_id: "6063369f-289a-11ef-8bf4-12e77c4cb76b",
-        message: [
-          {
-            type: "text",
-            text: messages.replaceAll("\n", " ").replaceAll("*", "")
-          }
-        ],
-        session_name: uuidv4(),
-        userId: this.userid,
-        file_ids: [],
-        model: "gpt-4o-2024-08-06"
-      };
-      this.ajax
-        .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", params)
-        .then(response => {
-          let data = response.data.FunctionResponse;
-          // console.log("data", data);
-          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]*?)(?=```)");
-
-                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);
-                }
-                console.log("error_________________" + error);
-              }
-            }
-            // console.log("dArray3", dArray);
-            // _this.submit2(dArray);
-            // 提交评分
-            // if (!dArray) {
-            //   _this.$emit("updateLoading", {val:_this.task,val2:_this.wIndex,val3:false});
-            // }
-            let processedData = {};
-            // return console.log(dArray);
-
-            dArray.forEach(function(item) {
-              let key = Object.keys(item)[0];
-              let value = item[key];
-              processedData[key] = value;
-            });
-
-            for (const key in processedData) {
-              if (!Number.isFinite(processedData[key] * 1)) {
-                processedData[key] = 0;
-              }
-            }
-
-            processedData.content = this.textarea;
-
-            let params = {
-              cid: _this.id,
-              s: _this.stage,
-              t: _this.task,
-              rate: JSON.stringify(processedData),
-              uid: _this.stUid
-            };
-            // console.log(params);
-            _this.ajax
-              .get(_this.$store.state.api + "updateWorksEva", params)
-              .then(res => {
-                _this.$message({
-                  message: "评价成功",
-                  type: "success"
-                });
-                // console.log(_this.wIndex, _this.task);
-                _this.$emit("updateLoading", {
-                  val: _this.toolIndex,
-                  val2: _this.wIndex,
-                  val3: false
-                });
-                _this.$emit("refreshOther", _this.toolIndex);
-                _this.getData();
-                // _this.markScoPopover = false;
-                // _this.$emit("update:loading", false);
-              })
-              .catch(err => {
-                _this.$message.error("评价失败");
-                _this.$emit("updateLoading", {
-                  val: _this.toolIndex,
-                  val2: _this.wIndex,
-                  val3: false
-                });
-                console.error(err);
-              });
-          }
-          this.$forceUpdate();
-
-        })
-        .catch(error => {
-          // _this.markScoPopover = false;
-          // _this.$emit("update:loading", false);
-          _this.$emit("updateLoading", {
-            val: _this.toolIndex,
-            val2: _this.wIndex,
-            val3: false
-          });
-          _this.$message.error("评价失败");
-
-          // _this.loading = false
-          console.log(error);
-        });
-    },
 
 
     // ai循环评分
-    async aiupdetaSco(messages, uid, stage, task,_fileid) {
+    async aiupdetaSco(messages, uid, stage, task,_fileid,work) {
       let _this = this;
       let params = {
         assistant_id: "6063369f-289a-11ef-8bf4-12e77c4cb76b",
@@ -481,6 +282,7 @@ export default {
         session_name: uuidv4(),
         userId: this.userid,
         file_ids: _fileid ? [_fileid] : [],
+        isImage: work == 0 ? true : '',
         model: "gpt-4o-2024-08-06"
       };
       return new Promise((resolve,reject) => {
@@ -558,7 +360,7 @@ export default {
                   // let key2 = key.match(/[\u4e00-\u9fa5a-zA-Z]+/g).join("");
 
 
-                  if (key != "评语") {
+                  if (key != "comment") {
                   let isNumK = /^\d+(\.\d+)?$/.test(processedData[key]);
 
                     if (result.indexOf(key2) != -1 && isNumK) {
@@ -609,7 +411,7 @@ export default {
                 }
               }
               for (const key in processedData) {
-                if (key == "评语") {
+                if (key == "comment") {
                   processedDataCopy.content = processedData[key];
                 }
               }
@@ -617,15 +419,16 @@ export default {
                 cid: _this.id,
                 s: stage,
                 t: task,
+                tool: this.toolIndex ? this.toolIndex : '',
                 rate: JSON.stringify(processedDataCopy),
                 uid: uid
               };
               // console.log("params", params);
               _this.ajax
-                .get(_this.$store.state.api + "updateWorksEva", params)
+                .get(_this.$store.state.api + "updateWorksEvaTwo", params)
                 .then(res => {
                   console.log('999999999999999999999999999999999999999999999999999');
-                  
+                  this.$emit('refreshOther',{tid:this.toolIndex,wid:this.wIndex})
                   return resolve(1);
                   
                 })

File diff suppressed because it is too large
+ 289 - 319
src/components/easy2/studyStudent.vue


Some files were not shown because too many files changed in this diff