zengyicheng 1 rok temu
rodzic
commit
b2cd5385b3

BIN
src/assets/icon/conSentences/right.png


BIN
src/assets/icon/conSentences/stuBg.png


BIN
src/assets/icon/conSentences/wrong.png


+ 236 - 196
src/components/pages/components/classStudentComponents/worksDetail3.vue

@@ -980,9 +980,19 @@ export default {
         cid: this.cid,
       };
       this.ajax
-        .get(this.$store.state.api + "selectWorksDetail3", params)
+        .get(this.$store.state.api + "selectAllWorksDetail", params)
         .then((res) => {
-          this.sInfo = res.data[0];
+          var b = res.data[0].reduce((result, item) => {
+            const key = item.stage + "-" + item.task;
+            if (!result[key]) {
+              result[key] = item;
+            }
+            return result;
+          }, {});
+
+          // 将结果转换为数组形式
+          b = Object.values(b);
+          this.sInfo = b;
           var chapters = [],
             eList = [],
             _ooption = [],
@@ -995,11 +1005,39 @@ export default {
           var answerInfo = res.data[4];
           var pptInfo = res.data[5];
           var chooseInfo = res.data[6];
+          var pjInfo = res.data[7]; //个人评价作业
+          var xztkInfo = res.data[8]; //选择填空作业
+          var lccjInfo = res.data[9]; //连词成句作业
+          var bgInfo = res.data[10]; //表格作业
+          var cocopiInfo = res.data[11]; //cocopi或源码编辑作业
+          var wordInfo = res.data[12]; //文档作业
           var workJson = [];
           for (var k = 0; k < res.data[0].length; k++) {
             this.allWorks = res.data[0][k];
-            this.chapInfo.push(JSON.parse(res.data[0][k].chapters));
-            chapters.push(JSON.parse(res.data[0][k].chapters));
+            if (this.chapInfo.length == 0) {
+              this.chapInfo.push(JSON.parse(res.data[0][k].chapters));
+            } else {
+              for (var i = 0; i < this.chapInfo.length; i++) {
+                if (
+                  JSON.stringify(res.data[0][k].chapters) ===
+                  JSON.stringify(this.chapInfo[i])
+                ) {
+                  continue;
+                }
+              }
+            }
+            if (chapters.length == 0) {
+              chapters.push(JSON.parse(res.data[0][k].chapters));
+            } else {
+              for (var i = 0; i < chapters.length; i++) {
+                if (
+                  JSON.stringify(res.data[0][k].chapters) ===
+                  JSON.stringify(chapters[i])
+                ) {
+                  continue;
+                }
+              }
+            }
             if (
               !chapters[0][res.data[0][k].stage].chapterInfo[0].taskJson[
                 res.data[0][k].task
@@ -1007,7 +1045,6 @@ export default {
             ) {
               continue;
             }
-
             workJson.push({
               img: [],
               imgIndex: 0,
@@ -1015,74 +1052,23 @@ export default {
               rateList: {},
               askInfo: [],
               answerInfo: [],
-              chooseInfo: [],
               wpptInfo: [],
+              chooseInfo: [],
+              pjInfo: [],
+              xztkInfo: [],
+              lccjInfo: [],
+              bgInfo: [],
+              cocopiInfo: [],
+              wordInfo: [],
               scopeId: res.data[0][k].id,
               stagetask: "",
               time: "",
             });
             this.checkJson[k] = {};
-            // this.allWorks = res.data[0][k];
-            // this.chapInfo.push(JSON.parse(res.data[0][k].chapters));
-            // chapters.push(JSON.parse(res.data[0][k].chapters));
-            eList =
-              chapters[0][res.data[0][k].stage].chapterInfo[0].taskJson[
-                res.data[0][k].task
-              ].eList;
+
             workJson[k].time = res.data[0][k].time;
             workJson[k].stagetask =
               res.data[0][k].stage + "-" + res.data[0][k].task;
-            if (eList && eList.length > 0) {
-              _ooption = [];
-              workJson[k].eList = eList;
-              for (var i = 0; i < eList.length; i++) {
-                _ooption.push({ value: 0, name: eList[i].value });
-                workJson[k].rateList[eList[i].value] = 0;
-              }
-              workJson[k].rateList.content = "";
-              this.ooption[k] = _ooption;
-            }
-            //  else {
-            //   _ooption = [];
-            //   workJson[k].eList = [
-            //     { value: "意识能力", detail: "", score: 5 },
-            //     { value: "科学探究能力", detail: "", score: 5 },
-            //     { value: "实践创新能力", detail: "", score: 5 },
-            //     { value: "学习反思能力", detail: "", score: 5 },
-            //     { value: "工程思维能力", detail: "", score: 5 },
-            //   ];
-            //   for (var i = 0; i < workJson[k].eList.length; i++) {
-            //     _ooption.push({ value: 0, name: workJson[k].eList[i].value });
-            //     workJson[k].rateList[workJson[k].eList[i].value] = 0;
-            //   }
-            //   workJson[k].rateList.content = "";
-            //   this.ooption[k] = [
-            //     { value: 0, name: "意识能力" },
-            //     { value: 0, name: "科学探究能力" },
-            //     { value: 0, name: "实践创新能力" },
-            //     { value: 0, name: "学习反思能力" },
-            //     { value: 0, name: "工程思维能力" },
-            //   ];
-            // }
-            if (res.data[0][k].rate && eList && eList.length > 0) {
-              _rate[k] = JSON.parse(res.data[0][k].rate);
-              _rateList[k] = Object.keys(JSON.parse(res.data[0][k].rate));
-              for (var i = 0; i < _rateList[k].length; i++) {
-                var _c = Object.keys(workJson[k].rateList);
-                if (_c.indexOf(_rateList[k][i]) != -1) {
-                  workJson[k].rateList[_rateList[k][i]] =
-                    _rate[k][_rateList[k][i]];
-                }
-              }
-              for (var i = 0; i < this.ooption[k].length; i++) {
-                if (_rateList[k].indexOf(this.ooption[k][i].name) != -1) {
-                  this.ooption[k][i].value = _rate[k][this.ooption[k][i].name];
-                }
-              }
-            } else {
-              _rate[k] = [];
-              _rateList[k] = [];
-            }
 
             for (var i = 0; i < worksDetail.length; i++) {
               if (
@@ -1117,11 +1103,6 @@ export default {
                       checkCount: [],
                       checkPerson: [],
                     };
-                    // this.checkJson[k].push({
-                    //   checkCount: [],
-                    //   checkPerson: [],
-                    //   rightPerson: [],
-                    // });
                   }
                   if (!this.checkJson[k][p].checkCount.length) {
                     this.checkJson[k][p].checkCount = [];
@@ -1136,9 +1117,6 @@ export default {
                         .sort()
                         .join(",") == a.radio[p].sort().join(",")
                     ) {
-                      // this.checkJson[k][p].rightPerson.push(
-                      //   res.data[0][k].sName
-                      // );
                       this.checkJson[k][p].right = 100;
                       isCount += this.checkJson[k][p].right;
                     } else {
@@ -1165,9 +1143,6 @@ export default {
                     if (
                       workJson[k].askInfo[0].askJson[p].answer == a.radio[p]
                     ) {
-                      // this.checkJson[k][p].rightPerson.push(
-                      //   res.data[0][k].sName
-                      // );
                       this.checkJson[k][p].right = 100;
                       isCount += this.checkJson[k][p].right;
                     } else {
@@ -1220,11 +1195,6 @@ export default {
                       checkCount: [],
                       checkPerson: [],
                     };
-                    // this.checkJson[k].push({
-                    //   checkCount: [],
-                    //   checkPerson: [],
-                    //   rightPerson: [],
-                    // });
                   }
                   if (!this.checkJson[k][p].checkCount.length) {
                     this.checkJson[k][p].checkCount = [];
@@ -1239,9 +1209,6 @@ export default {
                         .sort()
                         .join(",") == t.radio[p].sort().join(",")
                     ) {
-                      // this.checkJson[k][p].rightPerson.push(
-                      //   res.data[0][k].sName
-                      // );
                       this.checkJson[k][p].right = 100;
                       isCount += this.checkJson[k][p].right;
                     } else {
@@ -1268,9 +1235,6 @@ export default {
                     if (
                       workJson[k].chooseInfo[0].testJson[p].answer == t.radio[p]
                     ) {
-                      // this.checkJson[k][p].rightPerson.push(
-                      //   res.data[0][k].sName
-                      // );
                       this.checkJson[k][p].right = 100;
                       isCount += this.checkJson[k][p].right;
                     } else {
@@ -1298,7 +1262,6 @@ export default {
                 this.checkJson[k].allRight = isCount / t.radio.length;
               }
             }
-
             for (var i = 0; i < pptInfo.length; i++) {
               if (
                 res.data[0][k].stage == pptInfo[i].stage &&
@@ -1341,9 +1304,180 @@ export default {
                 workJson[k].answerInfo.push(JSON.parse(element.content)[0]);
               }
             }
+            for (var i = 0; i < pjInfo.length; i++) {
+              if (
+                res.data[0][k].stage == pjInfo[i].stage &&
+                res.data[0][k].task == pjInfo[i].task
+              ) {
+                var pj = pjInfo[i];
+                var a =
+                  chapters[0][pjInfo[i].stage].chapterInfo[0].taskJson[
+                    pjInfo[i].task
+                  ].toolChoose;
+                var rateJson = [];
+                for (var z = 0; z < a.length; z++) {
+                  if (a[z].tool[0] == 40) {
+                    rateJson = a[z].rateJson;
+                  }
+                }
+                workJson[k].pjInfo.push({
+                  answer: JSON.parse(pj.content),
+                  rateJson: rateJson,
+                });
+              }
+            }
+
+            for (var i = 0; i < xztkInfo.length; i++) {
+              if (
+                res.data[0][k].stage == xztkInfo[i].stage &&
+                res.data[0][k].task == xztkInfo[i].task
+              ) {
+                if (xztkInfo[i].type == 7) {
+                  var xztk = xztkInfo[i];
+                  var a =
+                    chapters[0][xztkInfo[i].stage].chapterInfo[0].taskJson[
+                      xztkInfo[i].task
+                    ].toolChoose;
+                  var selectJson = [];
+                  for (var z = 0; z < a.length; z++) {
+                    if (a[z].tool[0] == 41) {
+                      selectJson = a[z].selectJson;
+                    }
+                  }
+                  workJson[k].xztkInfo.push({
+                    answer: xztk.content.split(",").map(Number),
+                    selectJson: selectJson,
+                  });
+                }
+              }
+            }
+
+            for (var i = 0; i < lccjInfo.length; i++) {
+              if (
+                res.data[0][k].stage == lccjInfo[i].stage &&
+                res.data[0][k].task == lccjInfo[i].task
+              ) {
+                var lccj = lccjInfo[i];
+                workJson[k].lccjInfo.push(JSON.parse(lccj.content)[0]);
+              }
+            }
+
+            for (var i = 0; i < bgInfo.length; i++) {
+              if (
+                res.data[0][k].stage == bgInfo[i].stage &&
+                res.data[0][k].task == bgInfo[i].task
+              ) {
+                var bg = bgInfo[i];
+                workJson[k].bgInfo.push(JSON.parse(bg.content));
+              }
+            }
+
+            for (var i = 0; i < cocopiInfo.length; i++) {
+              if (
+                res.data[0][k].stage == cocopiInfo[i].stage &&
+                res.data[0][k].task == cocopiInfo[i].task
+              ) {
+                var cocopi = cocopiInfo[i];
+                var c = ["DOT", "DOC", "DOCX", "PPT", "PPTX", "XLSX", "XLS"];
+                var d = [
+                  "BMP",
+                  "PJP",
+                  "APNG",
+                  "PNG",
+                  "JPG",
+                  "GIF",
+                  "SVG",
+                  "JPEG",
+                  "JPG",
+                  "ICO",
+                  "PGPEG",
+                  "AVIF",
+                ];
+                var t = 0; //t = 1是图片 2是文档 3是pdf
+                if (
+                  d.indexOf(
+                    cocopi.content
+                      .split(".")
+                      [cocopi.content.split(".").length - 1].toLocaleUpperCase()
+                  ) != -1
+                ) {
+                  t = 1;
+                  workJson[k].cocopiInfo.push({ url: cocopi.content, type: t });
+                } else if (
+                  c.indexOf(
+                    cocopi.content
+                      .split(".")
+                      [cocopi.content.split(".").length - 1].toLocaleUpperCase()
+                  ) != -1
+                ) {
+                  t = 2;
+                  var a =
+                    "https://view.officeapps.live.com/op/view.aspx?src=" +
+                    cocopi.content;
+                  workJson[k].cocopiInfo.push({
+                    url: a,
+                    type: t,
+                  });
+                } else {
+                  t = 3;
+                  workJson[k].cocopiInfo.push({ url: cocopi.content, type: t });
+                }
+              }
+            }
+
+            for (var i = 0; i < wordInfo.length; i++) {
+              if (
+                res.data[0][k].stage == wordInfo[i].stage &&
+                res.data[0][k].task == wordInfo[i].task
+              ) {
+                var word = wordInfo[i];
+                workJson[k].wordInfo.push(JSON.parse(word.content));
+              }
+            }
+          }
+          const result = workJson.filter((item, index, arr) => {
+            return (
+              arr.findIndex((temp) => temp.stagetask === item.stagetask) ===
+              index
+            );
+          });
+          for (var l = 0; l < b.length; l++) {
+            eList =
+              chapters[0][b[l].stage].chapterInfo[0].taskJson[
+                b[l].task
+              ].eList;
+            if (eList && eList.length) {
+              _ooption = [];
+              result[l].eList = eList;
+              for (var i = 0; i < eList.length; i++) {
+                _ooption.push({ value: 0, name: eList[i].value });
+                result[l].rateList[eList[i].value] = 0;
+              }
+              result[l].rateList.content = "";
+              this.ooption[l] = _ooption;
+            }
+            if (b[l].rate && eList && eList.length) {
+              _rate[l] = JSON.parse(b[l].rate);
+              _rateList[l] = Object.keys(JSON.parse(b[l].rate));
+              for (var i = 0; i < _rateList[l].length; i++) {
+                var _c = Object.keys(result[l].rateList);
+                if (_c.indexOf(_rateList[l][i]) != -1) {
+                  result[l].rateList[_rateList[l][i]] =
+                    _rate[l][_rateList[l][i]];
+                }
+              }
+              for (var i = 0; i < this.ooption[l].length; i++) {
+                if (_rateList[l].indexOf(this.ooption[l][i].name) != -1) {
+                  this.ooption[l][i].value = _rate[l][this.ooption[l][i].name];
+                }
+              }
+            } else {
+              _rate[l] = [];
+              _rateList[l] = [];
+            }
           }
 
-          this.worksDetail = workJson;
+          this.worksDetail = result;
 
           this.courseDetail = res.data[0][0];
 
@@ -1366,6 +1500,7 @@ export default {
                 });
                 _option.series[0].data[0].value.push(_ooption[i].value);
               }
+              console.log(_option);
               this.setChart(_option, p);
             }
           }, 0);
@@ -1381,8 +1516,19 @@ export default {
           for (var c = 0; c < workJson.length; c++) {
             let _stage = workJson[c].stagetask.split("-")[0];
             let _task = workJson[c].stagetask.split("-")[1];
-            _dyList2[_stage].taskList.push(_dyList[_stage].taskList[_task]);
-            _dyList2[_stage].taskList;
+            if (_dyList2[_stage].taskList.length > 0) {
+              for (var i = 0; i < _dyList2[_stage].taskList.length; i++) {
+                if (
+                  _dyList[_stage].taskList[_task].id ==
+                  _dyList2[_stage].taskList[i].id
+                ) {
+                  continue;
+                }
+              }
+            } else {
+              _dyList2[_stage].taskList.push(_dyList[_stage].taskList[_task]);
+              _dyList2[_stage].taskList;
+            }
           }
           for (var c = 0; c < _dyList2.length; c++) {
             if (_dyList2[c].taskList.length) {
@@ -1396,112 +1542,6 @@ export default {
           this.navId =
             this.dyList2[0].id + "-" + this.dyList2[0].taskList[0].id;
           this.$forceUpdate();
-          // this.sInfo = res.data[0][0];
-          // this.chapInfo = JSON.parse(res.data[0][0].chapters);
-          // var chapters = JSON.parse(res.data[0][0].chapters);
-          // var worksDetail = res.data[1];
-          // // var askArray = res.data[2];
-          // this.scopeId = res.data[2].length ? res.data[2][0].id : this.sInfo.id;
-          // var askInfo = res.data[3];
-          // var answerInfo = res.data[4];
-          // var workJson = {
-          //   img: [],
-          //   imgIndex: 0,
-          //   eList: [],
-          //   rateList: {},
-          //   askInfo: [],
-          //   answerInfo: [],
-          // };
-          // var eList =
-          //   chapters[this.sInfo.stage].chapterInfo[0].taskJson[this.sInfo.task]
-          //     .eList;
-          // var _ooption = [];
-          // if (eList) {
-          //   workJson.eList = eList;
-          //   for (var i = 0; i < eList.length; i++) {
-          //     _ooption.push({ value: 0, name: eList[i].value });
-          //     workJson.rateList[eList[i].value] = 0;
-          //   }
-          //   workJson.rateList.content = "";
-          //   this.ooption = _ooption;
-          // } else {
-          //   workJson.eList = [
-          //     { value: "意识能力", detail: "", score: 5 },
-          //     { value: "科学探究能力", detail: "", score: 5 },
-          //     { value: "实践创新能力", detail: "", score: 5 },
-          //     { value: "学习反思能力", detail: "", score: 5 },
-          //     { value: "工程思维能力", detail: "", score: 5 },
-          //   ];
-          //   for (var i = 0; i < workJson.eList.length; i++) {
-          //     _ooption.push({ value: 0, name: workJson.eList[i].value });
-          //     workJson.rateList[workJson.eList[i].value] = 0;
-          //   }
-          //   workJson.rateList.content = "";
-          //   this.ooption = [
-          //     { value: 0, name: "意识能力" },
-          //     { value: 0, name: "科学探究能力" },
-          //     { value: 0, name: "实践创新能力" },
-          //     { value: 0, name: "学习反思能力" },
-          //     { value: 0, name: "工程思维能力" },
-          //   ];
-          // }
-          // if (this.sInfo.rate) {
-          //   var _rate = JSON.parse(this.sInfo.rate);
-          //   var _rateList = Object.keys(JSON.parse(this.sInfo.rate));
-          //   for (var i = 0; i < _rateList.length; i++) {
-          //     var _c = Object.keys(workJson.rateList);
-          //     if (_c.indexOf(_rateList[i]) != -1) {
-          //       workJson.rateList[_rateList[i]] = _rate[_rateList[i]];
-          //     }
-          //   }
-          //   for (var i = 0; i < this.ooption.length; i++) {
-          //     if (_rateList.indexOf(this.ooption[i].name) != -1) {
-          //       this.ooption[i].value = _rate[this.ooption[i].name];
-          //     }
-          //   }
-          // }
-
-          // for (var i = 0; i < worksDetail.length; i++) {
-          //   workJson.img.push({ src: worksDetail[i].content, id: i });
-          // }
-          // for (var i = 0; i < askInfo.length; i++) {
-          //   const element = askInfo[i];
-          //   let a = JSON.parse(element.content)[0];
-          //   let b = a.anwer.split(",");
-          //   let c = [];
-          //   for (var j = 0; j < b.length; j++) {
-          //     c.push(parseInt(b[j]));
-          //   }
-          //   a.askJson.radio = c;
-          //   a.askJson.time = element.time;
-          //   workJson.askInfo.push(a.askJson);
-          // }
-
-          // for (var i = 0; i < answerInfo.length; i++) {
-          //   const element = answerInfo[i];
-          //   workJson.answerInfo.push(JSON.parse(element.content)[0]);
-          // }
-
-          // this.worksDetail = workJson;
-
-          // this.courseDetail = res.data[0][0];
-
-          // this.$forceUpdate;
-          // this.dialogVisible3 = true;
-
-          // setTimeout(() => {
-          //   var _ooption = JSON.parse(JSON.stringify(this.ooption));
-          //   var _option = this.radarOption;
-          //   _option.radar.indicator = [];
-          //   _option.series[0].data[0].value = [];
-          //   for (var i = 0; i < _ooption.length; i++) {
-          //     _option.radar.indicator.push({ name: _ooption[i].name, max: 5 });
-          //     _option.series[0].data[0].value.push(_ooption[i].value);
-          //   }
-          //   console.log(_option);
-          //   this.setChart(_option);
-
-          // }, 0);
         })
         .catch((err) => {
           console.error(err);

+ 2 - 1
src/components/pages/components/courseReport.vue

@@ -215,7 +215,7 @@ export default {
   height: 25px;
   position: absolute;
   z-index: 9;
-  top: 8px;
+  top: 15px;
   left: 5px;
 }
 .searchImg > img {
@@ -238,6 +238,7 @@ export default {
 }
 .student_search > div:nth-child(1) {
   margin-right: 10px;
+  min-width: 65px;
 }
 .sxBox {
   display: flex;

+ 2 - 1
src/components/pages/components/evaReport.vue

@@ -338,7 +338,7 @@ export default {
   height: 25px;
   position: absolute;
   z-index: 9;
-  top: 8px;
+  top: 15px;
   left: 5px;
 }
 .searchImg > img {
@@ -361,6 +361,7 @@ export default {
 }
 .student_search > div:nth-child(1) {
   margin-right: 10px;
+  min-width: 65px;
 }
 .sxBox {
   display: flex;

+ 318 - 221
src/components/pages/components/studentWorksDetail.vue

@@ -1276,9 +1276,19 @@ export default {
         cid: cid,
       };
       this.ajax
-        .get(this.$store.state.api + "selectWorksDetail3", params)
+        .get(this.$store.state.api + "selectAllWorksDetail", params)
         .then((res) => {
-          this.sInfo = res.data[0];
+          var b = res.data[0].reduce((result, item) => {
+            const key = item.stage + "-" + item.task;
+            if (!result[key]) {
+              result[key] = item;
+            }
+            return result;
+          }, {});
+
+          // 将结果转换为数组形式
+          b = Object.values(b);
+          this.sInfo = b;
           var chapters = [],
             eList = [],
             _ooption = [],
@@ -1291,11 +1301,39 @@ export default {
           var answerInfo = res.data[4];
           var pptInfo = res.data[5];
           var chooseInfo = res.data[6];
+          var pjInfo = res.data[7]; //个人评价作业
+          var xztkInfo = res.data[8]; //选择填空作业
+          var lccjInfo = res.data[9]; //连词成句作业
+          var bgInfo = res.data[10]; //表格作业
+          var cocopiInfo = res.data[11]; //cocopi或源码编辑作业
+          var wordInfo = res.data[12]; //文档作业
           var workJson = [];
           for (var k = 0; k < res.data[0].length; k++) {
             this.allWorks = res.data[0][k];
-            this.chapInfo.push(JSON.parse(res.data[0][k].chapters));
-            chapters.push(JSON.parse(res.data[0][k].chapters));
+            if (this.chapInfo.length == 0) {
+              this.chapInfo.push(JSON.parse(res.data[0][k].chapters));
+            } else {
+              for (var i = 0; i < this.chapInfo.length; i++) {
+                if (
+                  JSON.stringify(res.data[0][k].chapters) ===
+                  JSON.stringify(this.chapInfo[i])
+                ) {
+                  continue;
+                }
+              }
+            }
+            if (chapters.length == 0) {
+              chapters.push(JSON.parse(res.data[0][k].chapters));
+            } else {
+              for (var i = 0; i < chapters.length; i++) {
+                if (
+                  JSON.stringify(res.data[0][k].chapters) ===
+                  JSON.stringify(chapters[i])
+                ) {
+                  continue;
+                }
+              }
+            }
             if (
               !chapters[0][res.data[0][k].stage].chapterInfo[0].taskJson[
                 res.data[0][k].task
@@ -1303,7 +1341,6 @@ export default {
             ) {
               continue;
             }
-
             workJson.push({
               img: [],
               imgIndex: 0,
@@ -1313,69 +1350,21 @@ export default {
               answerInfo: [],
               wpptInfo: [],
               chooseInfo: [],
+              pjInfo: [],
+              xztkInfo: [],
+              lccjInfo: [],
+              bgInfo: [],
+              cocopiInfo: [],
+              wordInfo: [],
               scopeId: res.data[0][k].id,
               stagetask: "",
               time: "",
             });
             this.checkJson[k] = {};
-            eList =
-              chapters[0][res.data[0][k].stage].chapterInfo[0].taskJson[
-                res.data[0][k].task
-              ].eList;
+
             workJson[k].time = res.data[0][k].time;
             workJson[k].stagetask =
               res.data[0][k].stage + "-" + res.data[0][k].task;
-            if (eList && eList.length) {
-              _ooption = [];
-              workJson[k].eList = eList;
-              for (var i = 0; i < eList.length; i++) {
-                _ooption.push({ value: 0, name: eList[i].value });
-                workJson[k].rateList[eList[i].value] = 0;
-              }
-              workJson[k].rateList.content = "";
-              this.ooption[k] = _ooption;
-            }
-            // else {
-            //   _ooption = [];
-            //   workJson[k].eList = [
-            //     { value: "意识能力", detail: "", score: 5 },
-            //     { value: "科学探究能力", detail: "", score: 5 },
-            //     { value: "实践创新能力", detail: "", score: 5 },
-            //     { value: "学习反思能力", detail: "", score: 5 },
-            //     { value: "工程思维能力", detail: "", score: 5 },
-            //   ];
-            //   for (var i = 0; i < workJson[k].eList.length; i++) {
-            //     _ooption.push({ value: 0, name: workJson[k].eList[i].value });
-            //     workJson[k].rateList[workJson[k].eList[i].value] = 0;
-            //   }
-            //   workJson[k].rateList.content = "";
-            //   this.ooption[k] = [
-            //     { value: 0, name: "意识能力" },
-            //     { value: 0, name: "科学探究能力" },
-            //     { value: 0, name: "实践创新能力" },
-            //     { value: 0, name: "学习反思能力" },
-            //     { value: 0, name: "工程思维能力" },
-            //   ];
-            // }
-            if (res.data[0][k].rate && eList && eList.length) {
-              _rate[k] = JSON.parse(res.data[0][k].rate);
-              _rateList[k] = Object.keys(JSON.parse(res.data[0][k].rate));
-              for (var i = 0; i < _rateList[k].length; i++) {
-                var _c = Object.keys(workJson[k].rateList);
-                if (_c.indexOf(_rateList[k][i]) != -1) {
-                  workJson[k].rateList[_rateList[k][i]] =
-                    _rate[k][_rateList[k][i]];
-                }
-              }
-              for (var i = 0; i < this.ooption[k].length; i++) {
-                if (_rateList[k].indexOf(this.ooption[k][i].name) != -1) {
-                  this.ooption[k][i].value = _rate[k][this.ooption[k][i].name];
-                }
-              }
-            } else {
-              _rate[k] = [];
-              _rateList[k] = [];
-            }
 
             for (var i = 0; i < worksDetail.length; i++) {
               if (
@@ -1392,14 +1381,89 @@ export default {
               ) {
                 const element = askInfo[i];
                 let a = JSON.parse(element.content)[0];
-                let b = a.anwer.split(",");
-                let c = [];
-                for (var j = 0; j < b.length; j++) {
-                  c.push(parseInt(b[j]));
+                let e = [];
+                for (var y = 0; y < a.askJson.length; y++) {
+                  if (a.askJson[y].type == "2") {
+                    e.push(JSON.parse(chooseInfo[i].content)[0].anwer[y]);
+                  } else {
+                    e.push(JSON.parse(chooseInfo[i].content)[0].anwer[y]);
+                  }
+                }
+                a.radio = e;
+                workJson[k].askInfo.push(a);
+                this.checkJson[k].allRight = 0;
+                var isCount = 0;
+                for (var p = 0; p < a.radio.length; p++) {
+                  if (!this.checkJson[k][p]) {
+                    this.checkJson[k][p] = {
+                      checkCount: [],
+                      checkPerson: [],
+                    };
+                  }
+                  if (!this.checkJson[k][p].checkCount.length) {
+                    this.checkJson[k][p].checkCount = [];
+                    let _askItemCount = a.askJson[p].askCount;
+                    for (var aic = 0; aic < _askItemCount; aic++) {
+                      this.checkJson[k][p].checkCount.push(0);
+                    }
+                  }
+                  if (a.radio[p] instanceof Array) {
+                    if (
+                      workJson[k].askInfo[0].askJson[p].answer
+                        .sort()
+                        .join(",") == a.radio[p].sort().join(",")
+                    ) {
+                      this.checkJson[k][p].right = 100;
+                      isCount += this.checkJson[k][p].right;
+                    } else {
+                      this.checkJson[k][p].right = 0;
+                      isCount += 0;
+                    }
+                    for (var q = 0; q < a.radio[p].length; q++) {
+                      this.checkJson[k][p].checkPerson[parseInt(a.radio[p][q])]
+                        ? this.checkJson[k][p].checkPerson[
+                            parseInt(a.radio[p][q])
+                          ].push(res.data[0][k].sName)
+                        : (this.checkJson[k][p].checkPerson[
+                            parseInt(a.radio[p][q])
+                          ] = [res.data[0][k].sName]);
+                      this.checkJson[k][p].checkCount[parseInt(a.radio[p][q])]
+                        ? this.checkJson[k][p].checkCount[
+                            parseInt(a.radio[p][q])
+                          ]++
+                        : (this.checkJson[k][p].checkCount[
+                            parseInt(a.radio[p][q])
+                          ] = 1);
+                    }
+                  } else {
+                    if (
+                      workJson[k].askInfo[0].askJson[p].answer == a.radio[p]
+                    ) {
+                      this.checkJson[k][p].right = 100;
+                      isCount += this.checkJson[k][p].right;
+                    } else {
+                      this.checkJson[k][p].right = 0;
+                      isCount += 0;
+                    }
+                    if (parseInt(a.radio[p]) || parseInt(a.radio[p]) == 0) {
+                      this.checkJson[k][p].checkPerson[parseInt(a.radio[p])]
+                        ? this.checkJson[k][p].checkPerson[
+                            parseInt(a.radio[p])
+                          ].push(res.data[0][k].sName)
+                        : (this.checkJson[k][p].checkPerson[
+                            parseInt(a.radio[p])
+                          ] = [res.data[0][k].sName]);
+                      this.checkJson[k][p].checkCount[parseInt(a.radio[p])]
+                        ? this.checkJson[k][p].checkCount[
+                            parseInt(a.radio[p])
+                          ]++
+                        : (this.checkJson[k][p].checkCount[
+                            parseInt(a.radio[p])
+                          ] = 1);
+                    }
+                  }
                 }
-                a.askJson.radio = c;
-                a.askJson.time = element.time;
-                workJson[k].askInfo.push(a.askJson);
+                this.checkJson[k].allRight = isCount / a.radio.length;
               }
             }
             for (var i = 0; i < chooseInfo.length; i++) {
@@ -1427,11 +1491,6 @@ export default {
                       checkCount: [],
                       checkPerson: [],
                     };
-                    // this.checkJson[k].push({
-                    //   checkCount: [],
-                    //   checkPerson: [],
-                    //   rightPerson: [],
-                    // });
                   }
                   if (!this.checkJson[k][p].checkCount.length) {
                     this.checkJson[k][p].checkCount = [];
@@ -1446,9 +1505,6 @@ export default {
                         .sort()
                         .join(",") == t.radio[p].sort().join(",")
                     ) {
-                      // this.checkJson[k][p].rightPerson.push(
-                      //   res.data[0][k].sName
-                      // );
                       this.checkJson[k][p].right = 100;
                       isCount += this.checkJson[k][p].right;
                     } else {
@@ -1475,9 +1531,6 @@ export default {
                     if (
                       workJson[k].chooseInfo[0].testJson[p].answer == t.radio[p]
                     ) {
-                      // this.checkJson[k][p].rightPerson.push(
-                      //   res.data[0][k].sName
-                      // );
                       this.checkJson[k][p].right = 100;
                       isCount += this.checkJson[k][p].right;
                     } else {
@@ -1505,7 +1558,6 @@ export default {
                 this.checkJson[k].allRight = isCount / t.radio.length;
               }
             }
-
             for (var i = 0; i < pptInfo.length; i++) {
               if (
                 res.data[0][k].stage == pptInfo[i].stage &&
@@ -1548,43 +1600,180 @@ export default {
                 workJson[k].answerInfo.push(JSON.parse(element.content)[0]);
               }
             }
+            for (var i = 0; i < pjInfo.length; i++) {
+              if (
+                res.data[0][k].stage == pjInfo[i].stage &&
+                res.data[0][k].task == pjInfo[i].task
+              ) {
+                var pj = pjInfo[i];
+                var a =
+                  chapters[0][pjInfo[i].stage].chapterInfo[0].taskJson[
+                    pjInfo[i].task
+                  ].toolChoose;
+                var rateJson = [];
+                for (var z = 0; z < a.length; z++) {
+                  if (a[z].tool[0] == 40) {
+                    rateJson = a[z].rateJson;
+                  }
+                }
+                workJson[k].pjInfo.push({
+                  answer: JSON.parse(pj.content),
+                  rateJson: rateJson,
+                });
+              }
+            }
+
+            for (var i = 0; i < xztkInfo.length; i++) {
+              if (
+                res.data[0][k].stage == xztkInfo[i].stage &&
+                res.data[0][k].task == xztkInfo[i].task
+              ) {
+                if (xztkInfo[i].type == 7) {
+                  var xztk = xztkInfo[i];
+                  var a =
+                    chapters[0][xztkInfo[i].stage].chapterInfo[0].taskJson[
+                      xztkInfo[i].task
+                    ].toolChoose;
+                  var selectJson = [];
+                  for (var z = 0; z < a.length; z++) {
+                    if (a[z].tool[0] == 41) {
+                      selectJson = a[z].selectJson;
+                    }
+                  }
+                  workJson[k].xztkInfo.push({
+                    answer: xztk.content.split(",").map(Number),
+                    selectJson: selectJson,
+                  });
+                }
+              }
+            }
+
+            for (var i = 0; i < lccjInfo.length; i++) {
+              if (
+                res.data[0][k].stage == lccjInfo[i].stage &&
+                res.data[0][k].task == lccjInfo[i].task
+              ) {
+                var lccj = lccjInfo[i];
+                workJson[k].lccjInfo.push(JSON.parse(lccj.content)[0]);
+              }
+            }
+
+            for (var i = 0; i < bgInfo.length; i++) {
+              if (
+                res.data[0][k].stage == bgInfo[i].stage &&
+                res.data[0][k].task == bgInfo[i].task
+              ) {
+                var bg = bgInfo[i];
+                workJson[k].bgInfo.push(JSON.parse(bg.content));
+              }
+            }
+
+            for (var i = 0; i < cocopiInfo.length; i++) {
+              if (
+                res.data[0][k].stage == cocopiInfo[i].stage &&
+                res.data[0][k].task == cocopiInfo[i].task
+              ) {
+                var cocopi = cocopiInfo[i];
+                var c = ["DOT", "DOC", "DOCX", "PPT", "PPTX", "XLSX", "XLS"];
+                var d = [
+                  "BMP",
+                  "PJP",
+                  "APNG",
+                  "PNG",
+                  "JPG",
+                  "GIF",
+                  "SVG",
+                  "JPEG",
+                  "JPG",
+                  "ICO",
+                  "PGPEG",
+                  "AVIF",
+                ];
+                var t = 0; //t = 1是图片 2是文档 3是pdf
+                if (
+                  d.indexOf(
+                    cocopi.content
+                      .split(".")
+                      [cocopi.content.split(".").length - 1].toLocaleUpperCase()
+                  ) != -1
+                ) {
+                  t = 1;
+                  workJson[k].cocopiInfo.push({ url: cocopi.content, type: t });
+                } else if (
+                  c.indexOf(
+                    cocopi.content
+                      .split(".")
+                      [cocopi.content.split(".").length - 1].toLocaleUpperCase()
+                  ) != -1
+                ) {
+                  t = 2;
+                  var a =
+                    "https://view.officeapps.live.com/op/view.aspx?src=" +
+                    cocopi.content;
+                  workJson[k].cocopiInfo.push({
+                    url: a,
+                    type: t,
+                  });
+                } else {
+                  t = 3;
+                  workJson[k].cocopiInfo.push({ url: cocopi.content, type: t });
+                }
+              }
+            }
+
+            for (var i = 0; i < wordInfo.length; i++) {
+              if (
+                res.data[0][k].stage == wordInfo[i].stage &&
+                res.data[0][k].task == wordInfo[i].task
+              ) {
+                var word = wordInfo[i];
+                workJson[k].wordInfo.push(JSON.parse(word.content));
+              }
+            }
+          }
+          const result = workJson.filter((item, index, arr) => {
+            return (
+              arr.findIndex((temp) => temp.stagetask === item.stagetask) ===
+              index
+            );
+          });
+          for (var l = 0; l < b.length; l++) {
+            eList =
+              chapters[0][b[l].stage].chapterInfo[0].taskJson[
+                b[l].task
+              ].eList;
+            if (eList && eList.length) {
+              _ooption = [];
+              result[l].eList = eList;
+              for (var i = 0; i < eList.length; i++) {
+                _ooption.push({ value: 0, name: eList[i].value });
+                result[l].rateList[eList[i].value] = 0;
+              }
+              result[l].rateList.content = "";
+              this.ooption[l] = _ooption;
+            }
+            if (b[l].rate && eList && eList.length) {
+              _rate[l] = JSON.parse(b[l].rate);
+              _rateList[l] = Object.keys(JSON.parse(b[l].rate));
+              for (var i = 0; i < _rateList[l].length; i++) {
+                var _c = Object.keys(result[l].rateList);
+                if (_c.indexOf(_rateList[l][i]) != -1) {
+                  result[l].rateList[_rateList[l][i]] =
+                    _rate[l][_rateList[l][i]];
+                }
+              }
+              for (var i = 0; i < this.ooption[l].length; i++) {
+                if (_rateList[l].indexOf(this.ooption[l][i].name) != -1) {
+                  this.ooption[l][i].value = _rate[l][this.ooption[l][i].name];
+                }
+              }
+            } else {
+              _rate[l] = [];
+              _rateList[l] = [];
+            }
           }
-          // debugger
-          // for(var i = 0; i < chooseInfo.length; i++){
-          //   if (chooseInfo[i].type == 8) {
-          //     console.log(this.checkJson)
-          //   }
-          // }
-          // for (var k = 0; k < res.data[0].length; k++) {
-          //   console.log(workJson[k].chooseInfo);
-          //   for (var i = 0; i < chooseInfo.length; i++) {
-          //     if (chooseInfo[i].type == 8) {
-          //       for (var z = 0; z < this.checkJson[k].length; z++) {
-          //         this.checkJson[k][z].checkPerent = [];
-          //         this.checkJson[k][z].right = Math.round(
-          //           (this.checkJson[k][z].rightPerson.length /
-          //             parseInt(workJson[k].chooseInfo.length)) *
-          //             100
-          //         );
-          //         for (
-          //           var w = 0;
-          //           w < this.checkJson[k][z].checkCount.length;
-          //           w++
-          //         ) {
-          //           this.checkJson[k][z].checkPerent.push(
-          //             Math.round(
-          //               (this.checkJson[k][z].checkCount[w] /
-          //                 parseInt(workJson[k].chooseInfo.length)) *
-          //                 100
-          //             )
-          //           );
-          //         }
-          //       }
-          //     }
-          //   }
-          // }
 
-          this.worksDetail = workJson;
+          this.worksDetail = result;
 
           this.courseDetail = res.data[0][0];
 
@@ -1607,9 +1796,11 @@ export default {
                 });
                 _option.series[0].data[0].value.push(_ooption[i].value);
               }
+              console.log(_option);
               this.setChart(_option, p);
             }
           }, 0);
+
           let _dyList = JSON.parse(JSON.stringify(this.dyList));
           let _dyList2 = [];
           let _dyList3 = [];
@@ -1621,8 +1812,19 @@ export default {
           for (var c = 0; c < workJson.length; c++) {
             let _stage = workJson[c].stagetask.split("-")[0];
             let _task = workJson[c].stagetask.split("-")[1];
-            _dyList2[_stage].taskList.push(_dyList[_stage].taskList[_task]);
-            _dyList2[_stage].taskList;
+            if (_dyList2[_stage].taskList.length > 0) {
+              for (var i = 0; i < _dyList2[_stage].taskList.length; i++) {
+                if (
+                  _dyList[_stage].taskList[_task].id ==
+                  _dyList2[_stage].taskList[i].id
+                ) {
+                  continue;
+                }
+              }
+            } else {
+              _dyList2[_stage].taskList.push(_dyList[_stage].taskList[_task]);
+              _dyList2[_stage].taskList;
+            }
           }
           for (var c = 0; c < _dyList2.length; c++) {
             if (_dyList2[c].taskList.length) {
@@ -1635,111 +1837,6 @@ export default {
           this.taskCount = this.dyList2[0].taskList[0].id;
           this.navId =
             this.dyList2[0].id + "-" + this.dyList2[0].taskList[0].id;
-          // this.sInfo = res.data[0][0];
-          // this.chapInfo = JSON.parse(res.data[0][0].chapters);
-          // var chapters = JSON.parse(res.data[0][0].chapters);
-          // var worksDetail = res.data[1];
-          // // var askArray = res.data[2];
-          // this.scopeId = res.data[2].length ? res.data[2][0].id : this.sInfo.id;
-          // var askInfo = res.data[3];
-          // var answerInfo = res.data[4];
-          // var workJson = {
-          //   img: [],
-          //   imgIndex: 0,
-          //   eList: [],
-          //   rateList: {},
-          //   askInfo: [],
-          //   answerInfo: [],
-          // };
-          // var eList =
-          //   chapters[this.sInfo.stage].chapterInfo[0].taskJson[this.sInfo.task]
-          //     .eList;
-          // var _ooption = [];
-          // if (eList) {
-          //   workJson.eList = eList;
-          //   for (var i = 0; i < eList.length; i++) {
-          //     _ooption.push({ value: 0, name: eList[i].value });
-          //     workJson.rateList[eList[i].value] = 0;
-          //   }
-          //   workJson.rateList.content = "";
-          //   this.ooption = _ooption;
-          // } else {
-          //   workJson.eList = [
-          //     { value: "意识能力", detail: "", score: 5 },
-          //     { value: "科学探究能力", detail: "", score: 5 },
-          //     { value: "实践创新能力", detail: "", score: 5 },
-          //     { value: "学习反思能力", detail: "", score: 5 },
-          //     { value: "工程思维能力", detail: "", score: 5 },
-          //   ];
-          //   for (var i = 0; i < workJson.eList.length; i++) {
-          //     _ooption.push({ value: 0, name: workJson.eList[i].value });
-          //     workJson.rateList[workJson.eList[i].value] = 0;
-          //   }
-          //   workJson.rateList.content = "";
-          //   this.ooption = [
-          //     { value: 0, name: "意识能力" },
-          //     { value: 0, name: "科学探究能力" },
-          //     { value: 0, name: "实践创新能力" },
-          //     { value: 0, name: "学习反思能力" },
-          //     { value: 0, name: "工程思维能力" },
-          //   ];
-          // }
-          // if (this.sInfo.rate) {
-          //   var _rate = JSON.parse(this.sInfo.rate);
-          //   var _rateList = Object.keys(JSON.parse(this.sInfo.rate));
-          //   for (var i = 0; i < _rateList.length; i++) {
-          //     var _c = Object.keys(workJson.rateList);
-          //     if (_c.indexOf(_rateList[i]) != -1) {
-          //       workJson.rateList[_rateList[i]] = _rate[_rateList[i]];
-          //     }
-          //   }
-          //   for (var i = 0; i < this.ooption.length; i++) {
-          //     if (_rateList.indexOf(this.ooption[i].name) != -1) {
-          //       this.ooption[i].value = _rate[this.ooption[i].name];
-          //     }
-          //   }
-          // }
-
-          // for (var i = 0; i < worksDetail.length; i++) {
-          //   workJson.img.push({ src: worksDetail[i].content, id: i });
-          // }
-          // for (var i = 0; i < askInfo.length; i++) {
-          //   const element = askInfo[i];
-          //   let a = JSON.parse(element.content)[0];
-          //   let b = a.anwer.split(",");
-          //   let c = [];
-          //   for (var j = 0; j < b.length; j++) {
-          //     c.push(parseInt(b[j]));
-          //   }
-          //   a.askJson.radio = c;
-          //   a.askJson.time = element.time;
-          //   workJson.askInfo.push(a.askJson);
-          // }
-
-          // for (var i = 0; i < answerInfo.length; i++) {
-          //   const element = answerInfo[i];
-          //   workJson.answerInfo.push(JSON.parse(element.content)[0]);
-          // }
-
-          // this.worksDetail = workJson;
-
-          // this.courseDetail = res.data[0][0];
-
-          // this.$forceUpdate;
-          // this.dialogVisible3 = true;
-
-          // setTimeout(() => {
-          //   var _ooption = JSON.parse(JSON.stringify(this.ooption));
-          //   var _option = this.radarOption;
-          //   _option.radar.indicator = [];
-          //   _option.series[0].data[0].value = [];
-          //   for (var i = 0; i < _ooption.length; i++) {
-          //     _option.radar.indicator.push({ name: _ooption[i].name, max: 5 });
-          //     _option.series[0].data[0].value.push(_ooption[i].value);
-          //   }
-          //   this.setChart(_option);
-
-          // }, 0);
           this.isPre = false;
           this.isNext = false;
           this.preStep(1);

Plik diff jest za duży
+ 687 - 227
src/components/pages/components/worksDetail2.vue


+ 235 - 198
src/components/pages/components/worksDetail3.vue

@@ -980,9 +980,19 @@ export default {
         cid: this.cid,
       };
       this.ajax
-        .get(this.$store.state.api + "selectWorksDetail3", params)
+        .get(this.$store.state.api + "selectAllWorksDetail", params)
         .then((res) => {
-          this.sInfo = res.data[0];
+          var b = res.data[0].reduce((result, item) => {
+            const key = item.stage + "-" + item.task;
+            if (!result[key]) {
+              result[key] = item;
+            }
+            return result;
+          }, {});
+
+          // 将结果转换为数组形式
+          b = Object.values(b);
+          this.sInfo = b;
           var chapters = [],
             eList = [],
             _ooption = [],
@@ -995,11 +1005,39 @@ export default {
           var answerInfo = res.data[4];
           var pptInfo = res.data[5];
           var chooseInfo = res.data[6];
+          var pjInfo = res.data[7]; //个人评价作业
+          var xztkInfo = res.data[8]; //选择填空作业
+          var lccjInfo = res.data[9]; //连词成句作业
+          var bgInfo = res.data[10]; //表格作业
+          var cocopiInfo = res.data[11]; //cocopi或源码编辑作业
+          var wordInfo = res.data[12]; //文档作业
           var workJson = [];
           for (var k = 0; k < res.data[0].length; k++) {
             this.allWorks = res.data[0][k];
-            this.chapInfo.push(JSON.parse(res.data[0][k].chapters));
-            chapters.push(JSON.parse(res.data[0][k].chapters));
+            if (this.chapInfo.length == 0) {
+              this.chapInfo.push(JSON.parse(res.data[0][k].chapters));
+            } else {
+              for (var i = 0; i < this.chapInfo.length; i++) {
+                if (
+                  JSON.stringify(res.data[0][k].chapters) ===
+                  JSON.stringify(this.chapInfo[i])
+                ) {
+                  continue;
+                }
+              }
+            }
+            if (chapters.length == 0) {
+              chapters.push(JSON.parse(res.data[0][k].chapters));
+            } else {
+              for (var i = 0; i < chapters.length; i++) {
+                if (
+                  JSON.stringify(res.data[0][k].chapters) ===
+                  JSON.stringify(chapters[i])
+                ) {
+                  continue;
+                }
+              }
+            }
             if (
               !chapters[0][res.data[0][k].stage].chapterInfo[0].taskJson[
                 res.data[0][k].task
@@ -1007,7 +1045,6 @@ export default {
             ) {
               continue;
             }
-
             workJson.push({
               img: [],
               imgIndex: 0,
@@ -1015,74 +1052,23 @@ export default {
               rateList: {},
               askInfo: [],
               answerInfo: [],
-              chooseInfo: [],
               wpptInfo: [],
+              chooseInfo: [],
+              pjInfo: [],
+              xztkInfo: [],
+              lccjInfo: [],
+              bgInfo: [],
+              cocopiInfo: [],
+              wordInfo: [],
               scopeId: res.data[0][k].id,
               stagetask: "",
               time: "",
             });
             this.checkJson[k] = {};
-            // this.allWorks = res.data[0][k];
-            // this.chapInfo.push(JSON.parse(res.data[0][k].chapters));
-            // chapters.push(JSON.parse(res.data[0][k].chapters));
-            eList =
-              chapters[0][res.data[0][k].stage].chapterInfo[0].taskJson[
-                res.data[0][k].task
-              ].eList;
+
             workJson[k].time = res.data[0][k].time;
             workJson[k].stagetask =
               res.data[0][k].stage + "-" + res.data[0][k].task;
-            if (eList && eList.length > 0) {
-              _ooption = [];
-              workJson[k].eList = eList;
-              for (var i = 0; i < eList.length; i++) {
-                _ooption.push({ value: 0, name: eList[i].value });
-                workJson[k].rateList[eList[i].value] = 0;
-              }
-              workJson[k].rateList.content = "";
-              this.ooption[k] = _ooption;
-            }
-            //  else {
-            //   _ooption = [];
-            //   workJson[k].eList = [
-            //     { value: "意识能力", detail: "", score: 5 },
-            //     { value: "科学探究能力", detail: "", score: 5 },
-            //     { value: "实践创新能力", detail: "", score: 5 },
-            //     { value: "学习反思能力", detail: "", score: 5 },
-            //     { value: "工程思维能力", detail: "", score: 5 },
-            //   ];
-            //   for (var i = 0; i < workJson[k].eList.length; i++) {
-            //     _ooption.push({ value: 0, name: workJson[k].eList[i].value });
-            //     workJson[k].rateList[workJson[k].eList[i].value] = 0;
-            //   }
-            //   workJson[k].rateList.content = "";
-            //   this.ooption[k] = [
-            //     { value: 0, name: "意识能力" },
-            //     { value: 0, name: "科学探究能力" },
-            //     { value: 0, name: "实践创新能力" },
-            //     { value: 0, name: "学习反思能力" },
-            //     { value: 0, name: "工程思维能力" },
-            //   ];
-            // }
-            if (res.data[0][k].rate && eList && eList.length > 0) {
-              _rate[k] = JSON.parse(res.data[0][k].rate);
-              _rateList[k] = Object.keys(JSON.parse(res.data[0][k].rate));
-              for (var i = 0; i < _rateList[k].length; i++) {
-                var _c = Object.keys(workJson[k].rateList);
-                if (_c.indexOf(_rateList[k][i]) != -1) {
-                  workJson[k].rateList[_rateList[k][i]] =
-                    _rate[k][_rateList[k][i]];
-                }
-              }
-              for (var i = 0; i < this.ooption[k].length; i++) {
-                if (_rateList[k].indexOf(this.ooption[k][i].name) != -1) {
-                  this.ooption[k][i].value = _rate[k][this.ooption[k][i].name];
-                }
-              }
-            } else {
-              _rate[k] = [];
-              _rateList[k] = [];
-            }
 
             for (var i = 0; i < worksDetail.length; i++) {
               if (
@@ -1117,11 +1103,6 @@ export default {
                       checkCount: [],
                       checkPerson: [],
                     };
-                    // this.checkJson[k].push({
-                    //   checkCount: [],
-                    //   checkPerson: [],
-                    //   rightPerson: [],
-                    // });
                   }
                   if (!this.checkJson[k][p].checkCount.length) {
                     this.checkJson[k][p].checkCount = [];
@@ -1136,9 +1117,6 @@ export default {
                         .sort()
                         .join(",") == a.radio[p].sort().join(",")
                     ) {
-                      // this.checkJson[k][p].rightPerson.push(
-                      //   res.data[0][k].sName
-                      // );
                       this.checkJson[k][p].right = 100;
                       isCount += this.checkJson[k][p].right;
                     } else {
@@ -1165,9 +1143,6 @@ export default {
                     if (
                       workJson[k].askInfo[0].askJson[p].answer == a.radio[p]
                     ) {
-                      // this.checkJson[k][p].rightPerson.push(
-                      //   res.data[0][k].sName
-                      // );
                       this.checkJson[k][p].right = 100;
                       isCount += this.checkJson[k][p].right;
                     } else {
@@ -1220,11 +1195,6 @@ export default {
                       checkCount: [],
                       checkPerson: [],
                     };
-                    // this.checkJson[k].push({
-                    //   checkCount: [],
-                    //   checkPerson: [],
-                    //   rightPerson: [],
-                    // });
                   }
                   if (!this.checkJson[k][p].checkCount.length) {
                     this.checkJson[k][p].checkCount = [];
@@ -1239,16 +1209,12 @@ export default {
                         .sort()
                         .join(",") == t.radio[p].sort().join(",")
                     ) {
-                      // this.checkJson[k][p].rightPerson.push(
-                      //   res.data[0][k].sName
-                      // );
                       this.checkJson[k][p].right = 100;
                       isCount += this.checkJson[k][p].right;
                     } else {
                       this.checkJson[k][p].right = 0;
                       isCount += 0;
                     }
-                    console.log(this.checkJson[k][p].rightPerson);
                     for (var q = 0; q < t.radio[p].length; q++) {
                       this.checkJson[k][p].checkPerson[parseInt(t.radio[p][q])]
                         ? this.checkJson[k][p].checkPerson[
@@ -1269,16 +1235,12 @@ export default {
                     if (
                       workJson[k].chooseInfo[0].testJson[p].answer == t.radio[p]
                     ) {
-                      // this.checkJson[k][p].rightPerson.push(
-                      //   res.data[0][k].sName
-                      // );
                       this.checkJson[k][p].right = 100;
                       isCount += this.checkJson[k][p].right;
                     } else {
                       this.checkJson[k][p].right = 0;
                       isCount += 0;
                     }
-                    console.log(this.checkJson[k][p].rightPerson);
                     if (parseInt(t.radio[p]) || parseInt(t.radio[p]) == 0) {
                       this.checkJson[k][p].checkPerson[parseInt(t.radio[p])]
                         ? this.checkJson[k][p].checkPerson[
@@ -1300,7 +1262,6 @@ export default {
                 this.checkJson[k].allRight = isCount / t.radio.length;
               }
             }
-
             for (var i = 0; i < pptInfo.length; i++) {
               if (
                 res.data[0][k].stage == pptInfo[i].stage &&
@@ -1343,9 +1304,180 @@ export default {
                 workJson[k].answerInfo.push(JSON.parse(element.content)[0]);
               }
             }
+            for (var i = 0; i < pjInfo.length; i++) {
+              if (
+                res.data[0][k].stage == pjInfo[i].stage &&
+                res.data[0][k].task == pjInfo[i].task
+              ) {
+                var pj = pjInfo[i];
+                var a =
+                  chapters[0][pjInfo[i].stage].chapterInfo[0].taskJson[
+                    pjInfo[i].task
+                  ].toolChoose;
+                var rateJson = [];
+                for (var z = 0; z < a.length; z++) {
+                  if (a[z].tool[0] == 40) {
+                    rateJson = a[z].rateJson;
+                  }
+                }
+                workJson[k].pjInfo.push({
+                  answer: JSON.parse(pj.content),
+                  rateJson: rateJson,
+                });
+              }
+            }
+
+            for (var i = 0; i < xztkInfo.length; i++) {
+              if (
+                res.data[0][k].stage == xztkInfo[i].stage &&
+                res.data[0][k].task == xztkInfo[i].task
+              ) {
+                if (xztkInfo[i].type == 7) {
+                  var xztk = xztkInfo[i];
+                  var a =
+                    chapters[0][xztkInfo[i].stage].chapterInfo[0].taskJson[
+                      xztkInfo[i].task
+                    ].toolChoose;
+                  var selectJson = [];
+                  for (var z = 0; z < a.length; z++) {
+                    if (a[z].tool[0] == 41) {
+                      selectJson = a[z].selectJson;
+                    }
+                  }
+                  workJson[k].xztkInfo.push({
+                    answer: xztk.content.split(",").map(Number),
+                    selectJson: selectJson,
+                  });
+                }
+              }
+            }
+
+            for (var i = 0; i < lccjInfo.length; i++) {
+              if (
+                res.data[0][k].stage == lccjInfo[i].stage &&
+                res.data[0][k].task == lccjInfo[i].task
+              ) {
+                var lccj = lccjInfo[i];
+                workJson[k].lccjInfo.push(JSON.parse(lccj.content)[0]);
+              }
+            }
+
+            for (var i = 0; i < bgInfo.length; i++) {
+              if (
+                res.data[0][k].stage == bgInfo[i].stage &&
+                res.data[0][k].task == bgInfo[i].task
+              ) {
+                var bg = bgInfo[i];
+                workJson[k].bgInfo.push(JSON.parse(bg.content));
+              }
+            }
+
+            for (var i = 0; i < cocopiInfo.length; i++) {
+              if (
+                res.data[0][k].stage == cocopiInfo[i].stage &&
+                res.data[0][k].task == cocopiInfo[i].task
+              ) {
+                var cocopi = cocopiInfo[i];
+                var c = ["DOT", "DOC", "DOCX", "PPT", "PPTX", "XLSX", "XLS"];
+                var d = [
+                  "BMP",
+                  "PJP",
+                  "APNG",
+                  "PNG",
+                  "JPG",
+                  "GIF",
+                  "SVG",
+                  "JPEG",
+                  "JPG",
+                  "ICO",
+                  "PGPEG",
+                  "AVIF",
+                ];
+                var t = 0; //t = 1是图片 2是文档 3是pdf
+                if (
+                  d.indexOf(
+                    cocopi.content
+                      .split(".")
+                      [cocopi.content.split(".").length - 1].toLocaleUpperCase()
+                  ) != -1
+                ) {
+                  t = 1;
+                  workJson[k].cocopiInfo.push({ url: cocopi.content, type: t });
+                } else if (
+                  c.indexOf(
+                    cocopi.content
+                      .split(".")
+                      [cocopi.content.split(".").length - 1].toLocaleUpperCase()
+                  ) != -1
+                ) {
+                  t = 2;
+                  var a =
+                    "https://view.officeapps.live.com/op/view.aspx?src=" +
+                    cocopi.content;
+                  workJson[k].cocopiInfo.push({
+                    url: a,
+                    type: t,
+                  });
+                } else {
+                  t = 3;
+                  workJson[k].cocopiInfo.push({ url: cocopi.content, type: t });
+                }
+              }
+            }
+
+            for (var i = 0; i < wordInfo.length; i++) {
+              if (
+                res.data[0][k].stage == wordInfo[i].stage &&
+                res.data[0][k].task == wordInfo[i].task
+              ) {
+                var word = wordInfo[i];
+                workJson[k].wordInfo.push(JSON.parse(word.content));
+              }
+            }
+          }
+          const result = workJson.filter((item, index, arr) => {
+            return (
+              arr.findIndex((temp) => temp.stagetask === item.stagetask) ===
+              index
+            );
+          });
+          for (var l = 0; l < b.length; l++) {
+            eList =
+              chapters[0][b[l].stage].chapterInfo[0].taskJson[
+                b[l].task
+              ].eList;
+            if (eList && eList.length) {
+              _ooption = [];
+              result[l].eList = eList;
+              for (var i = 0; i < eList.length; i++) {
+                _ooption.push({ value: 0, name: eList[i].value });
+                result[l].rateList[eList[i].value] = 0;
+              }
+              result[l].rateList.content = "";
+              this.ooption[l] = _ooption;
+            }
+            if (b[l].rate && eList && eList.length) {
+              _rate[l] = JSON.parse(b[l].rate);
+              _rateList[l] = Object.keys(JSON.parse(b[l].rate));
+              for (var i = 0; i < _rateList[l].length; i++) {
+                var _c = Object.keys(result[l].rateList);
+                if (_c.indexOf(_rateList[l][i]) != -1) {
+                  result[l].rateList[_rateList[l][i]] =
+                    _rate[l][_rateList[l][i]];
+                }
+              }
+              for (var i = 0; i < this.ooption[l].length; i++) {
+                if (_rateList[l].indexOf(this.ooption[l][i].name) != -1) {
+                  this.ooption[l][i].value = _rate[l][this.ooption[l][i].name];
+                }
+              }
+            } else {
+              _rate[l] = [];
+              _rateList[l] = [];
+            }
           }
 
-          this.worksDetail = workJson;
+          this.worksDetail = result;
 
           this.courseDetail = res.data[0][0];
 
@@ -1384,8 +1516,19 @@ export default {
           for (var c = 0; c < workJson.length; c++) {
             let _stage = workJson[c].stagetask.split("-")[0];
             let _task = workJson[c].stagetask.split("-")[1];
-            _dyList2[_stage].taskList.push(_dyList[_stage].taskList[_task]);
-            _dyList2[_stage].taskList;
+            if (_dyList2[_stage].taskList.length > 0) {
+              for (var i = 0; i < _dyList2[_stage].taskList.length; i++) {
+                if (
+                  _dyList[_stage].taskList[_task].id ==
+                  _dyList2[_stage].taskList[i].id
+                ) {
+                  continue;
+                }
+              }
+            } else {
+              _dyList2[_stage].taskList.push(_dyList[_stage].taskList[_task]);
+              _dyList2[_stage].taskList;
+            }
           }
           for (var c = 0; c < _dyList2.length; c++) {
             if (_dyList2[c].taskList.length) {
@@ -1399,112 +1542,6 @@ export default {
           this.navId =
             this.dyList2[0].id + "-" + this.dyList2[0].taskList[0].id;
           this.$forceUpdate();
-          // this.sInfo = res.data[0][0];
-          // this.chapInfo = JSON.parse(res.data[0][0].chapters);
-          // var chapters = JSON.parse(res.data[0][0].chapters);
-          // var worksDetail = res.data[1];
-          // // var askArray = res.data[2];
-          // this.scopeId = res.data[2].length ? res.data[2][0].id : this.sInfo.id;
-          // var askInfo = res.data[3];
-          // var answerInfo = res.data[4];
-          // var workJson = {
-          //   img: [],
-          //   imgIndex: 0,
-          //   eList: [],
-          //   rateList: {},
-          //   askInfo: [],
-          //   answerInfo: [],
-          // };
-          // var eList =
-          //   chapters[this.sInfo.stage].chapterInfo[0].taskJson[this.sInfo.task]
-          //     .eList;
-          // var _ooption = [];
-          // if (eList) {
-          //   workJson.eList = eList;
-          //   for (var i = 0; i < eList.length; i++) {
-          //     _ooption.push({ value: 0, name: eList[i].value });
-          //     workJson.rateList[eList[i].value] = 0;
-          //   }
-          //   workJson.rateList.content = "";
-          //   this.ooption = _ooption;
-          // } else {
-          //   workJson.eList = [
-          //     { value: "意识能力", detail: "", score: 5 },
-          //     { value: "科学探究能力", detail: "", score: 5 },
-          //     { value: "实践创新能力", detail: "", score: 5 },
-          //     { value: "学习反思能力", detail: "", score: 5 },
-          //     { value: "工程思维能力", detail: "", score: 5 },
-          //   ];
-          //   for (var i = 0; i < workJson.eList.length; i++) {
-          //     _ooption.push({ value: 0, name: workJson.eList[i].value });
-          //     workJson.rateList[workJson.eList[i].value] = 0;
-          //   }
-          //   workJson.rateList.content = "";
-          //   this.ooption = [
-          //     { value: 0, name: "意识能力" },
-          //     { value: 0, name: "科学探究能力" },
-          //     { value: 0, name: "实践创新能力" },
-          //     { value: 0, name: "学习反思能力" },
-          //     { value: 0, name: "工程思维能力" },
-          //   ];
-          // }
-          // if (this.sInfo.rate) {
-          //   var _rate = JSON.parse(this.sInfo.rate);
-          //   var _rateList = Object.keys(JSON.parse(this.sInfo.rate));
-          //   for (var i = 0; i < _rateList.length; i++) {
-          //     var _c = Object.keys(workJson.rateList);
-          //     if (_c.indexOf(_rateList[i]) != -1) {
-          //       workJson.rateList[_rateList[i]] = _rate[_rateList[i]];
-          //     }
-          //   }
-          //   for (var i = 0; i < this.ooption.length; i++) {
-          //     if (_rateList.indexOf(this.ooption[i].name) != -1) {
-          //       this.ooption[i].value = _rate[this.ooption[i].name];
-          //     }
-          //   }
-          // }
-
-          // for (var i = 0; i < worksDetail.length; i++) {
-          //   workJson.img.push({ src: worksDetail[i].content, id: i });
-          // }
-          // for (var i = 0; i < askInfo.length; i++) {
-          //   const element = askInfo[i];
-          //   let a = JSON.parse(element.content)[0];
-          //   let b = a.anwer.split(",");
-          //   let c = [];
-          //   for (var j = 0; j < b.length; j++) {
-          //     c.push(parseInt(b[j]));
-          //   }
-          //   a.askJson.radio = c;
-          //   a.askJson.time = element.time;
-          //   workJson.askInfo.push(a.askJson);
-          // }
-
-          // for (var i = 0; i < answerInfo.length; i++) {
-          //   const element = answerInfo[i];
-          //   workJson.answerInfo.push(JSON.parse(element.content)[0]);
-          // }
-
-          // this.worksDetail = workJson;
-
-          // this.courseDetail = res.data[0][0];
-
-          // this.$forceUpdate;
-          // this.dialogVisible3 = true;
-
-          // setTimeout(() => {
-          //   var _ooption = JSON.parse(JSON.stringify(this.ooption));
-          //   var _option = this.radarOption;
-          //   _option.radar.indicator = [];
-          //   _option.series[0].data[0].value = [];
-          //   for (var i = 0; i < _ooption.length; i++) {
-          //     _option.radar.indicator.push({ name: _ooption[i].name, max: 5 });
-          //     _option.series[0].data[0].value.push(_ooption[i].value);
-          //   }
-          //   console.log(_option);
-          //   this.setChart(_option);
-
-          // }, 0);
         })
         .catch((err) => {
           console.error(err);

+ 235 - 198
src/components/pages/myReport/components/MyLookComponent/worksDetail3.vue

@@ -980,9 +980,19 @@ export default {
         cid: this.cid,
       };
       this.ajax
-        .get(this.$store.state.api + "selectWorksDetail3", params)
+        .get(this.$store.state.api + "selectAllWorksDetail", params)
         .then((res) => {
-          this.sInfo = res.data[0];
+          var b = res.data[0].reduce((result, item) => {
+            const key = item.stage + "-" + item.task;
+            if (!result[key]) {
+              result[key] = item;
+            }
+            return result;
+          }, {});
+
+          // 将结果转换为数组形式
+          b = Object.values(b);
+          this.sInfo = b;
           var chapters = [],
             eList = [],
             _ooption = [],
@@ -995,11 +1005,39 @@ export default {
           var answerInfo = res.data[4];
           var pptInfo = res.data[5];
           var chooseInfo = res.data[6];
+          var pjInfo = res.data[7]; //个人评价作业
+          var xztkInfo = res.data[8]; //选择填空作业
+          var lccjInfo = res.data[9]; //连词成句作业
+          var bgInfo = res.data[10]; //表格作业
+          var cocopiInfo = res.data[11]; //cocopi或源码编辑作业
+          var wordInfo = res.data[12]; //文档作业
           var workJson = [];
           for (var k = 0; k < res.data[0].length; k++) {
             this.allWorks = res.data[0][k];
-            this.chapInfo.push(JSON.parse(res.data[0][k].chapters));
-            chapters.push(JSON.parse(res.data[0][k].chapters));
+            if (this.chapInfo.length == 0) {
+              this.chapInfo.push(JSON.parse(res.data[0][k].chapters));
+            } else {
+              for (var i = 0; i < this.chapInfo.length; i++) {
+                if (
+                  JSON.stringify(res.data[0][k].chapters) ===
+                  JSON.stringify(this.chapInfo[i])
+                ) {
+                  continue;
+                }
+              }
+            }
+            if (chapters.length == 0) {
+              chapters.push(JSON.parse(res.data[0][k].chapters));
+            } else {
+              for (var i = 0; i < chapters.length; i++) {
+                if (
+                  JSON.stringify(res.data[0][k].chapters) ===
+                  JSON.stringify(chapters[i])
+                ) {
+                  continue;
+                }
+              }
+            }
             if (
               !chapters[0][res.data[0][k].stage].chapterInfo[0].taskJson[
                 res.data[0][k].task
@@ -1007,7 +1045,6 @@ export default {
             ) {
               continue;
             }
-
             workJson.push({
               img: [],
               imgIndex: 0,
@@ -1015,74 +1052,23 @@ export default {
               rateList: {},
               askInfo: [],
               answerInfo: [],
-              chooseInfo: [],
               wpptInfo: [],
+              chooseInfo: [],
+              pjInfo: [],
+              xztkInfo: [],
+              lccjInfo: [],
+              bgInfo: [],
+              cocopiInfo: [],
+              wordInfo: [],
               scopeId: res.data[0][k].id,
               stagetask: "",
               time: "",
             });
             this.checkJson[k] = {};
-            // this.allWorks = res.data[0][k];
-            // this.chapInfo.push(JSON.parse(res.data[0][k].chapters));
-            // chapters.push(JSON.parse(res.data[0][k].chapters));
-            eList =
-              chapters[0][res.data[0][k].stage].chapterInfo[0].taskJson[
-                res.data[0][k].task
-              ].eList;
+
             workJson[k].time = res.data[0][k].time;
             workJson[k].stagetask =
               res.data[0][k].stage + "-" + res.data[0][k].task;
-            if (eList && eList.length > 0) {
-              _ooption = [];
-              workJson[k].eList = eList;
-              for (var i = 0; i < eList.length; i++) {
-                _ooption.push({ value: 0, name: eList[i].value });
-                workJson[k].rateList[eList[i].value] = 0;
-              }
-              workJson[k].rateList.content = "";
-              this.ooption[k] = _ooption;
-            }
-            //  else {
-            //   _ooption = [];
-            //   workJson[k].eList = [
-            //     { value: "意识能力", detail: "", score: 5 },
-            //     { value: "科学探究能力", detail: "", score: 5 },
-            //     { value: "实践创新能力", detail: "", score: 5 },
-            //     { value: "学习反思能力", detail: "", score: 5 },
-            //     { value: "工程思维能力", detail: "", score: 5 },
-            //   ];
-            //   for (var i = 0; i < workJson[k].eList.length; i++) {
-            //     _ooption.push({ value: 0, name: workJson[k].eList[i].value });
-            //     workJson[k].rateList[workJson[k].eList[i].value] = 0;
-            //   }
-            //   workJson[k].rateList.content = "";
-            //   this.ooption[k] = [
-            //     { value: 0, name: "意识能力" },
-            //     { value: 0, name: "科学探究能力" },
-            //     { value: 0, name: "实践创新能力" },
-            //     { value: 0, name: "学习反思能力" },
-            //     { value: 0, name: "工程思维能力" },
-            //   ];
-            // }
-            if (res.data[0][k].rate && eList && eList.length > 0) {
-              _rate[k] = JSON.parse(res.data[0][k].rate);
-              _rateList[k] = Object.keys(JSON.parse(res.data[0][k].rate));
-              for (var i = 0; i < _rateList[k].length; i++) {
-                var _c = Object.keys(workJson[k].rateList);
-                if (_c.indexOf(_rateList[k][i]) != -1) {
-                  workJson[k].rateList[_rateList[k][i]] =
-                    _rate[k][_rateList[k][i]];
-                }
-              }
-              for (var i = 0; i < this.ooption[k].length; i++) {
-                if (_rateList[k].indexOf(this.ooption[k][i].name) != -1) {
-                  this.ooption[k][i].value = _rate[k][this.ooption[k][i].name];
-                }
-              }
-            } else {
-              _rate[k] = [];
-              _rateList[k] = [];
-            }
 
             for (var i = 0; i < worksDetail.length; i++) {
               if (
@@ -1117,11 +1103,6 @@ export default {
                       checkCount: [],
                       checkPerson: [],
                     };
-                    // this.checkJson[k].push({
-                    //   checkCount: [],
-                    //   checkPerson: [],
-                    //   rightPerson: [],
-                    // });
                   }
                   if (!this.checkJson[k][p].checkCount.length) {
                     this.checkJson[k][p].checkCount = [];
@@ -1136,9 +1117,6 @@ export default {
                         .sort()
                         .join(",") == a.radio[p].sort().join(",")
                     ) {
-                      // this.checkJson[k][p].rightPerson.push(
-                      //   res.data[0][k].sName
-                      // );
                       this.checkJson[k][p].right = 100;
                       isCount += this.checkJson[k][p].right;
                     } else {
@@ -1165,9 +1143,6 @@ export default {
                     if (
                       workJson[k].askInfo[0].askJson[p].answer == a.radio[p]
                     ) {
-                      // this.checkJson[k][p].rightPerson.push(
-                      //   res.data[0][k].sName
-                      // );
                       this.checkJson[k][p].right = 100;
                       isCount += this.checkJson[k][p].right;
                     } else {
@@ -1220,11 +1195,6 @@ export default {
                       checkCount: [],
                       checkPerson: [],
                     };
-                    // this.checkJson[k].push({
-                    //   checkCount: [],
-                    //   checkPerson: [],
-                    //   rightPerson: [],
-                    // });
                   }
                   if (!this.checkJson[k][p].checkCount.length) {
                     this.checkJson[k][p].checkCount = [];
@@ -1239,16 +1209,12 @@ export default {
                         .sort()
                         .join(",") == t.radio[p].sort().join(",")
                     ) {
-                      // this.checkJson[k][p].rightPerson.push(
-                      //   res.data[0][k].sName
-                      // );
                       this.checkJson[k][p].right = 100;
                       isCount += this.checkJson[k][p].right;
                     } else {
                       this.checkJson[k][p].right = 0;
                       isCount += 0;
                     }
-                    console.log(this.checkJson[k][p].rightPerson);
                     for (var q = 0; q < t.radio[p].length; q++) {
                       this.checkJson[k][p].checkPerson[parseInt(t.radio[p][q])]
                         ? this.checkJson[k][p].checkPerson[
@@ -1269,16 +1235,12 @@ export default {
                     if (
                       workJson[k].chooseInfo[0].testJson[p].answer == t.radio[p]
                     ) {
-                      // this.checkJson[k][p].rightPerson.push(
-                      //   res.data[0][k].sName
-                      // );
                       this.checkJson[k][p].right = 100;
                       isCount += this.checkJson[k][p].right;
                     } else {
                       this.checkJson[k][p].right = 0;
                       isCount += 0;
                     }
-                    console.log(this.checkJson[k][p].rightPerson);
                     if (parseInt(t.radio[p]) || parseInt(t.radio[p]) == 0) {
                       this.checkJson[k][p].checkPerson[parseInt(t.radio[p])]
                         ? this.checkJson[k][p].checkPerson[
@@ -1300,7 +1262,6 @@ export default {
                 this.checkJson[k].allRight = isCount / t.radio.length;
               }
             }
-
             for (var i = 0; i < pptInfo.length; i++) {
               if (
                 res.data[0][k].stage == pptInfo[i].stage &&
@@ -1343,9 +1304,180 @@ export default {
                 workJson[k].answerInfo.push(JSON.parse(element.content)[0]);
               }
             }
+            for (var i = 0; i < pjInfo.length; i++) {
+              if (
+                res.data[0][k].stage == pjInfo[i].stage &&
+                res.data[0][k].task == pjInfo[i].task
+              ) {
+                var pj = pjInfo[i];
+                var a =
+                  chapters[0][pjInfo[i].stage].chapterInfo[0].taskJson[
+                    pjInfo[i].task
+                  ].toolChoose;
+                var rateJson = [];
+                for (var z = 0; z < a.length; z++) {
+                  if (a[z].tool[0] == 40) {
+                    rateJson = a[z].rateJson;
+                  }
+                }
+                workJson[k].pjInfo.push({
+                  answer: JSON.parse(pj.content),
+                  rateJson: rateJson,
+                });
+              }
+            }
+
+            for (var i = 0; i < xztkInfo.length; i++) {
+              if (
+                res.data[0][k].stage == xztkInfo[i].stage &&
+                res.data[0][k].task == xztkInfo[i].task
+              ) {
+                if (xztkInfo[i].type == 7) {
+                  var xztk = xztkInfo[i];
+                  var a =
+                    chapters[0][xztkInfo[i].stage].chapterInfo[0].taskJson[
+                      xztkInfo[i].task
+                    ].toolChoose;
+                  var selectJson = [];
+                  for (var z = 0; z < a.length; z++) {
+                    if (a[z].tool[0] == 41) {
+                      selectJson = a[z].selectJson;
+                    }
+                  }
+                  workJson[k].xztkInfo.push({
+                    answer: xztk.content.split(",").map(Number),
+                    selectJson: selectJson,
+                  });
+                }
+              }
+            }
+
+            for (var i = 0; i < lccjInfo.length; i++) {
+              if (
+                res.data[0][k].stage == lccjInfo[i].stage &&
+                res.data[0][k].task == lccjInfo[i].task
+              ) {
+                var lccj = lccjInfo[i];
+                workJson[k].lccjInfo.push(JSON.parse(lccj.content)[0]);
+              }
+            }
+
+            for (var i = 0; i < bgInfo.length; i++) {
+              if (
+                res.data[0][k].stage == bgInfo[i].stage &&
+                res.data[0][k].task == bgInfo[i].task
+              ) {
+                var bg = bgInfo[i];
+                workJson[k].bgInfo.push(JSON.parse(bg.content));
+              }
+            }
+
+            for (var i = 0; i < cocopiInfo.length; i++) {
+              if (
+                res.data[0][k].stage == cocopiInfo[i].stage &&
+                res.data[0][k].task == cocopiInfo[i].task
+              ) {
+                var cocopi = cocopiInfo[i];
+                var c = ["DOT", "DOC", "DOCX", "PPT", "PPTX", "XLSX", "XLS"];
+                var d = [
+                  "BMP",
+                  "PJP",
+                  "APNG",
+                  "PNG",
+                  "JPG",
+                  "GIF",
+                  "SVG",
+                  "JPEG",
+                  "JPG",
+                  "ICO",
+                  "PGPEG",
+                  "AVIF",
+                ];
+                var t = 0; //t = 1是图片 2是文档 3是pdf
+                if (
+                  d.indexOf(
+                    cocopi.content
+                      .split(".")
+                      [cocopi.content.split(".").length - 1].toLocaleUpperCase()
+                  ) != -1
+                ) {
+                  t = 1;
+                  workJson[k].cocopiInfo.push({ url: cocopi.content, type: t });
+                } else if (
+                  c.indexOf(
+                    cocopi.content
+                      .split(".")
+                      [cocopi.content.split(".").length - 1].toLocaleUpperCase()
+                  ) != -1
+                ) {
+                  t = 2;
+                  var a =
+                    "https://view.officeapps.live.com/op/view.aspx?src=" +
+                    cocopi.content;
+                  workJson[k].cocopiInfo.push({
+                    url: a,
+                    type: t,
+                  });
+                } else {
+                  t = 3;
+                  workJson[k].cocopiInfo.push({ url: cocopi.content, type: t });
+                }
+              }
+            }
+
+            for (var i = 0; i < wordInfo.length; i++) {
+              if (
+                res.data[0][k].stage == wordInfo[i].stage &&
+                res.data[0][k].task == wordInfo[i].task
+              ) {
+                var word = wordInfo[i];
+                workJson[k].wordInfo.push(JSON.parse(word.content));
+              }
+            }
+          }
+          const result = workJson.filter((item, index, arr) => {
+            return (
+              arr.findIndex((temp) => temp.stagetask === item.stagetask) ===
+              index
+            );
+          });
+          for (var l = 0; l < b.length; l++) {
+            eList =
+              chapters[0][b[l].stage].chapterInfo[0].taskJson[
+                b[l].task
+              ].eList;
+            if (eList && eList.length) {
+              _ooption = [];
+              result[l].eList = eList;
+              for (var i = 0; i < eList.length; i++) {
+                _ooption.push({ value: 0, name: eList[i].value });
+                result[l].rateList[eList[i].value] = 0;
+              }
+              result[l].rateList.content = "";
+              this.ooption[l] = _ooption;
+            }
+            if (b[l].rate && eList && eList.length) {
+              _rate[l] = JSON.parse(b[l].rate);
+              _rateList[l] = Object.keys(JSON.parse(b[l].rate));
+              for (var i = 0; i < _rateList[l].length; i++) {
+                var _c = Object.keys(result[l].rateList);
+                if (_c.indexOf(_rateList[l][i]) != -1) {
+                  result[l].rateList[_rateList[l][i]] =
+                    _rate[l][_rateList[l][i]];
+                }
+              }
+              for (var i = 0; i < this.ooption[l].length; i++) {
+                if (_rateList[l].indexOf(this.ooption[l][i].name) != -1) {
+                  this.ooption[l][i].value = _rate[l][this.ooption[l][i].name];
+                }
+              }
+            } else {
+              _rate[l] = [];
+              _rateList[l] = [];
+            }
           }
 
-          this.worksDetail = workJson;
+          this.worksDetail = result;
 
           this.courseDetail = res.data[0][0];
 
@@ -1384,8 +1516,19 @@ export default {
           for (var c = 0; c < workJson.length; c++) {
             let _stage = workJson[c].stagetask.split("-")[0];
             let _task = workJson[c].stagetask.split("-")[1];
-            _dyList2[_stage].taskList.push(_dyList[_stage].taskList[_task]);
-            _dyList2[_stage].taskList;
+            if (_dyList2[_stage].taskList.length > 0) {
+              for (var i = 0; i < _dyList2[_stage].taskList.length; i++) {
+                if (
+                  _dyList[_stage].taskList[_task].id ==
+                  _dyList2[_stage].taskList[i].id
+                ) {
+                  continue;
+                }
+              }
+            } else {
+              _dyList2[_stage].taskList.push(_dyList[_stage].taskList[_task]);
+              _dyList2[_stage].taskList;
+            }
           }
           for (var c = 0; c < _dyList2.length; c++) {
             if (_dyList2[c].taskList.length) {
@@ -1399,112 +1542,6 @@ export default {
           this.navId =
             this.dyList2[0].id + "-" + this.dyList2[0].taskList[0].id;
           this.$forceUpdate();
-          // this.sInfo = res.data[0][0];
-          // this.chapInfo = JSON.parse(res.data[0][0].chapters);
-          // var chapters = JSON.parse(res.data[0][0].chapters);
-          // var worksDetail = res.data[1];
-          // // var askArray = res.data[2];
-          // this.scopeId = res.data[2].length ? res.data[2][0].id : this.sInfo.id;
-          // var askInfo = res.data[3];
-          // var answerInfo = res.data[4];
-          // var workJson = {
-          //   img: [],
-          //   imgIndex: 0,
-          //   eList: [],
-          //   rateList: {},
-          //   askInfo: [],
-          //   answerInfo: [],
-          // };
-          // var eList =
-          //   chapters[this.sInfo.stage].chapterInfo[0].taskJson[this.sInfo.task]
-          //     .eList;
-          // var _ooption = [];
-          // if (eList) {
-          //   workJson.eList = eList;
-          //   for (var i = 0; i < eList.length; i++) {
-          //     _ooption.push({ value: 0, name: eList[i].value });
-          //     workJson.rateList[eList[i].value] = 0;
-          //   }
-          //   workJson.rateList.content = "";
-          //   this.ooption = _ooption;
-          // } else {
-          //   workJson.eList = [
-          //     { value: "意识能力", detail: "", score: 5 },
-          //     { value: "科学探究能力", detail: "", score: 5 },
-          //     { value: "实践创新能力", detail: "", score: 5 },
-          //     { value: "学习反思能力", detail: "", score: 5 },
-          //     { value: "工程思维能力", detail: "", score: 5 },
-          //   ];
-          //   for (var i = 0; i < workJson.eList.length; i++) {
-          //     _ooption.push({ value: 0, name: workJson.eList[i].value });
-          //     workJson.rateList[workJson.eList[i].value] = 0;
-          //   }
-          //   workJson.rateList.content = "";
-          //   this.ooption = [
-          //     { value: 0, name: "意识能力" },
-          //     { value: 0, name: "科学探究能力" },
-          //     { value: 0, name: "实践创新能力" },
-          //     { value: 0, name: "学习反思能力" },
-          //     { value: 0, name: "工程思维能力" },
-          //   ];
-          // }
-          // if (this.sInfo.rate) {
-          //   var _rate = JSON.parse(this.sInfo.rate);
-          //   var _rateList = Object.keys(JSON.parse(this.sInfo.rate));
-          //   for (var i = 0; i < _rateList.length; i++) {
-          //     var _c = Object.keys(workJson.rateList);
-          //     if (_c.indexOf(_rateList[i]) != -1) {
-          //       workJson.rateList[_rateList[i]] = _rate[_rateList[i]];
-          //     }
-          //   }
-          //   for (var i = 0; i < this.ooption.length; i++) {
-          //     if (_rateList.indexOf(this.ooption[i].name) != -1) {
-          //       this.ooption[i].value = _rate[this.ooption[i].name];
-          //     }
-          //   }
-          // }
-
-          // for (var i = 0; i < worksDetail.length; i++) {
-          //   workJson.img.push({ src: worksDetail[i].content, id: i });
-          // }
-          // for (var i = 0; i < askInfo.length; i++) {
-          //   const element = askInfo[i];
-          //   let a = JSON.parse(element.content)[0];
-          //   let b = a.anwer.split(",");
-          //   let c = [];
-          //   for (var j = 0; j < b.length; j++) {
-          //     c.push(parseInt(b[j]));
-          //   }
-          //   a.askJson.radio = c;
-          //   a.askJson.time = element.time;
-          //   workJson.askInfo.push(a.askJson);
-          // }
-
-          // for (var i = 0; i < answerInfo.length; i++) {
-          //   const element = answerInfo[i];
-          //   workJson.answerInfo.push(JSON.parse(element.content)[0]);
-          // }
-
-          // this.worksDetail = workJson;
-
-          // this.courseDetail = res.data[0][0];
-
-          // this.$forceUpdate;
-          // this.dialogVisible3 = true;
-
-          // setTimeout(() => {
-          //   var _ooption = JSON.parse(JSON.stringify(this.ooption));
-          //   var _option = this.radarOption;
-          //   _option.radar.indicator = [];
-          //   _option.series[0].data[0].value = [];
-          //   for (var i = 0; i < _ooption.length; i++) {
-          //     _option.radar.indicator.push({ name: _ooption[i].name, max: 5 });
-          //     _option.series[0].data[0].value.push(_ooption[i].value);
-          //   }
-          //   console.log(_option);
-          //   this.setChart(_option);
-
-          // }, 0);
         })
         .catch((err) => {
           console.error(err);

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików