Browse Source

Merge branch 'beta' into alpha

lsc 6 months ago
parent
commit
cfb9c309cf

+ 1 - 1
dist/index.html

@@ -27,7 +27,7 @@
     html,
     body{
       font-family: '黑体';
-    }</style><link href=./static/css/app.4375ef9c1cc62a21e90c61c4a77855af.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.b5a78a47ec38c79eb330.js></script><script type=text/javascript src=./static/js/app.c49a21c342cf6f8f32e0.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.8923a99003a19a5af10f979f97ba285d.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.b5a78a47ec38c79eb330.js></script><script type=text/javascript src=./static/js/app.9b5627667a7b8e5f8ce5.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.4375ef9c1cc62a21e90c61c4a77855af.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.8923a99003a19a5af10f979f97ba285d.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.8923a99003a19a5af10f979f97ba285d.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.9b5627667a7b8e5f8ce5.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.9b5627667a7b8e5f8ce5.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map


+ 309 - 159
src/components/easy2/commpont/markDialog.vue

@@ -17,7 +17,7 @@
               >分
             </div>
           </div>
-          <div class="allD">
+          <div class="allD" :style="{marginLeft: isMarkSco ? '0' :'17px'}">
             <div class="scoreStar">
               <div
                 v-show="reveal"
@@ -28,15 +28,15 @@
                   <el-tooltip
                     class="item"
                     effect="dark"
-                    :content="e.value"
+                    :content="e.detail"
                     placement="top"
                   >
-                    <div class="briefTit">
-                      <img class="titRoot" src="../../../assets/icon/newIcons/blueRoot.png" alt="">
-                      {{ e.value }}
+                    <div class="briefTit" >
+                      <img v-if="e.isai == 1 || !e.isai" class="titRoot" src="../../../assets/icon/newIcons/blueRoot.png" alt="">
+                      {{ e.detail }}
                     </div>
                   </el-tooltip>
-                  <el-rate v-model="e.cog"></el-rate>
+                  <el-rate @change="submit" v-model="e.cog"></el-rate>
                 </div>
               </div>
               <div
@@ -48,15 +48,15 @@
                   <el-tooltip
                     class="item"
                     effect="dark"
-                    :content="e.value"
+                    :content="e.detail"
                     placement="top"
                   >
                     <div class="briefTit">
-                      <img class="titRoot" src="../../../assets/icon/newIcons/blueRoot.png" alt="">
-                      {{ e.value }}
+                      <img class="titRoot" v-if="e.isai == 1 || !e.isai" src="../../../assets/icon/newIcons/blueRoot.png" alt="">
+                      {{ e.detail }}
                     </div>
                   </el-tooltip>
-                  <el-rate v-model="e.cog"></el-rate>
+                  <el-rate @change="submit" v-model="e.cog"></el-rate>
                 </div>
               </div>
             </div>
@@ -81,36 +81,16 @@
               type="textarea"
               placeholder="您可在此输入评语"
               v-model="textarea"
-              style="padding-bottom: 10px;"
+               @blur="submit"
             >
             </el-input>
-            <div
-              class="AreaBtn"
-              v-if="
-                currentUid.type == 10 || currentUid.type == 13 || isMarkCom == 1
-              "
-              @click="generateMsg(currentUid)"
-            >
-              <span>重新生成</span>
-            </div>
           </div>
 
           <div
             style="width:100%;display:flex;height: 25px;;justify-content: space-between;"
           >
-            <div
-              class="ScrBtn"
-              @click="AIsubmit(currentUid)"
-              v-if="
-                currentUid.type == 10 || currentUid.type == 13 || isMarkCom == 1
-              "
-            >
-              <img
-                src="../../../assets/icon/newIcons/Brootper.svg"
-                alt=""
-              />AI评分
-            </div>
-            <div v-else></div>
+            
+            <div ></div>
 
             <div style="display: flex;">
               <div
@@ -118,14 +98,34 @@
                 @click="reset"
                 style="color: rgba(0, 0, 0, 0.6);background-color: rgba(243, 247, 253, 1);border: none;"
               >
-                重置
+                清空
               </div>
+
               <div
                 class="ScrBtn"
-                @click="submit"
-                style="margin-left: 10px;color:#fff;border: none;background-color: rgba(54, 129, 252, 1);"
+                style="margin-left: 10px;"
+                @click="AIsubmit(currentUid)"
+                v-if="
+                  (currentUid.type == 10 || currentUid.type == 13 || isMarkCom == 1) && !isMarkSco
+                "
               >
-                确认
+                <img
+                  src="../../../assets/icon/newIcons/rootImg.png"
+                  alt=""
+                />AI评分
+              </div>
+              <div
+                class="ScrBtn"
+                style="margin-left: 10px;"
+                v-if="
+                  (currentUid.type == 10 || currentUid.type == 13 || isMarkCom == 1) && isMarkSco
+                "
+                @click="noIsAi"
+              >
+                <img
+                  src="../../../assets/icon/newIcons/rootImg.png"
+                  alt=""
+                />AI评分
               </div>
             </div>
           </div>
@@ -143,7 +143,7 @@
               :key="index"
               :class="['schPer', i.userid == DgUid ? 'selBlock' : '']"
               style="cursor: pointer;"
-              @click="cutPer(i.userid)"
+              @click="cutPer(i.userid,index)"
             >
               <img v-if="i.headportrait" :src="i.headportrait" alt="" />
               <img
@@ -210,10 +210,12 @@
           </div>
           <div class="cutStuBtn">
             <div>
-              <span @click="prevStu" style="cursor: pointer;">上一个</span>
+              <span v-if="current == 0"  style="cursor: pointer;color:#ccc">上一个</span>
+              <span v-else @click="prevStu" style="cursor: pointer;color: rgba(54, 129, 252, 1)">上一个</span>
             </div>
             <div>
-              <span @click="nextStu" style="cursor: pointer;">下一个</span>
+              <span v-if="current >= workList.length -1"  style="cursor: pointer;color: #ccc">下一个</span>
+              <span v-else @click="nextStu" style="cursor: pointer;color: rgba(54, 129, 252, 1)">下一个</span>
             </div>
             <!-- <div><span @click="prevStu" v-if="this.current > 0">上一个</span></div>
             <div><span @click="nextStu" v-if="this.current < this.workList.length-1">下一个</span></div> -->
@@ -278,15 +280,19 @@
             ></iframe>
           </div>
           <div v-if="currentUid.type == 12" style="height: 100%;">
-            <div>
+            <!-- <div style="margin-bottom: 10px;">
               <div
                 style="cursor: pointer;"
                 @click="downloadFile(currentUid.content)"
               >
-                下载txt
+                下载文件
               </div>
-              <!-- <div>{{ currentUid.content }}</div> -->
-            </div>
+            </div> -->
+            <div>{{ TxtMd }}</div>
+            <!-- <div
+              v-html="htmlContent(currentUid.content)"
+            ></div> -->
+            
           </div>
           <div v-if="currentUid.type == 15" style="height: 100%;">
             <div
@@ -370,7 +376,46 @@
 
 <script>
 import { v4 as uuidv4 } from "uuid";
-
+import MarkdownIt from "markdown-it";
+const getFile = (url) => {
+	return new Promise((resolve, reject) => {
+		var credentials = {
+			accessKeyId: "AKIATLPEDU37QV5CHLMH",
+			secretAccessKey: "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",
+		}; //秘钥形式的登录上传
+		window.AWS.config.update(credentials);
+		window.AWS.config.region = "cn-northwest-1"; //设置区域
+		let url2 = url;
+		let _url2 = "";
+		if (
+			url2.indexOf("https://view.officeapps.live.com/op/view.aspx?src=") != -1
+		) {
+			_url2 = url2.split(
+				"https://view.officeapps.live.com/op/view.aspx?src="
+			)[1];
+		} else {
+			_url2 = url2;
+		}
+		var s3 = new window.AWS.S3({ params: { Bucket: "ccrb" } });
+		let name = decodeURIComponent(
+			_url2.split("https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/")[1]
+		);
+		var params = {
+			Bucket: "ccrb",
+			Key: name,
+		};
+		s3.getObject(params, function (err, data) {
+			if (err) {
+				console.log(err, err.stack);
+				resolve({ data: 1 });
+			} else {
+				const fileContent = data.Body.toString('utf-8');
+				resolve({ data: fileContent });
+			} // sxuccessful response
+		});
+		// axios({
+	});
+};
 export default {
   props: [
     "uid",
@@ -392,7 +437,8 @@ export default {
       workList: [], //作业列表
       cid: this.$route.query.courseId,
       cUserid: this.$route.query.userid, //账号登录人id
-      cuScoCon: "",
+      cuScoCon: "", //学生作业内容
+      TxtMd:'',   //txt,md作业内容
       currentUid: {}, //当前评分框学生信息
       current: "", //上一位下一位中的第几位
       DgUid: this.uid, //当前评分框学生id
@@ -444,7 +490,6 @@ export default {
   computed: {
     totalScore() {
       let a = 0;
-
       this.scoTitList.forEach(e => {
         if (e.cog) {
           a += e.cog * 1;
@@ -454,7 +499,6 @@ export default {
       return (a / this.scoTit.length).toFixed(1);
     },
     isMarkCom() {
-      // console.log('a',this.currentUid);
       if (this.currentUid.type == 4 || this.currentUid.type == 12) {
         let a = this.currentUid.content.slice(
           this.currentUid.content.lastIndexOf(".") + 1
@@ -468,6 +512,20 @@ export default {
       } else {
         return 0;
       }
+    },
+    isMarkSco(){
+      let c = 0
+      
+      this.scoTitList.forEach(e=>{
+        if (e.isai == 2) {
+          c++
+        }
+      })
+      console.log(c , this.scoTitList.length);
+      this.$forceUpdate()
+      if (c == this.scoTitList.length) return c
+      
+      return 0
     }
   },
   mounted() {
@@ -476,6 +534,9 @@ export default {
     this.selectSWorksData();
   },
   methods: {
+    noIsAi(){
+      this.$message.info('您的评价维度未设置ai评分')
+    },
     // 预览图片
     previewImg(url) {
       //预览图片
@@ -512,7 +573,7 @@ export default {
     // 老师提交评分
     submit() {
       let data = this.scoTitList.map(e => {
-        return e.value + ":" + e.cog;
+        return e.detail + ":" + e.cog;
       });
       // console.log("data", data);
       const processedData = {};
@@ -535,13 +596,13 @@ export default {
       this.ajax
         .get(this.$store.state.api + "updateWorksEva", params)
         .then(res => {
-          this.$message({
-            message: "评价成功",
-            type: "success"
-          });
+          // this.$message({
+          //   message: "评价成功",
+          //   type: "success"
+          // });
           this.ScLoading = false;
 
-          this.selectSWorksData();
+          // this.selectSWorksData();
           // this.$emit("refreshOther", this.toolIndex);
         })
         .catch(err => {
@@ -552,89 +613,22 @@ export default {
 
     // 重置
     reset() {
-      this.scoTitList.forEach(e => {
-        e.cog = 0;
-      });
-      this.textarea = "";
+      this.$confirm("是否清空评分和评语?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          this.scoTitList.forEach(e => {
+            e.cog = 0;
+          });
+          this.textarea = "";
+        })
+        .catch(() => {});
+    
       // this.scoTitList = JSON.parse(JSON.stringify(this.scoTit));
     },
 
-    async generateMsg(work) {
-      this.ScLoading = true;
-      let tit = this.scoTit;
-      tit.forEach((e, index) => {
-        if (!e.isai) {
-          e.isai = 1;
-        }
-      });
-      let _fileid = "";
-      if (work.type == 4 || work.type == 12) {
-        _fileid = await this.createFileid(work.content);
-      }
-      let con = this.cuScoCon;
-
-      let laws = "";
-      for (let i = 0; i < tit.length; i++) {
-        if (tit[i].isai == 1) {
-          laws += `评价维度:${tit[i].value} 评价细则:${tit[i].rule} \n`;
-        }
-      }
-      let msg = `NOTICE
-          Role:你是一个专业的项目式学习导师,你要对学生的评价高度负责。你要根据“六级评价细则”评价学生作业。
-          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
-          ##要求
-          根据<评价细则>和<作业内容>的相关性评价作业,只用输出作业的综合性“评语”,不要带标题,字数控制在150字左右,不要输出其他无关内容。
-
-
-          ##评分资料
-          评价细则:${laws}
-          作业内容:${_fileid ? "上传的文件内容" : con}
-
-
-          # Format example
-          学生能够全面且正确地描述光合作用中氧气和葡萄糖的生成过程,涵盖光反应和暗反应的每个阶段和主要反应物及产物。同时,学生也能够全面、准确地解释氧气和葡萄糖在植物生命活动中的重要作用,并展示了对光合作用的深入理解。论文结构良好,内容详实,逻辑清晰,论据充分。
-          `;
-      // return console.log(msg);
-
-      this.generateRemark(msg, _fileid);
-    },
-    // 重新获取评语
-    generateRemark(messages, _fileid) {
-      let _this = this;
-
-      let params = {
-        assistant_id: "f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b",
-        message: [
-          {
-            type: "text",
-            text: messages.replaceAll("\n", " ").replaceAll("*", "")
-          }
-        ],
-        session_name: uuidv4(),
-        userId: this.cUserid,
-        file_ids: _fileid ? [_fileid] : [],
-        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);
-          this.textarea = data.message;
-          // this.selectSWorksData()
-          this.ScLoading = false;
-        })
-        .catch(error => {
-          this.ScLoading = false;
-
-          _this.$message.error("评价失败");
-          console.log(error);
-        });
-    },
     // ai评分
     async AIsubmit(work) {
       // return console.log("con", this.scoTit, this.cuScoCon);
@@ -654,7 +648,7 @@ export default {
       let laws = "";
       for (let i = 0; i < tit.length; i++) {
         if (tit[i].isai == 1) {
-          let a = tit[i].value
+          let a = tit[i].detail
           let result = a.match(/[\u4e00-\u9fa5a-zA-Z]+/g).join("");
         
           laws += `评价维度:“${result}”, 评价细则:${tit[i].rule} \n`;
@@ -755,7 +749,39 @@ export default {
               processedData[key] = value;
             });
 
-            // console.log(JSON.parse(JSON.stringify(processedData)));
+
+            // 判断返回数据正确数量
+            let IsAIsuccess = 0
+            for (const tKey in this.scoTitList) {
+              for (const key in processedData) {
+                let result = this.scoTitList[tKey].detail.match(/[\u4e00-\u9fa5a-zA-Z]+/g).join("");
+                let key2 = key.match(/[\u4e00-\u9fa5a-zA-Z]+/g).join("");
+                if (key != "评语") {
+                  let isNumK = /^\d+(\.\d+)?$/.test(processedData[key]);
+                  if (result.indexOf(key2) != -1 && isNumK) {
+                     IsAIsuccess++
+                  }
+                  continue;
+                }
+              }
+              continue;
+            }
+
+            // 计算可以ai评分的评价标准数量
+            let scotNum = 0
+            this.scoTitList.forEach(e=>{
+              if (e.isai == 1 || !e.isai) {
+                scotNum++
+              }
+            })
+
+
+            if (IsAIsuccess != scotNum) {
+              console.log('评价失败');
+              
+              this.aiGet2(messages,_fileid)
+              return
+            }
 
             for (const key in processedData) {
               if (key == "评语") {
@@ -763,7 +789,6 @@ export default {
               }
             }
             delete processedData["评语"];
-            console.log("processedData", processedData);
 
             let params = {
               cid: _this.cid,
@@ -772,7 +797,6 @@ export default {
               rate: JSON.stringify(processedData),
               uid: _this.DgUid
             };
-            // console.log("params", params);
             _this.ajax
               .get(_this.$store.state.api + "updateWorksEva", params)
               .then(res => {
@@ -785,8 +809,9 @@ export default {
                 _this.selectSWorksData();
               })
               .catch(err => {
-                _this.ScLoading = false;
-                _this.$message.error("评价失败");
+                // _this.ScLoading = false;
+                // _this.$message.error("评价失败");
+                this.aiGet2(messages,_fileid)
 
                 console.error(err);
               });
@@ -794,8 +819,9 @@ export default {
           this.$forceUpdate();
         })
         .catch(error => {
-          _this.$message.error("评价失败");
-          _this.ScLoading = false;
+          // _this.$message.error("评价失败");
+          // _this.ScLoading = false;
+          this.aiGet2(messages,_fileid)
 
           console.log(error);
         });
@@ -818,17 +844,18 @@ export default {
       if (this.current < this.workList.length - 1) {
         this.current++;
         this.DgUid = this.workList[this.current].userid;
-        this.selectSWorksData();
+        this.selectSWorksData2();
       } else {
         this.$message.info("已经是最后一位了");
       }
     },
     // 提交列表点击切换
-    cutPer(val) {
+    cutPer(val,index) {
       if (this.ScLoading) return this.$message.info("请稍后,正在ai评价中");
 
+      this.current = index;
       this.DgUid = val;
-      this.selectSWorksData();
+      this.selectSWorksData2();
     },
     // 任务得分折叠
     revealBtn() {
@@ -893,6 +920,8 @@ export default {
     selectSWorksData() {
       this.vLoading = true;
       this.textarea = "";
+      console.log(this.scoTitList);
+      
 
       let params = {
         uid: this.DgUid,
@@ -907,6 +936,7 @@ export default {
         .then(res => {
           let data = res.data[0];
 
+          // markSco为提交列表展示的分数
           data.forEach(e => {
             if (e.rate) {
               let data2 = JSON.parse(e.rate);
@@ -931,11 +961,15 @@ export default {
               e.markSco = null;
             }
           });
+          // 提交列表
           this.workList = data;
 
           data.forEach((e, index) => {
             if (e.userid == this.DgUid) {
               this.currentUid = e;
+              console.log('e',e);
+              
+              // 1截图  3问答 4word文档类型 5视频  10表格 13文档 
 
               if (
                 this.currentUid.type == 3 ||
@@ -960,7 +994,14 @@ export default {
               if (this.currentUid.type == 5) {
                 this.playerOptions.sources[0].src = this.currentUid.content;
               }
-              // this.current = index;
+              if (this.currentUid.type == 12) {
+                this.TxtMd = ''
+                getFile(this.currentUid.content).then(res=>{
+                  this.TxtMd = res.data;
+                })
+               
+              }
+              this.current = index;
               this.workId = e.id;
               this.appraise(e);
             }
@@ -984,6 +1025,116 @@ export default {
           this.vLoading = false;
         });
     },
+
+    selectSWorksData2() {
+      this.vLoading = true;
+      this.textarea = "";
+
+      let params = {
+        uid: this.DgUid,
+        cid: this.cid,
+        s: this.stage,
+        t: this.task,
+        g: this.toolIndex
+      };
+      // return console.log(params);
+      this.ajax
+        .get(this.$store.state.api + "selectMarkDialogWorks", params)
+        .then(res => {
+          let data = res.data[0];
+          console.log('data',data);
+          
+
+          // 计算markSco提交列表分数
+          data.forEach(e => {
+            if (e.rate) {
+              let data2 = JSON.parse(e.rate);
+
+              e.markSco = 0;
+              let k = 0
+
+              for (const key in data2) {
+                if (data2[key] && key != "content" || data2[key] == "0" ) {
+                  e.markSco += data2[key] * 1;
+                }else{
+                  k += 1
+                }
+              }
+              
+              if (k > 1) {
+                e.markSco = null;
+              }else{
+                e.markSco = (e.markSco / this.scoTitList.length).toFixed(1);
+              }
+            } else {
+              e.markSco = null;
+            }
+          });
+          // 提交列表
+          this.workList = data;
+
+
+          // 划分作业类型
+          data.forEach((e, index) => {
+            if (e.userid == this.DgUid) {
+              this.currentUid = e;
+              // 1截图  3问答 4word文档类型 5视频  10表格 13文档 
+              if (
+                this.currentUid.type == 3 ||
+                this.currentUid.type == 10 ||
+                this.currentUid.type == 13
+                // this.currentUid.type == 15
+              ) {
+                this.currentUid.content = JSON.parse(e.content);
+                this.cuScoCon = this.currentUid.content.text;
+              }
+              if (this.currentUid.type == 4) {
+                let a = this.currentUid.content;
+                let data = a.slice(a.lastIndexOf(".") + 1);
+
+                if (data == "pdf") {
+                  this.ifPdf = 1;
+                } else {
+                  this.ifPdf = 0;
+                }
+                this.cuScoCon = this.currentUid.content;
+
+              }
+              if (this.currentUid.type == 5) {
+                this.playerOptions.sources[0].src = this.currentUid.content;
+              }
+              if (this.currentUid.type == 12) {
+                this.TxtMd = ''
+                getFile(this.currentUid.content).then(res=>{
+                  this.TxtMd = res.data;
+                })
+               
+              }
+              
+              this.workId = e.id;
+              this.appraise(e);
+            }
+          });
+
+          let likeData = res.data[1];
+          this.likeList = [];
+          likeData.forEach(e => {
+            if (e.workId == this.workId) {
+              this.likeList.push(e);
+            }
+          });
+
+          let commentData = res.data[2];
+          this.commentList = [];
+          commentData.forEach(e => {
+            if (e.workId == this.workId) {
+              this.commentList.push(e);
+            }
+          });
+          this.vLoading = false;
+        });
+    },
+    
     downloadFile(url) {
       var credentials = {
         accessKeyId: "AKIATLPEDU37QV5CHLMH",
@@ -1033,22 +1184,15 @@ export default {
     // 处理任务的分展示
     appraise(val) {
       if (val.rate) {
-        // this.scoTitList = JSON.parse(JSON.stringify(this.scoTit));
-        // console.log("val.rate", val.rate);
-
+       
         let data = JSON.parse(val.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); // 如果字符串以句号结尾,则去除最后一个字符
-            // }
 
-            let result = e.value.match(/[\u4e00-\u9fa5a-zA-Z]+/g).join("");
+            let result = e.detail.match(/[\u4e00-\u9fa5a-zA-Z]+/g).join("");
             let key2 = key.match(/[\u4e00-\u9fa5a-zA-Z]+/g).join("");
 
-
-
             if (result.indexOf(key2) != -1) {
               e.cog = data[key];
             }
@@ -1103,7 +1247,7 @@ export default {
 .AreaCss >>> .el-textarea__inner {
   min-height: 150px !important;
   /* max-height: 150px; */
-  padding-bottom: 20px;
+  /* padding-bottom: 20px; */
 }
 .AreaBtn {
   position: absolute;
@@ -1187,8 +1331,6 @@ export default {
   margin: 10px 0;
   min-height: 60px;
   background-color: #f3f7fd;
-  margin-left: 17px;
-
 }
 .scoreStar2 {
   padding: 0 10px 10px;
@@ -1220,7 +1362,8 @@ export default {
   cursor: pointer;
   padding: 2px 8px;
   border-radius: 5px;
-  color: rgba(54, 129, 252, 1);
+  color: #fff;
+  background-color: rgba(54, 129, 252, 1);
   border: 1px rgba(54, 129, 252, 1) solid;
 }
 .worksAnswer {
@@ -1350,4 +1493,11 @@ export default {
 .video-player >>> .video-js {
   height: 100%;
 }
+.markBox{
+  padding: 20px 14px;
+  line-height: 29px;
+  font-size: 16px;
+  background: #f4f4f4;
+  border-radius: 5px;
+}
 </style>

+ 59 - 30
src/components/easy2/commpont/markScore.vue

@@ -26,11 +26,11 @@
               <el-tooltip
                 class="item"
                 effect="dark"
-                :content="e.value"
+                :content="e.detail"
                 placement="top"
               >
                 <div class="briefTit">
-                  {{ e.value }}
+                  {{ e.detail }}
                 </div>
               </el-tooltip>
               <el-rate
@@ -159,7 +159,7 @@ export default {
     // 获取单个数据
     getData() {
       // this.fileId =[]
-      // console.log(' this.scoCon', this.scoCon);
+      // console.log(' this.scoCon', this.scoTitList);
       
       let params = {
         uid: this.scoCon.userid,
@@ -190,7 +190,7 @@ export default {
                   // if (e.value.endsWith('。')) {
                   //   e.value = e.value.slice(0, -1); // 如果字符串以句号结尾,则去除最后一个字符
                   // }
-                  let result = e.value.match(/[\u4e00-\u9fa5a-zA-Z]+/g).join("");
+                  let result = e.detail.match(/[\u4e00-\u9fa5a-zA-Z]+/g).join("");
                   let key2 = key.match(/[\u4e00-\u9fa5a-zA-Z]+/g).join("");
 
                   if (result.indexOf(key2) != -1) {
@@ -214,8 +214,6 @@ export default {
         });
     },
     markScoreDigBtn() {
-      // console.log('11112222');
-
       this.$emit("markScoreDig", {
         val: this.stUid,
         val2: this.toolIndex,
@@ -227,14 +225,14 @@ export default {
     reset() {
       this.scoTitList.forEach(e => {
         e.cog = 0;
-        console.log(e.cog);
+        // console.log(e.cog);
       });
     },
 
     // 老师提交评分
     submit() {
       let data = this.scoTitList.map(e => {
-        return e.value + ":" + e.cog;
+        return e.detail + ":" + e.cog;
       });
       // console.log("data", data);
       const processedData = {};
@@ -321,7 +319,7 @@ export default {
     },
 
     // ai打分
-    aiGet2(messages, callback) {
+    aiGet2(messages) {
       // console.log(this.toolIndex, this.wIndex);
       let _this = this;
 
@@ -439,7 +437,6 @@ export default {
           }
           this.$forceUpdate();
 
-          callback ? callback() : "";
         })
         .catch(error => {
           // _this.markScoPopover = false;
@@ -458,7 +455,7 @@ export default {
 
 
     // ai循环评分
-    async aiupdetaSco(messages, uid, stage, task,_fileid, callback) {
+    async aiupdetaSco(messages, uid, stage, task,_fileid) {
       let _this = this;
       let params = {
         assistant_id: "6063369f-289a-11ef-8bf4-12e77c4cb76b",
@@ -473,12 +470,12 @@ export default {
         file_ids: _fileid ? [_fileid] : [],
         model: "gpt-4o-2024-08-06"
       };
-      return new Promise(resolve => {
+      return new Promise((resolve,reject) => {
         this.ajax
           .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", params)
-          .then(response => {
+          .then( response => {
             let data = response.data.FunctionResponse;
-            // console.log(data);
+            console.log(data);
 
             if (data.message) {
               let dArray = {};
@@ -505,6 +502,7 @@ export default {
                     dArray = JSON.parse(
                       data.message
                         .replaceAll("```json", "")
+                        .replaceAll("```javaScript", "")
                         .replaceAll("# Solution", "")
                         .replaceAll("```", "")
                         .replace(/\n/g, "")
@@ -525,18 +523,46 @@ export default {
                 processedData[key] = value;
               });
 
+              let IsAIsuccess = 0
+
+              for (const tKey in this.scoTitList) {
+                for (const key in processedData) {
+                  let result = this.scoTitList[tKey].detail.match(/[\u4e00-\u9fa5a-zA-Z]+/g).join("");
+                  let key2 = key.match(/[\u4e00-\u9fa5a-zA-Z]+/g).join("");
+                  if (key != "评语") {
+                  let isNumK = /^\d+(\.\d+)?$/.test(processedData[key]);
+
+                    if (result.indexOf(key2) != -1 && isNumK) {
+                      IsAIsuccess++
+                    }
+                    continue;
+                  }
+                }
+                continue;
+              }
+              let scotNum = 0
+              this.scoTitList.forEach(e=>{
+                if (e.isai == 1 || !e.isai) {
+                  scotNum++
+                }
+              })
+
+
+              if (IsAIsuccess != scotNum) {
+                console.log("评价失败");
+                _this.ScLoading = false;
+               return  _this.aiupdetaSco(messages, uid, stage, task,_fileid).then(_=>{
+                  resolve();
+                })
+              }
+
               for (const key in processedData) {
-                // if (!Number.isFinite(processedData[key] * 1)) {
-                //   processedData[key] = 0;
-                // }
                 if (key == "评语") {
                   processedData.content = processedData[key];
                 }
               }
               delete processedData["评语"];
 
-              // processedData.content = this.textarea;
-
               let params = {
                 cid: _this.id,
                 s: stage,
@@ -548,25 +574,28 @@ export default {
               _this.ajax
                 .get(_this.$store.state.api + "updateWorksEva", params)
                 .then(res => {
-                  resolve(1);
-                  _this.$message({
-                    message: "评价成功",
-                    type: "success"
-                  });
+                  console.log('999999999999999999999999999999999999999999999999999');
+                  
+                  return resolve(1);
+                  
                 })
                 .catch(err => {
-                  resolve(1);
-                  _this.$message.error("评价失败");
                   console.error(err);
+
+                  return _this.aiupdetaSco(messages, uid, stage, task,_fileid).then(_=>{
+                  resolve();
+                })
+
                 });
+                
             }
-            callback ? callback() : "";
           })
           .catch(error => {
-            resolve(1);
-            _this.$message.error("评价失败");
-            // _this.loading = false
             console.log(error);
+            
+            return _this.aiupdetaSco(messages, uid, stage, task,_fileid).then(_=>{
+                  resolve();
+                })
           });
       });
     },

+ 150 - 82
src/components/easy2/studyStudent.vue

@@ -2482,12 +2482,15 @@
                           展开
                         </div>
                       </div>
-                      <div  style="display: flex;" v-if="courseDetail.userid == userid && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && courseDetail.state == 5 && finalMarkList == toolIndex ">
+                      <div  style="display: flex;" v-if="courseDetail.userid == userid && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length && courseDetail.state == 5 && finalMarkList == toolIndex ">
                         <div  style="margin-right:10px" class="ScoreBtn"  @click="resetLoopEva(worksStudent[toolIndex],chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,courseType,taskCount,toolIndex,tool.toolDetail,worksStudent)" >
                           一键重置
                         </div>
-                      
-                        <div class="ScoreBtn" v-if="!loopLoading[toolIndex].loading" @click="loopEva(worksStudent[toolIndex],chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,courseType,taskCount,toolIndex,tool.toolDetail,worksStudent)" >
+                        <div class="ScoreBtn" @click="noIsAi" v-if="isaiNum" >
+                          <img src="../../assets/icon/newIcons/rootImg.png" alt="">
+                          AI评分
+                        </div>
+                        <div class="ScoreBtn" v-else-if="!loopLoading[toolIndex].loading" @click="loopEva(worksStudent[toolIndex],chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,courseType,taskCount,toolIndex,tool.toolDetail,worksStudent)" >
                           <img src="../../assets/icon/newIcons/rootImg.png" alt="">
                           AI评分
                         </div>
@@ -2809,10 +2812,12 @@
                           >
                             {{ JSON.parse(w.score).wScore }}分
                           </div>
+
+
                           <div
                             class="answerScore"
                             @click.stop="openScore(w)"
-                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && !chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList"
+                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length"
                             :class="{
                               rightW:
                                 w.userid == userid ||
@@ -2823,7 +2828,8 @@
                           >
                             评分
                           </div>
-                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5">
+
+                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length">
                             <div
                               v-if="finalMarkList != toolIndex"
                                 class="answerScore"
@@ -2883,7 +2889,7 @@
                               </span>    
                               </div>
                             </el-popover>
-                              </div>
+                          </div>
 
                           <img
                             class="deleteImg"
@@ -2915,7 +2921,7 @@
                           <div
                             class="answerScore"
                             @click.stop="openScore(w)"
-                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && !chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList"
+                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length"
                             :class="{
                               rightW:
                                 w.userid == userid ||
@@ -2926,7 +2932,8 @@
                           >
                             评分
                           </div>
-                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5">
+
+                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length">
                             <div
                               v-if="finalMarkList != toolIndex"
                                 class="answerScore"
@@ -3023,7 +3030,7 @@
                           <div
                             class="answerScore"
                             @click.stop="openScore(w)"
-                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && !chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList"
+                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length"
                             :class="{
                               rightW:
                                 w.userid == userid ||
@@ -3034,7 +3041,8 @@
                           >
                             评分
                           </div>
-                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5">
+
+                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length">
                             <div
                               v-if="finalMarkList != toolIndex"
                                 class="answerScore"
@@ -3131,7 +3139,7 @@
                           <div
                             class="answerScore"
                             @click.stop="openScore(w)"
-                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && !chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList"
+                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length"
                             :class="{
                               rightW:
                                 w.userid == userid ||
@@ -3142,7 +3150,8 @@
                           >
                             评分
                           </div>
-                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5">
+
+                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length">
                             <div
                               v-if="finalMarkList != toolIndex"
                                 class="answerScore"
@@ -3676,7 +3685,7 @@
                           <div
                             class="answerScore"
                             @click.stop="openScore(w)"
-                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && !chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList"
+                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length"
                             :class="{
                               rightW:
                                 w.userid == userid ||
@@ -3687,7 +3696,8 @@
                           >
                             评分
                           </div>
-                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5">
+
+                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length">
                             <div
                               v-if="finalMarkList != toolIndex"
                                 class="answerScore"
@@ -3841,12 +3851,16 @@
                         展开
                       </div>
                     </div>
-                    <div style="display: flex;" v-if="courseDetail.userid == userid && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && courseDetail.state == 5 && finalMarkList == toolIndex">
+                    <div style="display: flex;" v-if="courseDetail.userid == userid && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length && courseDetail.state == 5 && finalMarkList == toolIndex">
                       <div  style="margin-right:10px" class="ScoreBtn"  @click="resetLoopEva(worksStudent[toolIndex],chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,courseType,taskCount,toolIndex,tool.toolDetail,worksStudent)" >
                           一键重置
                       </div> 
                      
-                      <div  class="ScoreBtn" v-if="!loopLoading[toolIndex].loading" @click="loopEva(worksStudent[toolIndex],chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,courseType,taskCount,toolIndex,tool.toolDetail,worksStudent)" >
+                      <div class="ScoreBtn" @click="noIsAi" v-if="isaiNum" >
+                          <img src="../../assets/icon/newIcons/rootImg.png" alt="">
+                        AI评分
+                      </div>
+                      <div  class="ScoreBtn" v-else-if="!loopLoading[toolIndex].loading" @click="loopEva(worksStudent[toolIndex],chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,courseType,taskCount,toolIndex,tool.toolDetail,worksStudent)" >
                           <img src="../../assets/icon/newIcons/rootImg.png" alt="">
                           AI评分
                         </div>
@@ -3908,7 +3922,7 @@
                           <div
                             class="answerScore"
                             @click.stop="openScore(w)"
-                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && !chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList"
+                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length"
                             :class="{
                               rightW:
                                 w.userid == userid ||
@@ -3919,7 +3933,8 @@
                           >
                             评分
                           </div>
-                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5">
+
+                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length">
                             <div
                               v-if="finalMarkList != toolIndex"
                                 class="answerScore"
@@ -4015,7 +4030,7 @@
                           <div
                             class="answerScore"
                             @click.stop="openScore(w)"
-                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && !chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList"
+                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length"
                             :class="{
                               rightW:
                                 w.userid == userid ||
@@ -4026,7 +4041,8 @@
                           >
                             评分
                           </div>
-                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5">
+
+                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length">
                             <div
                               v-if="finalMarkList != toolIndex"
                                 class="answerScore"
@@ -4123,7 +4139,7 @@
                           <div
                             class="answerScore"
                             @click.stop="openScore(w)"
-                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && !chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList"
+                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length"
                             :class="{
                               rightW:
                                 w.userid == userid ||
@@ -4134,7 +4150,8 @@
                           >
                             评分
                           </div>
-                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5">
+
+                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length">
                             <div
                               v-if="finalMarkList != toolIndex"
                                 class="answerScore"
@@ -4834,7 +4851,7 @@
                                 <div
                                   class="answerScore"
                                   @click.stop="openScore(w)"
-                                  v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && !chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList"
+                                  v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length"
                                   :class="{
                                     rightW:
                                       w.userid == userid ||
@@ -4844,7 +4861,8 @@
                                 >
                                   评分
                                 </div>
-                                <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5">
+
+                                <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length">
                                   <div
                                     v-if="finalMarkList != toolIndex"
                                       class="answerScore"
@@ -5020,7 +5038,7 @@
                             <div
                               class="answerScore"
                               @click.stop="openScore(w)"
-                              v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && !chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList"
+                              v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length"
                               :class="{
                                 rightW:
                                   w.userid == userid ||
@@ -5031,7 +5049,7 @@
                               评分
                             </div>
 
-                            <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5">
+                            <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length">
                               <div
                               v-if="finalMarkList != toolIndex"
                                 class="answerScore"
@@ -5370,7 +5388,7 @@
                           <div
                             class="answerScore"
                             @click.stop="openScore(w)"
-                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && !chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList"
+                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length"
                             :class="{
                               rightW:
                                 w.userid == userid || tType == 1 || tType == 4,
@@ -5378,7 +5396,8 @@
                           >
                             评分
                           </div>
-                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5">
+
+                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length">
                             <div
                               v-if="finalMarkList != toolIndex"
                                 class="answerScore"
@@ -5718,7 +5737,7 @@
                           <div
                             class="answerScore"
                             @click.stop="openScore(w)"
-                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && !chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList"
+                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length"
                             :class="{
                               rightW:
                                 w.userid == userid || tType == 1 || tType == 4,
@@ -5726,7 +5745,8 @@
                           >
                             评分
                           </div>
-                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5">
+
+                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length">
                             <div
                               v-if="finalMarkList != toolIndex"
                                 class="answerScore"
@@ -6349,7 +6369,7 @@
                           <div
                             class="answerScore"
                             @click.stop="openScore(w)"
-                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && !chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList"
+                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length"
                             :class="{
                               rightW:
                                 w.userid == userid || tType == 1 || tType == 4,
@@ -6357,7 +6377,8 @@
                           >
                             评分
                           </div>
-                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5">
+
+                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length">
                             <div
                               v-if="finalMarkList != toolIndex"
                                 class="answerScore"
@@ -7174,12 +7195,15 @@
                           展开
                         </div>
                       </div>
-                      <div  style="display: flex;" v-if="courseDetail.userid == userid && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && courseDetail.state == 5 && finalMarkList == toolIndex">
+                      <div  style="display: flex;" v-if="courseDetail.userid == userid && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length && courseDetail.state == 5 && finalMarkList == toolIndex">
                         <div  style="margin-right:10px" class="ScoreBtn" @click="resetLoopEva(worksStudent[toolIndex],chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,courseType,taskCount,toolIndex,tool.toolDetail,worksStudent)" >
                           一键重置
                         </div>
-                        
-                        <div class="ScoreBtn" v-if="!loopLoading[toolIndex].loading" @click="loopEva(worksStudent[toolIndex],chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,courseType,taskCount,toolIndex,tool.toolDetail,worksStudent)" >
+                        <div class="ScoreBtn" @click="noIsAi" v-if="isaiNum" >
+                          <img src="../../assets/icon/newIcons/rootImg.png" alt="">
+                          AI评分
+                        </div>
+                        <div class="ScoreBtn" v-else-if="!loopLoading[toolIndex].loading" @click="loopEva(worksStudent[toolIndex],chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,courseType,taskCount,toolIndex,tool.toolDetail,worksStudent)" >
                           <img src="../../assets/icon/newIcons/rootImg.png" alt="">
                           AI评分
                         </div>
@@ -7236,7 +7260,7 @@
                           <div
                             class="answerScore"
                             @click.stop="openScore(w)"
-                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && !chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList"
+                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length"
                             :class="{
                               rightW:
                                 w.userid == userid ||
@@ -7247,7 +7271,8 @@
                           >
                             评分
                           </div>
-                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5">
+
+                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length">
                             <div
                               v-if="finalMarkList != toolIndex"
                                 class="answerScore"
@@ -7491,8 +7516,11 @@
                         <div @click="resetLoopEva(worksStudent[toolIndex],chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,courseType,taskCount,toolIndex,tool.toolDetail,worksStudent)"  style="margin-right:10px" class="ScoreBtn">
                           一键重置
                         </div>
-                        
-                        <div class="ScoreBtn" v-if="!loopLoading[toolIndex].loading" @click="loopEva(worksStudent[toolIndex],chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,courseType,taskCount,toolIndex,tool.toolDetail,worksStudent)" >
+                        <div class="ScoreBtn" @click="noIsAi" v-if="isaiNum" >
+                          <img src="../../assets/icon/newIcons/rootImg.png" alt="">
+                          AI评分
+                        </div>
+                        <div class="ScoreBtn" v-else-if="!loopLoading[toolIndex].loading" @click="loopEva(worksStudent[toolIndex],chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,courseType,taskCount,toolIndex,tool.toolDetail,worksStudent)" >
                           <img src="../../assets/icon/newIcons/rootImg.png" alt="">
                           AI评分
                         </div>
@@ -7549,7 +7577,7 @@
                           <div
                             class="answerScore"
                             @click.stop="openScore(w)"
-                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && !chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList"
+                            v-else-if="courseDetail.userid == userid && courseDetail.state != 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length"
                             :class="{
                               rightW:
                                 w.userid == userid ||
@@ -7560,7 +7588,8 @@
                           >
                             评分
                           </div>
-                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5">
+
+                          <div v-else-if="courseDetail.userid == userid && courseDetail.state == 5 && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList.length">
                             <!-- <div
                                 class="answerScore"
                                 @click="markScoreDig(w.userid,toolIndex)"
@@ -7645,7 +7674,7 @@
                             v-if="
                               w.userid == userid || tType == 1 || tType == 4
                             "
-                            @click.stop="deleteWorksTwo(w.wid,toolIndex,wIndex)"
+                            @click.stop="deleteWorks(w.wid)"
                             alt
                           />
                         </div>
@@ -8827,7 +8856,7 @@
                     stripe
                     style="width: 100%"
                   >
-                  <el-table-column width="150" label="目标" align="center">
+                  <el-table-column :width="courseDetail.state == 5? '230': '150'" label="目标" align="center">
                       <template slot-scope="scope"
                         >
                         <div style="display:flex;justify-content: center;align-items: center;">
@@ -8859,13 +8888,15 @@
                     <el-table-column
                       label="评价维度"
                       align="center"
+                      v-if="courseDetail.state != 5"
+
                     >
                       <template slot-scope="scope"
                         ><div>{{ scope.row.value }}</div></template
                       >
                     </el-table-column>
                     <el-table-column
-                      label="维度描述"
+                      :label="courseDetail.state == 5? '评价标准' : '维度描述'"
                       align="center"
                     >
                       <template slot-scope="scope"
@@ -13500,7 +13531,8 @@ export default {
       markfullscreen:false,
       xianObj: ["DOCX", "MD", "TXT", "PDF"],
       markScoreworksStudent:[],
-      finalMarkList:-1
+      finalMarkList : -1,
+      isaiNum : 0
     };
   },
   methods: {
@@ -13646,13 +13678,14 @@ export default {
       let laws = ""
       for (let i = 0; i < tit.length; i++) {
         if(tit[i].isai == 1){
-          let a = tit[i].value
+          let a = tit[i].detail
           let result = a.match(/[\u4e00-\u9fa5a-zA-Z]+/g).join("");
 
           laws += `评价维度:“${result}”, 评价细则:${tit[i].rule} \n`;
         }
       }
 
+      let forAllList = []
        for (let i = 0; i < con.length; i++) {
         let _fileid = ''
         let wok = con[i].works
@@ -13694,24 +13727,34 @@ export default {
         `
        
         let mk = `markSco${toolIndex}${i}`
-        await this.$refs[mk][0].aiupdetaSco(msg,con[i].userid,stage,task,_fileid)
+        let mkAwit = this.$refs[mk][0].aiupdetaSco(msg,con[i].userid,stage,task,_fileid) 
        
+        forAllList.push(mkAwit)
 
-        // this.refreshKey++
-        this.$refs[mk][0].getData()
+        // this.$refs[mk][0].getData()
 
-        this.AIloading[toolIndex][i].loading=false
+        // this.AIloading[toolIndex][i].loading=false
       }
-      this.loopLoading[toolIndex].loading = false;
+     
+      Promise.all(forAllList).then(values=>{
+        console.log('values',values)
+        this.$message({
+          message: "评价成功",
+          type: "success"
+        });
+        
+        this.refreshKey++
 
-      worksStudent.forEach((e,index)=>{
-          if(toolIndex != index){
-            e.forEach((i,inx)=>{
-              let mk = `markSco${index}${inx}`
-              this.$refs[mk][0].getData()
-            })
-          }
+        this.AIloading[toolIndex].forEach(e=>{
+          e.loading =false
         })
+        this.loopLoading[toolIndex].loading = false;
+
+      }).catch(reason=>{
+          console.error('reasonreasonreasonreasonreason',reason);
+          // 输出“失败原因”
+      })
+      
     },
     againEva(i,k){
 
@@ -15862,13 +15905,12 @@ export default {
         .catch(() => {});
     },
 
-    deleteWorksTwo(id,toolIndex,wIndex) {
-      console.log(id)
-      let mk = `markSco${toolIndex}${wIndex}`
-      console.log(this.$refs[mk][0].homeworkVal)
+    deleteWorksTwo(w,stage,task) {
+      // let mk = `markSco${toolIndex}${wIndex}`
+      // console.log(this.$refs[mk][0].homeworkVal)
 
-      let wid = this.$refs[mk][0].homeworkVal.id
-      console.log('wid',wid);
+      // let wid = this.$refs[mk][0].homeworkVal.id
+      // console.log('wid',wid);
       
       this.$confirm("确定删除此作业吗?", "提示", {
         confirmButtonText: "确定",
@@ -15878,13 +15920,16 @@ export default {
         .then(() => {
           let params = [
             {
-              id: id,
-              wid: wid ? wid : 1
+              id: w.wid,
+              cid: this.id,
+              uid:w.userid,
+              s:stage,
+              t:task
             },
           ];
           // return console.log(params)
           this.ajax
-            .post(this.$store.state.api + "deleteCourseWorkTwo", params)
+            .post(this.$store.state.api + "deleteCourseWorkTwo2", params)
             .then((res) => {
               this.$message({
                 message: "删除成功",
@@ -15901,6 +15946,9 @@ export default {
         })
         .catch(() => {});
     },
+    noIsAi(){
+      this.$message.info('您的评价维度未设置ai评分')
+    },
     selectSWorks(gindex) {
       //教师查看全部作业
       let params = {
@@ -18278,15 +18326,16 @@ export default {
           }
           // console.log('this.chapInfoList22222',JS);
 
+          // finalMarkList用来判断哪个工具为评分工具
           if(this.courseDetail.state == 5){
             let chapInfoListCopy = this.chapInfoList[0].chapterInfo[0].taskJson;
 
             let chap = chapInfoListCopy[this.taskCount].toolChoose
-            console.log('chap',chap)
 
             let adc = chap.filter(e=>{return (e.tool[0]==16 || e.tool[0]==52)})
-            console.log('adc',adc)
 
+            // adc判断又没有作业提交或者文档工具,有的话他们两个的最后一个优先为评分工具,
+            // 没有的话在选其他工具为评分工具
             if(adc.length > 0){
               for (let k = chap.length - 1; k >= 0; k--) {
                 if (chap[k].tool[0] == 16 || chap[k].tool[0] == 52) {
@@ -18303,23 +18352,38 @@ export default {
               }
             }
 
-            // for (let k = chap.length - 1; k >= 0; k--) {
-            //   if (chap[k].tool[0] == 16 || chap[k].tool[0] == 52) {
-            //     this.finalMarkList = k;
-            //     break;
-            //   }
-            //   if (chap[k].tool[0] == 7 || chap[k].tool[0] == 50  || chap[k].tool[0] == 1 || chap[k].tool[0] == 3 || chap[k].tool[0] == 48 || chap[k].tool[0] == 15 || chap[k] == 57) {
-            //     this.finalMarkList = k;
-            //     break;
-            //   }
-            // }
-            console.log('finalMarkList',this.finalMarkList)
+
+            // 来判断ai评分是否可用,因为有的评分教师全选的人工打分,所以全是人工打分的话,ai评分就不能使用
+            // 不然会无限循环报错,会很难受
+              let aiSNum = 0
+              chapInfoListCopy[this.taskCount].eList.forEach(e=>{
+                if (e.isai == 2) {
+                  aiSNum++
+                }
+              })
+              if(aiSNum ==  chapInfoListCopy[this.taskCount].eList.length){
+                this.isaiNum = aiSNum
+              }else{
+                this.isaiNum = 0
+              }
+
+
+
+            // console.log('finalMarkList',this.finalMarkList)
+
+
+
+
 
             for (let k = 0; k < chapInfoListCopy[this.taskCount].eList.length; k++) {
               if(!chapInfoListCopy[this.taskCount].eList[k].rule){
                 this.againEva(this.taskCount,k)
               }
             }
+
+
+
+
           }
 
           //  else {
@@ -25079,7 +25143,8 @@ ol {
 .isChooseCard,
 .noCard,
 .isCard1 {
-  width: 130px;
+  min-width: 130px;
+  width: auto;
   height: 60px;
   text-align: center;
   line-height: 60px;
@@ -25089,6 +25154,9 @@ ol {
   background-size: cover;
   transition: all 2s;
   margin-right: 20px;
+  background-size: 100% 100%;
+  padding: 0 20px;
+  box-sizing: border-box;
 }
 
 .isCard > div,
@@ -25097,7 +25165,7 @@ ol {
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
-  width: 75%;
+  width: 100%;
   margin: 0 auto;
 }
 

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

@@ -23516,7 +23516,8 @@ ol {
 .isChooseCard,
 .noCard,
 .isCard1 {
-  width: 130px;
+  min-width: 130px;
+  width: auto;
   height: 60px;
   text-align: center;
   line-height: 60px;
@@ -23526,6 +23527,9 @@ ol {
   background-size: cover;
   transition: all 2s;
   margin-right: 20px;
+  background-size: 100% 100%;
+  padding: 0 20px;
+  box-sizing: border-box;
 }
 
 .isCard > div,
@@ -23534,7 +23538,7 @@ ol {
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
-  width: 75%;
+  width: 100%;
   margin: 0 auto;
 }
 

+ 6 - 2
src/components/student/studyStudent.vue

@@ -7055,7 +7055,8 @@ ol {
 .isChooseCard,
 .noCard,
 .isCard1 {
-  width: 130px;
+  min-width: 130px;
+  width: auto;
   height: 60px;
   text-align: center;
   line-height: 60px;
@@ -7065,6 +7066,9 @@ ol {
   background-size: cover;
   transition: all 2s;
   margin-right: 20px;
+  background-size: 100% 100%;
+  padding: 0 20px;
+  box-sizing: border-box;
 }
 
 .isCard > div,
@@ -7073,7 +7077,7 @@ ol {
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
-  width: 75%;
+  width: 100%;
   margin: 0 auto;
 }
 

+ 6 - 2
src/components/studyStudent.vue

@@ -23491,7 +23491,8 @@ ol {
 .isChooseCard,
 .noCard,
 .isCard1 {
-  width: 130px;
+  min-width: 130px;
+  width: auto;
   height: 60px;
   text-align: center;
   line-height: 60px;
@@ -23501,6 +23502,9 @@ ol {
   background-size: cover;
   transition: all 2s;
   margin-right: 20px;
+  background-size: 100% 100%;
+  padding: 0 20px;
+  box-sizing: border-box;
 }
 
 .isCard > div,
@@ -23509,7 +23513,7 @@ ol {
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
-  width: 75%;
+  width: 100%;
   margin: 0 auto;
 }
 

+ 6 - 2
src/components/trainCourse/easy2/studyStudent.vue

@@ -22692,7 +22692,8 @@ ol {
 .isChooseCard,
 .noCard,
 .isCard1 {
-  width: 130px;
+  min-width: 130px;
+  width: auto;
   height: 60px;
   text-align: center;
   line-height: 60px;
@@ -22702,6 +22703,9 @@ ol {
   background-size: cover;
   transition: all 2s;
   margin-right: 20px;
+  background-size: 100% 100%;
+  padding: 0 20px;
+  box-sizing: border-box;
 }
 
 .isCard > div,
@@ -22710,7 +22714,7 @@ ol {
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
-  width: 75%;
+  width: 100%;
   margin: 0 auto;
 }
 

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

@@ -22684,7 +22684,8 @@ ol {
 .isChooseCard,
 .noCard,
 .isCard1 {
-  width: 130px;
+  min-width: 130px;
+  width: auto;
   height: 60px;
   text-align: center;
   line-height: 60px;
@@ -22694,6 +22695,9 @@ ol {
   background-size: cover;
   transition: all 2s;
   margin-right: 20px;
+  background-size: 100% 100%;
+  padding: 0 20px;
+  box-sizing: border-box;
 }
 
 .isCard > div,
@@ -22702,7 +22706,7 @@ ol {
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
-  width: 75%;
+  width: 100%;
   margin: 0 auto;
 }
 

+ 6 - 2
src/components/trainCourse/studyStudent.vue

@@ -22659,7 +22659,8 @@ ol {
 .isChooseCard,
 .noCard,
 .isCard1 {
-  width: 130px;
+  min-width: 130px;
+  width: auto;
   height: 60px;
   text-align: center;
   line-height: 60px;
@@ -22669,6 +22670,9 @@ ol {
   background-size: cover;
   transition: all 2s;
   margin-right: 20px;
+  background-size: 100% 100%;
+  padding: 0 20px;
+  box-sizing: border-box;
 }
 
 .isCard > div,
@@ -22677,7 +22681,7 @@ ol {
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
-  width: 75%;
+  width: 100%;
   margin: 0 auto;
 }
 

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