lsc %!s(int64=2) %!d(string=hai) anos
pai
achega
0aaa3438b7

BIN=BIN
src/assets/icon/thirdToolList/choose.png


+ 5 - 5
src/components/components/askStatic.vue

@@ -18,7 +18,7 @@
             </div>
             <div class="a_add_persent">
               <div class="a_add_persent_div" v-for="(item1, checkIndex) in item.askItem" :key="checkIndex">
-                <span :class="{ right: item.answer == checkIndex }"><span style="width:auto"
+                <span :class="{ right: item.answer == checkIndex }"><span style="max-width: calc(100% - 40px);width: auto;"
                     v-html="item.checkList[checkIndex]"></span></span>
                 <span>{{
                 checkJson[index].checkCount[checkIndex]
@@ -33,12 +33,12 @@
                   " :show-text="false"></el-progress>
                 </span>
               </div>
-              <div class="a_add_persent_div" v-for="(item1, checkIndex) in item.askItem" :key="checkIndex"
-                v-if=" item.answer == checkIndex">
+              <div class="a_add_persent_div"
+                v-if=" item.answer || item.answer == 0">
                 <span>正确率</span>
                 <span>{{
-                (checkJson[index].checkPerent[checkIndex]
-                ? checkJson[index].checkPerent[checkIndex]
+                (checkJson[index].right
+                ? checkJson[index].right
                 : 0) +'%'
                 }}</span>
                 <span>

+ 326 - 0
src/components/components/askStatic2.vue

@@ -0,0 +1,326 @@
+<template>
+  <div class="sjBox" v-if="askJSONC && askJSONC.testJson">
+    <div class="a_add_title">
+      <div style="font-size: 25px">{{ askJSONC.testTitle }}</div>
+    </div>
+    <div class="a_addBox">
+      <div class="a_add_box" v-for="(item, index) in askJSONC.testJson.testJson" :key="index">
+        <div class="a_add_head">
+          <div>
+            <span>{{ index + 1 + "、" + item.teststitle }}</span>
+          </div>
+          <el-button type="primary" @click="getA(checkJson[index].checkPerson, item.checkList)">查看学生</el-button>
+        </div>
+        <div class="a_add_body">
+          <div class="a_add_input width100">
+            <div class="a_add_persent a_add_persent_div a_add_persent_title">
+              <span>选项</span><span>小计</span><span>比例</span>
+            </div>
+            <div class="a_add_persent">
+              <div class="a_add_persent_div" v-for="(item1, checkIndex) in item.testItem" :key="checkIndex">
+                <span :class="{ right: item.answer.length ? item.answer.indexOf(checkIndex) != -1 : item.answer == checkIndex }"><span style="max-width: calc(100% - 40px);width: auto;"
+                    v-html="item.checkList[checkIndex]"></span></span>
+                <span>{{
+                checkJson[index].checkCount[checkIndex]
+                ? checkJson[index].checkCount[checkIndex]
+                : 0
+                }}</span>
+                <span>
+                  <el-progress :percentage="
+                    checkJson[index].checkPerent[checkIndex]
+                      ? checkJson[index].checkPerent[checkIndex]
+                      : 0
+                  " :show-text="false"></el-progress>
+                </span>
+              </div>
+              <div class="a_add_persent_div">
+                <span>正确率</span>
+                <span>{{
+                (checkJson[index].right
+                ? checkJson[index].right
+                : 0) +'%'
+                }}</span>
+                <span>
+                </span>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <el-dialog title="查看" :visible.sync="dialogVisible" :append-to-body="true" width="900px" :before-close="handleClose"
+      class="dialog_diy">
+      <div>
+        <div v-for="(item, index) in timu" :key="index" class="borderB">
+          <div v-html="item" class="s_title"></div>
+          <div class="stuBox" style="margin-top: 20px;align-items: flex-start;">
+            <div style="margin: 0 0 10px 0; min-width: 70px; color: #adadad">
+              选择同学:
+            </div>
+            <div class="stuBox" style="flex-wrap: wrap">
+              <span class="studentClass" v-for="(pe, pi) in person[index]" :key="index + '-' + pi">{{ pe }}</span>
+            </div>
+          </div>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="dialogVisible = false">关 闭</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  props: ["askJSON", "checkJson"],
+  data() {
+    return {
+      askJSONC: {},
+      dialogVisible: false,
+      person: [],
+      timu: [],
+      checkJson2:[]
+    };
+  },
+  watch: {
+    askJSON(val) {
+      this.askJSONC = this.askJSON ? JSON.parse(this.askJSON)[0] : {};
+    },
+  },
+  methods: {
+    handleClose(done) {
+      done();
+    },
+    getA(person, timu) {
+      this.person = person;
+      this.timu = timu;
+      this.dialogVisible = true;
+    },
+  },
+  watch: {
+    checkJson: {
+      immediate: true,
+      deep: true,
+      handler(newValue, oldValue) {
+        this.askJSONC = this.askJSON ? this.askJSON : {};
+        for(var i = 0;i<this.checkJson.length;i++){
+          // debuggerA
+          let el = this.checkJson[i]
+          console.log(el)
+        }
+        this.checkJson2 = this.checkJson
+      }
+    }
+  },
+  mounted() {
+    // this.askJSONC = this.askJSON ? JSON.parse(this.askJSON)[0] : {};
+    this.askJSONC = this.askJSON ? this.askJSON : {};
+    for(var i = 0;i<this.checkJson.length;i++){
+      let el = this.checkJson[i]
+      console.log(el)
+    }
+    this.checkJson2 = this.checkJson
+    
+  },
+};
+</script>
+
+<style scoped>
+.sjBox {
+  margin-top: 25px;
+  /* max-height: 420px; */
+  overflow: auto;
+}
+
+.a_addBox {
+  margin: 20px 0;
+  background: #fff;
+}
+
+.a_add_box {
+  border-bottom: 2px solid #eee;
+  padding-bottom: 10px;
+}
+
+.a_add_head {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  margin: 10px 0;
+  font-size: 18px;
+}
+
+.a_add_head .a_add_head_input {
+  width: 300px;
+}
+
+.a_add_head .a_add_head_div {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.a_add_head_div img {
+  cursor: pointer;
+  width: 23px;
+}
+
+.a_add_head_div img+img {
+  margin-left: 10px;
+}
+
+.a_add_body {
+  display: flex;
+  align-items: center;
+}
+
+.a_add_input {
+  display: flex;
+  align-items: center;
+  flex-wrap: wrap;
+  /* flex-direction: column; */
+  /* width: 100%; */
+}
+
+.width100 {
+  width: 100%;
+}
+
+.a_add_input .a_add_persent {
+  /* display: flex; */
+  /* flex-direction: column; */
+  width: 100%;
+}
+
+.a_add_persent_div {
+  width: 100%;
+  display: flex;
+  align-items: center;
+}
+
+.a_add_persent_div span {
+  margin: 5px 0;
+}
+
+.a_add_persent_div span:nth-child(1) {
+  width: 30%;
+}
+
+.a_add_persent_div span:nth-child(2) {
+  width: 7%;
+}
+
+.a_add_persent_div span:nth-child(3) {
+  width: 40%;
+}
+
+.sjBox::-webkit-scrollbar {
+  /*滚动条整体样式*/
+  width: 6px;
+  /*高宽分别对应横竖滚动条的尺寸*/
+  height: 6px;
+}
+
+/*定义滚动条轨道 内阴影+圆角*/
+.sjBox::-webkit-scrollbar {
+  border-radius: 10px;
+  background-color: #eee;
+}
+
+/*定义滑块 内阴影+圆角*/
+.sjBox::-webkit-scrollbar-thumb {
+  border-radius: 10px;
+  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
+  background-color: rgba(0, 0, 0, 0.1);
+}
+
+.right {
+  color: rgb(0 123 255);
+  position: relative;
+  display: flex;
+  align-items: center;
+  flex-wrap: wrap;
+}
+
+.right::after {
+  content: "";
+  /* position: absolute; */
+  background-image: url(../../assets/right.png);
+  min-width: 15px;
+  min-height: 15px;
+  background-size: 100% 100%;
+  margin: 0 10px;
+}
+
+.dialog_diy>>>.el-dialog__header,
+.dialog_diy1>>>.el-dialog__header {
+  background: #002e81 !important;
+  padding: 15px 20px;
+}
+
+.dialog_diy>>>.el-dialog__title,
+.dialog_diy1>>>.el-dialog__title {
+  color: #fff;
+}
+
+.dialog_diy>>>.el-dialog__headerbtn,
+.dialog_diy1>>>.el-dialog__headerbtn {
+  top: 19px;
+}
+
+.dialog_diy>>>.el-dialog__headerbtn .el-dialog__close,
+.dialog_diy1>>>.el-dialog__headerbtn .el-dialog__close {
+  color: #fff;
+}
+
+.dialog_diy>>>.el-dialog__headerbtn .el-dialog__close:hover,
+.dialog_diy1>>>.el-dialog__headerbtn .el-dialog__close:hover {
+  color: #fff;
+}
+
+.dialog_diy1>>>.el-dialog__body {
+  padding: 0;
+}
+
+.dialog_diy>>>.el-dialog__body,
+.dialog_diy>>>.el-dialog__footer,
+.dialog_diy1>>>.el-dialog__footer {
+  background: #fafafa;
+}
+
+.s_title {
+  /* margin-top: 10px; */
+  font-size: 18px;
+  margin-bottom: 10px;
+  word-break: break-word;
+  /* min-width: calc(100% / 2 - 200px); */
+}
+
+.stuBox {
+  display: flex;
+  /* flex-wrap: wrap; */
+  align-items: center;
+}
+
+.studentClass {
+  background: #46a1eb;
+  color: #fff;
+  width: 90px;
+  height: 25px;
+  text-align: center;
+  line-height: 25px;
+  border-radius: 5px;
+  margin: 0 15px 0 0;
+  white-space: nowrap;
+  overflow: hidden;
+  padding: 5px;
+  text-overflow: ellipsis;
+  font-size: 16px;
+  margin-bottom: 10px;
+}
+
+.borderB {
+  margin-bottom: 10px;
+  border-bottom: 1px solid #d8d8d8;
+}
+</style>

+ 3 - 1
src/components/index.vue

@@ -325,11 +325,13 @@ export default {
           }
         }
       }
+      this.loading = this.openLoading(document.querySelector(".main_box"));
       this.selectAll();
     },
     selectAll() {
       this.zoneListId = 0;
       this.isListAjax = true;
+      // this.loading = this.openLoading(document.querySelector(".main_box"));
       // if (!this.loading) {
       //   this.loading = this.openLoading(document.querySelector(".main_box"));
       // }
@@ -352,7 +354,7 @@ export default {
         .get(this.$store.state.api + "selectTypeCourse2", params)
         .then((res) => {
           this.loading.close();
-          this.loading = "";
+          // this.loading = "";
           this.isListAjax = false;
           this.zoneClass = res.data[0];
           this.total = res.data[0].length ? res.data[0][0].num : 0;

+ 444 - 12
src/components/studyStudent.vue

@@ -718,6 +718,14 @@
                             />
                             <div style="margin: 5px 0">选择题</div>
                           </div>
+                          <div v-if="tooC == 45">
+                            <img
+                              @click="addTools(tooC, toolIndex, taskCount)"
+                              src="../assets/icon/thirdToolList/choose.png"
+                              alt
+                            />
+                            <div style="margin: 5px 0">选择题</div>
+                          </div>
                           <!-- <div v-if="tooC == 5">
                             <img
                               @click="addTools(tooC, toolIndex, taskCount)"
@@ -1051,6 +1059,39 @@
                       </div> -->
                     </div>
                   </div>
+                  <div
+                    v-if="tType && tType == 2 && tool.tool.indexOf(45) != -1"
+                    class="worksBox"
+                  >
+                    <div
+                      class="zuoyeYulan"
+                      v-if="workStudent[toolIndex].length > 0"
+                    >
+                      <span>作业预览</span>
+                      <el-button
+                        type="text"
+                        @click="jump()"
+                        v-if="tType == 2"
+                        class="buttonA"
+                        >我的评价</el-button
+                      >
+                    </div>
+                    <div
+                      class="worksDetailBox"
+                      v-if="workStudent[toolIndex].length > 0"
+                    >
+                      <div
+                        class="isWorksName"
+                        v-for="(w, wIndex) in workStudent[toolIndex]"
+                        :key="wIndex"
+                        @click="
+                          openTools(45, toolIndex, taskCount, w.works, w.sName)
+                        "
+                      >
+                        {{ w.sName }}
+                      </div>
+                    </div>
+                  </div>
                   <div
                     v-if="tType && tType == 2 && tool.tool.indexOf(15) != -1"
                     class="worksBox"
@@ -1571,16 +1612,11 @@
                       </div>
                       <div
                         class="right_box_xuan"
-                        v-for="(item1, checkIndex) in item.askItem"
-                        :key="checkIndex"
-                        v-if="item.answer == checkIndex"
                       >
                         <span>正确率</span>
                         <span>{{
-                          (checkJson[toolIndex][index].checkPerent[checkIndex]
-                            ? checkJson[toolIndex][index].checkPerent[
-                                checkIndex
-                              ]
+                          (checkJson[toolIndex][index].right
+                            ? checkJson[toolIndex][index].right
                             : 0) + "%"
                         }}</span>
                       </div>
@@ -1687,6 +1723,121 @@
                       </div>
                     </div>
                   </div>
+                  <div
+                    v-if="
+                      tType &&
+                      ((tType == 2 && sIsOpen == true) ||
+                        tType == 1 ||
+                        tType == 4) &&
+                      tool.tool.indexOf(45) != -1 &&
+                      (tool.testJson.testJson[0].answer ||
+                        tool.testJson.testJson[0].answer === 0) &&
+                      checkJson[toolIndex].length
+                    "
+                    class="xuan_right_box"
+                  >
+                    <div
+                      class="tool_right_box"
+                      v-for="(item, index) in tool.testJson.testJson"
+                      :key="index"
+                    >
+                      <div>
+                        <span>{{ index + 1 + "、" + item.teststitle }}</span>
+                      </div>
+                      <div class="right_box_xuan">
+                        <span>正确率</span>
+                        <span>{{
+                          (checkJson[toolIndex][index].right
+                            ? checkJson[toolIndex][index].right
+                            : 0) + "%"
+                        }}</span>
+                      </div>
+                    </div>
+                  </div>
+                  <div
+                    class="xuan_right_box"
+                    style="background: unset"
+                    v-if="
+                      tType &&
+                      ((tType == 2 && sIsOpen == true) ||
+                        tType == 1 ||
+                        tType == 4) &&
+                      tool.tool.indexOf(45) != -1
+                    "
+                  >
+                    <AskStatic2
+                      v-if="
+                        worksStudent.length &&
+                        worksStudent[toolIndex].length > 0
+                      "
+                      :askJSON="tool"
+                      :checkJson="checkJson[toolIndex]"
+                    ></AskStatic2>
+                  </div>
+                  <div
+                    v-if="
+                      tType &&
+                      ((tType == 2 && sIsOpen == true) ||
+                        tType == 1 ||
+                        tType == 4) &&
+                      tool.tool.indexOf(45) != -1
+                    "
+                    class="worksBox"
+                  >
+                    <div
+                      class="zuoyeYulan"
+                      v-if="
+                        worksStudent.length &&
+                        worksStudent[toolIndex].length > 0
+                      "
+                    >
+                      <span>作业预览</span>
+                      <el-button
+                        type="text"
+                        @click="jump()"
+                        v-if="tType == 2"
+                        class="buttonA"
+                        >我的评价</el-button
+                      >
+                    </div>
+                    <div>
+                      <div
+                        class="worksDetailBox"
+                        v-if="
+                          worksStudent.length &&
+                          worksStudent[toolIndex].length > 0
+                        "
+                      >
+                        <div
+                          v-for="(w, wIndex) in worksStudent[toolIndex]"
+                          :key="wIndex"
+                          class="isWorksName"
+                          @click="
+                            openTools(
+                              45,
+                              toolIndex,
+                              taskCount,
+                              w.works,
+                              w.sName
+                            )
+                          "
+                        >
+                          {{ w.sName }}
+                        </div>
+                      </div>
+                    </div>
+
+                    <div style="font-size: 18px">未提交</div>
+                    <div class="noWorksS">
+                      <div
+                        v-for="(s, sIndex) in noWorksS[toolIndex]"
+                        :key="sIndex"
+                        class="noWorksName"
+                      >
+                        {{ s.student }}
+                      </div>
+                    </div>
+                  </div>
                   <div
                     v-if="
                       tType &&
@@ -3118,7 +3269,7 @@
       <img width="100%" :src="dialogImageUrl" alt />
     </el-dialog>
     <el-dialog
-      :title="noteName != '' ? noteName : '查看选择题'"
+      :title="noteName != '' ? noteName : '查看问卷'"
       :visible.sync="dialogVisible5"
       :append-to-body="true"
       width="1000px"
@@ -3183,6 +3334,93 @@
         >
       </span>
     </el-dialog>
+    <el-dialog
+      :title="noteName != '' ? noteName : '查看问卷'"
+      :visible.sync="dialogVisibleChoice"
+      :append-to-body="true"
+      width="1000px"
+      :before-close="handleClose"
+      class="dialog_diy dialog_diy3"
+    >
+      <div>
+        <div
+          class="a_add_title"
+          style="
+            display: flex;
+            flex-direction: row;
+            align-items: center;
+            justify-content: center;
+          "
+        >
+          <div style="margin-right: 20px; font-size: 20px">标题:</div>
+          <div style="font-size: 20px">{{ testJson.testTitle }}</div>
+        </div>
+        <div class="a_addBox">
+          <div style="font-size: 16px; color: #c7c7c7">题目内容</div>
+          <div
+            class="a_add_box"
+            v-for="(item1, index1) in testJson.testCount"
+            :key="index1"
+          >
+            <div class="a_add_head">
+              <div style="display: flex">
+                {{ index1 + 1 + "、" }}
+                <div>题目:{{ testJson.testJson[index1].teststitle }}</div>
+              </div>
+              <img
+                v-if="testJson.testJson[index1].img"
+                :src="testJson.testJson[index1].img"
+                style="width: 100%; margin-top: 10px"
+              />
+            </div>
+            <div class="a_add_body">
+              <div class="a_add_input">
+                <el-radio-group
+                  v-model="radio[index1]"
+                  v-if="testJson.testJson[index1].type == '1'"
+                >
+                  <el-radio
+                    v-for="(item2, checkIndex) in testJson.testJson[index1]
+                      .checkList"
+                    :key="checkIndex"
+                    :label="checkIndex"
+                    :disabled="isAnswer"
+                    class="redioStyle"
+                    ><span v-html="item2"></span
+                  ></el-radio>
+                </el-radio-group>
+                <el-checkbox-group
+                  v-model="radio[index1]"
+                  v-if="testJson.testJson[index1].type == '2'"
+                >
+                  <el-checkbox
+                    v-for="(item2, checkIndex) in testJson.testJson[index1]
+                      .checkList"
+                    :key="checkIndex"
+                    :label="checkIndex"
+                    :disabled="isAnswer"
+                    class="redioStyle"
+                  >
+                    <span v-html="item2"></span>
+                  </el-checkbox>
+                </el-checkbox-group>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisibleChoice = false" v-show="noteName == ''"
+          >取 消</el-button
+        >
+        <el-button
+          type="primary"
+          @click="addStudentTest"
+          v-show="noteName == ''"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
     <el-dialog
       title="查看富文本"
       :visible.sync="dialogVisible1"
@@ -3912,6 +4150,7 @@
 import "../common/aws-sdk-2.235.1.min.js";
 import pdf from "./components/pdf3";
 import AskStatic from "./components/askStatic";
+import AskStatic2 from "./components/askStatic2";
 import AnswerData2 from "./components/answerData2";
 import EditorBar from "./tools/wangEnduit.vue";
 import Time from "./tools/time.vue";
@@ -3927,6 +4166,7 @@ export default {
     Time,
     pdf,
     AskStatic,
+    AskStatic2,
     Mind,
     Sunburst,
     SeeBoard,
@@ -4089,6 +4329,7 @@ export default {
       dialogVisible4: false,
       isNoHomeWork: false,
       dialogVisible5: false,
+      dialogVisibleChoice: false,
       answerDialogVisible: false,
       juriVisible: false,
       timeDialogVisible: false,
@@ -4099,6 +4340,7 @@ export default {
         askTitle: "",
         askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
       },
+      testJson: {},
       checkJson: [],
       askList: [],
       answerList: [],
@@ -4413,7 +4655,8 @@ export default {
                     b[j].type == 6 ||
                     b[j].type == 7) &&
                   a[i].tool[0] != 15 &&
-                  a[i].tool[0] != 4
+                  a[i].tool[0] != 4 &&
+                  a[i].tool[0] != 45
                 ) {
                   if (
                     c.indexOf(
@@ -4483,6 +4726,7 @@ export default {
                     time: b[j].time,
                   });
                 } else if (b[j].type == 2 && a[i].tool[0] == 4) {
+                  //问卷
                   this.workStudent[i].push({
                     works: b[j].content,
                     sName: b[j].name,
@@ -4490,6 +4734,15 @@ export default {
                     type: 2,
                     time: b[j].time,
                   });
+                } else if (b[j].type == 8 && a[i].tool[0] == 45) {
+                  //选择题
+                  this.workStudent[i].push({
+                    works: b[j].content,
+                    sName: b[j].name,
+                    score: b[j].score,
+                    type: 8,
+                    time: b[j].time,
+                  });
                 }
               }
             }
@@ -4782,6 +5035,7 @@ export default {
                       this.checkJson[i].push({
                         checkCount: [],
                         checkPerson: [],
+                        rightPerson: [],
                       });
                     }
                     if (!this.checkJson[i][z].checkCount.length) {
@@ -4792,6 +5046,13 @@ export default {
                         this.checkJson[i][z].checkCount.push(0);
                       }
                     }
+                    if (
+                      (JSON.parse(data.content)[0].askJson.askJson[z].answer || JSON.parse(data.content)[0].askJson.askJson[z].answer == 0)  &&
+                      JSON.parse(data.content)[0].askJson.askJson[z].answer ==
+                        checkL[z]
+                    ) {
+                      this.checkJson[i][z].rightPerson.push(data.name);
+                    }
                     this.checkJson[i][z].checkPerson[parseInt(checkL[z])]
                       ? this.checkJson[i][z].checkPerson[
                           parseInt(checkL[z])
@@ -4804,6 +5065,70 @@ export default {
                           parseInt(checkL[z])
                         ] = 1);
                   }
+                } else if (data.type == 8 && a[i].tool[0] == 45) {
+                  var checkL = JSON.parse(data.content)[0].anwer;
+                  for (var z = 0; z < checkL.length; z++) {
+                    if (!this.checkJson[i][z]) {
+                      this.checkJson[i].push({
+                        checkCount: [],
+                        checkPerson: [],
+                        rightPerson: [],
+                      });
+                    }
+                    if (!this.checkJson[i][z].checkCount.length) {
+                      this.checkJson[i][z].checkCount = [];
+                      let _askItemCount = JSON.parse(data.content)[0].testJson
+                        .testJson[z].testItem;
+                      for (var aic = 0; aic < _askItemCount; aic++) {
+                        this.checkJson[i][z].checkCount.push(0);
+                      }
+                    }
+
+                    if (checkL[z] instanceof Array) {
+                      if (
+                        JSON.parse(data.content)[0].testJson.testJson[
+                          z
+                        ].answer.join(",") == checkL[z].join(",")
+                      ) {
+                        this.checkJson[i][z].rightPerson.push(data.name);
+                      }
+                      for (var q = 0; q < checkL[z].length; q++) {
+                        this.checkJson[i][z].checkPerson[parseInt(checkL[z][q])]
+                          ? this.checkJson[i][z].checkPerson[
+                              parseInt(checkL[z][q])
+                            ].push(data.name)
+                          : (this.checkJson[i][z].checkPerson[
+                              parseInt(checkL[z][q])
+                            ] = [data.name]);
+                        this.checkJson[i][z].checkCount[parseInt(checkL[z][q])]
+                          ? this.checkJson[i][z].checkCount[
+                              parseInt(checkL[z][q])
+                            ]++
+                          : (this.checkJson[i][z].checkCount[
+                              parseInt(checkL[z][q])
+                            ] = 1);
+                      }
+                    } else {
+                      if (
+                        JSON.parse(data.content)[0].testJson.testJson[z]
+                          .answer == checkL[z]
+                      ) {
+                        this.checkJson[i][z].rightPerson.push(data.name);
+                      }
+                      this.checkJson[i][z].checkPerson[parseInt(checkL[z])]
+                        ? this.checkJson[i][z].checkPerson[
+                            parseInt(checkL[z])
+                          ].push(data.name)
+                        : (this.checkJson[i][z].checkPerson[
+                            parseInt(checkL[z])
+                          ] = [data.name]);
+                      this.checkJson[i][z].checkCount[parseInt(checkL[z])]
+                        ? this.checkJson[i][z].checkCount[parseInt(checkL[z])]++
+                        : (this.checkJson[i][z].checkCount[
+                            parseInt(checkL[z])
+                          ] = 1);
+                    }
+                  }
                 }
                 for (var k = 0; k < d.length; k++) {
                   //点赞
@@ -4835,7 +5160,8 @@ export default {
                     b[j].type == 6 ||
                     b[j].type == 7) &&
                   a[i].tool[0] != 15 &&
-                  a[i].tool[0] != 4
+                  a[i].tool[0] != 4 &&
+                  a[i].tool[0] != 45
                 ) {
                   if (
                     c.indexOf(
@@ -4935,6 +5261,7 @@ export default {
                     commentJson: commentJson,
                   });
                 } else if (b[j].type == 2 && a[i].tool[0] == 4) {
+                  //问卷
                   this.worksStudent[i].push({
                     userid: b[j].userid,
                     wid: b[j].id,
@@ -4948,6 +5275,21 @@ export default {
                     isLikes: isLikes,
                     commentJson: commentJson,
                   });
+                } else if (b[j].type == 8 && a[i].tool[0] == 45) {
+                  //选择题
+                  this.worksStudent[i].push({
+                    userid: b[j].userid,
+                    wid: b[j].id,
+                    works: b[j].content,
+                    sName: b[j].name,
+                    type: 8,
+                    time: b[j].time,
+                    score: b[j].score,
+                    likesCount: likesCount,
+                    commentCount: commentCount,
+                    isLikes: isLikes,
+                    commentJson: commentJson,
+                  });
                 }
 
                 this.isWorksS[i].push({ uid: b[j].userid, sName: b[j].name });
@@ -4971,9 +5313,14 @@ export default {
             for (var j = 0; j < b.length; j++) {
               var data = b[j];
               if (i == b[j].tool) {
-                if (data.type == 2) {
+                if (data.type == 2 || data.type == 8) {
                   for (var z = 0; z < this.checkJson[i].length; z++) {
                     this.checkJson[i][z].checkPerent = [];
+                    this.checkJson[i][z].right = Math.round(
+                      (this.checkJson[i][z].rightPerson.length /
+                        parseInt(this.worksStudent[i].length)) *
+                        100
+                    );
                     for (
                       var k = 0;
                       k < this.checkJson[i][z].checkCount.length;
@@ -5436,7 +5783,7 @@ export default {
     addQuestion() {
       this.answerList.push({
         answerTitle: this.answerQ,
-        answer: this.questionAnswer,
+        answer: this.questionAnswer.replaceAll(/%/g, "%25"),
       });
       let params = [
         {
@@ -6025,6 +6372,12 @@ export default {
         });
     },
     addStudentAsk() {
+      for (var i = 0; i < this.radio.length; i++) {
+        if (this.radio[i] !== 0 && !this.radio[i]) {
+          this.$message.error("请选择选项");
+          return;
+        }
+      }
       this.askList.push({ askJson: this.askJson, anwer: this.radio.join(",") });
       let params = [
         {
@@ -6052,6 +6405,43 @@ export default {
           console.error(err);
         });
     },
+    addStudentTest() {
+      for (var i = 0; i < this.radio.length; i++) {
+        if (
+          (this.radio[i] instanceof Array && !this.radio[i].length) ||
+          (this.radio[i] !== 0 && !this.radio[i])
+        ) {
+          this.$message.error("请选择选项");
+          return;
+        }
+      }
+      this.askList.push({ testJson: this.testJson, anwer: this.radio });
+      let params = [
+        {
+          uid: this.userid,
+          cid: this.id,
+          stage: this.courseType,
+          task: this.taskCount,
+          tool: this.toolindex,
+          content: JSON.stringify(this.askList).replace(/%/g, "%25"),
+          type: 8,
+        },
+      ];
+      this.ajax
+        .post(this.$store.state.api + "addCourseWorks", params)
+        .then((res) => {
+          this.$message({
+            message: "提交成功",
+            type: "success",
+          });
+          this.askList = [];
+          this.dialogVisibleChoice = false;
+        })
+        .catch((err) => {
+          this.$message.error("提交失败");
+          console.error(err);
+        });
+    },
     addWork() {
       if (this.studyJuri[0].content == "") {
         this.$message.error("请将信息填写完整");
@@ -6182,6 +6572,14 @@ export default {
         }
         this.isAnswer = true;
         this.dialogVisible5 = true;
+      } else if (t == 45) {
+        this.radio = [];
+        this.isAnswer = false;
+        let b = z[0].anwer;
+        this.radio = b;
+        this.testJson = z[0].testJson;
+        this.isAnswer = true;
+        this.dialogVisibleChoice = true;
       }
       //  else if (t == 15) {
       //   this.answerQ = "";
@@ -6279,6 +6677,32 @@ export default {
         }
         this.dialogVisible5 = true;
 
+        // window.parent.postMessage({ tools: "4" }, "*");
+      } else if (t == 45) {
+        this.noteName = "";
+        this.radio = [];
+        this.isAnswer = false;
+        if (this.askCount > 0) {
+          this.updateCount(this.askCount, t);
+        } else {
+          this.askCount++;
+          a = this.askCount;
+          this.toolsCount(a, t);
+        }
+        this.testJson =
+          this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
+            index
+          ].toolChoose[i].testJson;
+        for (var k = 0; k < this.testJson.testJson.length; k++) {
+          if (this.testJson.testJson[k].type == "2") {
+            this.radio.push([]);
+          } else {
+            this.radio.push("");
+          }
+        }
+
+        this.dialogVisibleChoice = true;
+
         // window.parent.postMessage({ tools: "4" }, "*");
       } else if (t == 5) {
         if (this.scoreCount > 0) {
@@ -7637,6 +8061,10 @@ export default {
   font-size: 18px;
 }
 
+.redioStyle >>> .el-checkbox__label {
+  font-size: 18px;
+}
+
 .toolHeng2 {
   width: 100%;
 }
@@ -7967,6 +8395,7 @@ export default {
 .workImg > img {
   width: 100%;
   height: 100%;
+  object-fit: contain;
 }
 
 .worksName {
@@ -8726,6 +9155,9 @@ export default {
 .redioStyle >>> .el-radio__input.is-checked + .el-radio__label {
   color: rgb(0 123 255) !important;
 }
+.redioStyle >>> .el-checkbox__input.is-checked + .el-checkbox__label {
+  color: rgb(0 123 255) !important;
+}
 
 .zuoyeYulan {
   padding-top: 15px;