11wqe1 6 months ago
parent
commit
04949df508

+ 77 - 18
src/components/courseDetail.vue

@@ -1503,24 +1503,83 @@ export default {
               );
             }
           } else if (this.tType == 2) {
-            this.goTo(
-              "/studyStudent?type=" +
-                i +
-                "&courseId=" +
-                this.id +
-                "&userid=" +
-                this.userid +
-                "&oid=" +
-                this.oid +
-                "&org=" +
-                this.org +
-                "&cid=" +
-                this.classId +
-                "&tType=" +
-                this.tType +
-                "&screenType=" +
-                this.screenType
-            );
+            // this.goTo(
+            //   "/studyStudent?type=" +
+            //     i +
+            //     "&courseId=" +
+            //     this.id +
+            //     "&userid=" +
+            //     this.userid +
+            //     "&oid=" +
+            //     this.oid +
+            //     "&org=" +
+            //     this.org +
+            //     "&cid=" +
+            //     this.classId +
+            //     "&tType=" +
+            //     this.tType +
+            //     "&screenType=" +
+            //     this.screenType
+            // );
+
+            if (this.courseDetail.state == 1) {
+              this.goTo(
+                "/studyStudent?type=" +
+                  i +
+                  "&courseId=" +
+                  this.id +
+                  "&userid=" +
+                  this.userid +
+                  "&oid=" +
+                  this.oid +
+                  "&org=" +
+                  this.org +
+                  "&cid=" +
+                  this.classId +
+                  "&tType=" +
+                  this.tType +
+                  "&screenType=" +
+                  this.screenType
+              );
+            } else if (this.courseDetail.state == 2 || this.courseDetail.state == 5) {
+              this.goTo(
+                "/studystudentE2?type=" +
+                  i +
+                  "&courseId=" +
+                  this.id +
+                  "&userid=" +
+                  this.userid +
+                  "&oid=" +
+                  this.oid +
+                  "&org=" +
+                  this.org +
+                  "&cid=" +
+                  this.classId +
+                  "&tType=" +
+                  this.tType +
+                  "&screenType=" +
+                  this.screenType
+              );
+            } else if (this.courseDetail.state == 3 || this.courseDetail.state == 4) {
+              this.goTo(
+                "/studystudentE3?type=" +
+                  i +
+                  "&courseId=" +
+                  this.id +
+                  "&userid=" +
+                  this.userid +
+                  "&oid=" +
+                  this.oid +
+                  "&org=" +
+                  this.org +
+                  "&cid=" +
+                  this.classId +
+                  "&tType=" +
+                  this.tType +
+                  "&screenType=" +
+                  this.screenType
+              );
+            }
             // this.gotoCourse(this.classId);
           } else {
             this.goTo(

+ 26 - 16
src/components/easy2/commpont/markDialog.vue

@@ -280,19 +280,9 @@
             ></iframe>
           </div>
           <div v-if="currentUid.type == 12" style="height: 100%;">
-            <!-- <div style="margin-bottom: 10px;">
-              <div
-                style="cursor: pointer;"
-                @click="downloadFile(currentUid.content)"
-              >
-                下载文件
-              </div>
-            </div> -->
-            <div>{{ TxtMd }}</div>
-            <!-- <div
-              v-html="htmlContent(currentUid.content)"
-            ></div> -->
             
+            <div>{{ TxtMd }}</div>
+           
           </div>
           <div v-if="currentUid.type == 15" style="height: 100%;">
             <div
@@ -535,7 +525,7 @@ export default {
   },
   methods: {
     noIsAi(){
-      this.$message.info('您的评价维度未设置ai评分')
+      this.$message.info('您暂未设置AI评分,请修改该工具的评价设置后使用。')
     },
     // 预览图片
     previewImg(url) {
@@ -783,20 +773,40 @@ export default {
               return
             }
 
+            // for (const key in processedData) {
+            //   if (key == "评语") {
+            //     processedData.content = processedData[key];
+            //   }
+            // }
+            // delete processedData["评语"];
+
+            let processedDataCopy = {}
+            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 (result.indexOf(key2) != -1) {
+                  let aaa = _this.scoTitList[tKey].detail
+                  processedDataCopy[aaa] = processedData[key]
+                }
+              }
+            }
             for (const key in processedData) {
               if (key == "评语") {
-                processedData.content = processedData[key];
+                processedDataCopy.content = processedData[key];
               }
             }
-            delete processedData["评语"];
 
             let params = {
               cid: _this.cid,
               s: _this.stage,
               t: _this.task,
-              rate: JSON.stringify(processedData),
+              rate: JSON.stringify(processedDataCopy),
               uid: _this.DgUid
             };
+            // console.log('params',params);
+            
+            // return  _this.ScLoading = false;
             _this.ajax
               .get(_this.$store.state.api + "updateWorksEva", params)
               .then(res => {

+ 17 - 11
src/components/easy2/commpont/markScore.vue

@@ -502,7 +502,7 @@ export default {
                     dArray = JSON.parse(
                       data.message
                         .replaceAll("```json", "")
-                        .replaceAll("```javaScript", "")
+                        .replaceAll("```javascript", "")
                         .replaceAll("# Solution", "")
                         .replaceAll("```", "")
                         .replace(/\n/g, "")
@@ -525,14 +525,15 @@ export default {
 
               let IsAIsuccess = 0
 
-              for (const tKey in this.scoTitList) {
-                for (const key in processedData) {
+              for (let tKey in this.scoTitList) {
+                for (let 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) {
+                      key = this.scoTitList[tKey].detail
                       IsAIsuccess++
                     }
                     continue;
@@ -546,8 +547,6 @@ export default {
                   scotNum++
                 }
               })
-
-
               if (IsAIsuccess != scotNum) {
                 console.log("评价失败");
                 _this.ScLoading = false;
@@ -555,19 +554,27 @@ export default {
                   resolve();
                 })
               }
-
+              let processedDataCopy = {}
+              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 (result.indexOf(key2) != -1) {
+                    let aaa = _this.scoTitList[tKey].detail
+                    processedDataCopy[aaa] = processedData[key]
+                  }
+                }
+              }
               for (const key in processedData) {
                 if (key == "评语") {
-                  processedData.content = processedData[key];
+                  processedDataCopy.content = processedData[key];
                 }
               }
-              delete processedData["评语"];
-
               let params = {
                 cid: _this.id,
                 s: stage,
                 t: task,
-                rate: JSON.stringify(processedData),
+                rate: JSON.stringify(processedDataCopy),
                 uid: uid
               };
               // console.log("params", params);
@@ -581,7 +588,6 @@ export default {
                 })
                 .catch(err => {
                   console.error(err);
-
                   return _this.aiupdetaSco(messages, uid, stage, task,_fileid).then(_=>{
                   resolve();
                 })

+ 99 - 42
src/components/easy2/studyStudent.vue

@@ -13034,6 +13034,30 @@
         :markScoreVisible="markScoreVisible"
       ></markDialog>
     </el-dialog>
+
+
+    <!-- 查看Txt,md等文件 -->
+    <el-dialog
+      title="文件预览"
+      :visible.sync="dialogVisibleTxt"
+      width="50%"
+      :before-close="handleCloseTxt"
+      class="dialog_diy"
+      :class="{ fullStyle: full }"
+    >
+      <div slot="title" class="header-title">
+        <div style="color: #fff">文件预览</div>
+        <div style="position: absolute; top: 19px; right: 50px">
+          <img
+            src="../../assets/full.png"
+            style="height: 16px; cursor: pointer"
+            alt=""
+            @click="fullTools"
+          />
+        </div>
+      </div>
+      <div>{{TxtMd}}</div>
+    </el-dialog>
   </div>
 </template>
 
@@ -13532,7 +13556,9 @@ export default {
       xianObj: ["DOCX", "MD", "TXT", "PDF"],
       markScoreworksStudent:[],
       finalMarkList : -1,
-      isaiNum : 0
+      isaiNum : 0,
+      dialogVisibleTxt:false,
+      TxtMd :''
     };
   },
   methods: {
@@ -13549,6 +13575,7 @@ export default {
 			})
 		},
 
+    // 评分弹框全屏
     markFullScreenBtn(){
       this.markfullscreen = !this.markfullscreen
     },
@@ -13574,7 +13601,7 @@ export default {
 				console.log(e)
 			})
 		},
-            // 获取文档id
+    // 获取文档id
     createFileid(url) {
       let _this = this;
       return new Promise((resolve, reject) => {
@@ -13599,6 +13626,7 @@ export default {
         }
       });
     },
+    // 一键重置 
     resetLoopEva(con,tit,stage,task,toolIndex,toolDetail,worksStudent){
       let jude = false
       this.AIloading.forEach((e,index)=>{
@@ -13618,6 +13646,7 @@ export default {
       .catch(_ => {});
 
     },
+    // 一键重置
     async allEmptyScoBtn(con,stage,task){
       for (let index = 0; index < con.length; index++) {
         await this.allEmptySco(con[index].userid,stage,task)
@@ -13626,6 +13655,7 @@ export default {
       this.$message.success('重置完成')
       this.refreshAssembly();
     },
+    // 一键重置
     allEmptySco(uid,stage,task){
       let params = [{
         cid: this.id,
@@ -13646,6 +13676,9 @@ export default {
         console.log(error);
       });
     },
+
+    
+    // AI评分循环打分
     async loopEva(con,tit,stage,task,toolIndex,toolDetail,worksStudent){
        
         tit.forEach((e,index)=>{
@@ -13756,6 +13789,7 @@ export default {
       })
       
     },
+    // 获取评价细则
     againEva(i,k){
 
       let msg = `NOTICE
@@ -13856,10 +13890,25 @@ export default {
           });
 
     },
+    // 关闭评分弹框
     markScorehandleClose(done) {
       this.refreshKey++
       done();
     },
+    // 关闭txtMd预览弹框
+    handleCloseTxt(done){
+      this.TxtMd = ''
+      done();
+    },
+    // Txt,Md作业查看
+    lookTxt(val){
+      console.log(val);
+      this.dialogVisibleTxt =true
+      this.TxtMd = ''
+      getFile(val).then(res=>{
+        this.TxtMd = res.data;
+      })
+    },
     // 组件刷新
     refreshAssembly(val){
       this.refreshKey++
@@ -15905,49 +15954,49 @@ export default {
         .catch(() => {});
     },
 
-    deleteWorksTwo(w,stage,task) {
-      // 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: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          let params = [
-            {
-              id: w.wid,
-              cid: this.id,
-              uid:w.userid,
-              s:stage,
-              t:task
-            },
-          ];
-          // return console.log(params)
-          this.ajax
-            .post(this.$store.state.api + "deleteCourseWorkTwo2", params)
-            .then((res) => {
-              this.$message({
-                message: "删除成功",
-                type: "success",
-              });
-              this.selectStudent();
-              this.selectSWorks();
-              this.selectSLook();
-            })
-            .catch((err) => {
-              this.$message.error("网络异常");
-              console.error(err);
-            });
-        })
-        .catch(() => {});
-    },
+    //   this.$confirm("确定删除此作业吗?", "提示", {
+    //     confirmButtonText: "确定",
+    //     cancelButtonText: "取消",
+    //     type: "warning",
+    //   })
+    //     .then(() => {
+    //       let params = [
+    //         {
+    //           id: w.wid,
+    //           cid: this.id,
+    //           uid:w.userid,
+    //           s:stage,
+    //           t:task
+    //         },
+    //       ];
+    //       // return console.log(params)
+    //       this.ajax
+    //         .post(this.$store.state.api + "deleteCourseWorkTwo2", params)
+    //         .then((res) => {
+    //           this.$message({
+    //             message: "删除成功",
+    //             type: "success",
+    //           });
+    //           this.selectStudent();
+    //           this.selectSWorks();
+    //           this.selectSLook();
+    //         })
+    //         .catch((err) => {
+    //           this.$message.error("网络异常");
+    //           console.error(err);
+    //         });
+    //     })
+    //     .catch(() => {});
+    // },
     noIsAi(){
-      this.$message.info('您的评价维度未设置ai评分')
+      this.$message.info('您暂未设置AI评分,请修改该工具的评价设置后使用。')
     },
     selectSWorks(gindex) {
       //教师查看全部作业
@@ -20652,6 +20701,14 @@ export default {
       x.send();
     },
     downloadFile(url) {
+      let hz = url.substring(url.lastIndexOf(".") + 1);
+
+      if(hz == "txt" || hz == "md"){
+        this.lookTxt(url)
+        return
+      }
+      
+
       var credentials = {
         accessKeyId: "AKIATLPEDU37QV5CHLMH",
         secretAccessKey: "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",