Browse Source

新增问卷多选功能及修改选择题图片问题

zengyicheng 2 years ago
parent
commit
e80ff36bf6

File diff suppressed because it is too large
+ 550 - 248
src/components/pages/addCourse.vue


+ 421 - 276
src/components/pages/components/classStudentComponents/worksDetail3.vue

@@ -114,326 +114,382 @@
               </div>
               <div class="contentBox">
                 <div
-                  class="left_top"
+                  class="contentAuto"
                   :style="{
                     width: worksDetail[sIndex].eList.length ? '45%' : '95%',
                   }"
-                  v-if="worksDetail[sIndex].img.length > 0"
                 >
                   <div
-                    class="bigImg"
-                    v-if="
-                      worksDetail[sIndex].img && worksDetail[sIndex].img.length
-                    "
-                  >
-                    <img
-                      @click="
-                        previewImg(
-                          worksDetail[sIndex].img[worksDetail[sIndex].imgIndex]
-                            .src
-                        )
-                      "
-                      :src="
-                        worksDetail[sIndex].img[worksDetail[sIndex].imgIndex]
-                          .src
-                      "
-                      alt
-                    />
-                  </div>
-                  <div
-                    class="thumbnail"
-                    v-if="
-                      worksDetail[sIndex].img && worksDetail[sIndex].img.length
-                    "
+                    class="left_top"
+                    :style="{
+                      width: worksDetail[sIndex].eList.length ? '45%' : '95%',
+                    }"
+                    v-if="worksDetail[sIndex].img.length > 0"
                   >
                     <div
-                      v-for="(item, index) in worksDetail[sIndex].img"
-                      :key="index"
-                      :class="
-                        worksDetail[sIndex].imgIndex == index ? 'isClick' : ''
+                      class="bigImg"
+                      v-if="
+                        worksDetail[sIndex].img &&
+                        worksDetail[sIndex].img.length
                       "
                     >
                       <img
-                        :src="item.src"
+                        @click="
+                          previewImg(
+                            worksDetail[sIndex].img[
+                              worksDetail[sIndex].imgIndex
+                            ].src
+                          )
+                        "
+                        :src="
+                          worksDetail[sIndex].img[worksDetail[sIndex].imgIndex]
+                            .src
+                        "
                         alt
-                        @click="worksDetail[sIndex].imgIndex = index"
                       />
                     </div>
-                  </div>
-                  <div class="work_nopicture" v-else>暂无上传截图</div>
-                </div>
-                <div
-                  class="left_top"
-                  :style="{
-                    width: worksDetail[sIndex].eList.length ? '45%' : '95%',
-                  }"
-                  v-else-if="worksDetail[sIndex].answerInfo.length > 0"
-                >
-                  <div class="answerbox">
-                    <div style="min-width: 80px">问答标题</div>
-                    <div>
-                      {{ worksDetail[sIndex].answerInfo[0].answerTitle }}
-                    </div>
-                  </div>
-                  <div class="answerbox1">
-                    <div>学生回答</div>
-                    <div>
-                      {{ worksDetail[sIndex].answerInfo[0].answer }}
-                    </div>
-                  </div>
-                </div>
-                <div
-                  class="left_top"
-                  :style="{
-                    width: worksDetail[sIndex].eList.length ? '45%' : '95%',
-                  }"
-                  v-else-if="worksDetail[sIndex].askInfo.length > 0"
-                >
-                  <div>
                     <div
-                      class="a_add_title"
-                      style="
-                        display: flex;
-                        flex-direction: row;
-                        align-items: center;
-                        justify-content: center;
-                        flex-wrap: wrap;
+                      class="thumbnail"
+                      v-if="
+                        worksDetail[sIndex].img &&
+                        worksDetail[sIndex].img.length
                       "
                     >
-                      <div style="margin-right: 20px; font-size: 20px">
-                        标题:
+                      <div
+                        v-for="(item, index) in worksDetail[sIndex].img"
+                        :key="index"
+                        :class="
+                          worksDetail[sIndex].imgIndex == index ? 'isClick' : ''
+                        "
+                      >
+                        <img
+                          :src="item.src"
+                          alt
+                          @click="worksDetail[sIndex].imgIndex = index"
+                        />
+                      </div>
+                    </div>
+                    <div class="work_nopicture" v-else>暂无上传截图</div>
+                  </div>
+                  <div
+                    class="left_top"
+                    :style="{
+                      width: worksDetail[sIndex].eList.length ? '45%' : '95%',
+                    }"
+                    v-if="worksDetail[sIndex].answerInfo.length > 0"
+                  >
+                    <div class="answerbox">
+                      <div style="min-width: 80px">问答标题</div>
+                      <div>
+                        {{ worksDetail[sIndex].answerInfo[0].answerTitle }}
                       </div>
-                      <div style="font-size: 20px">
-                        {{ worksDetail[sIndex].askInfo[0].askTitle }}
+                    </div>
+                    <div class="answerbox1">
+                      <div>学生回答</div>
+                      <div>
+                        {{ worksDetail[sIndex].answerInfo[0].answer }}
                       </div>
                     </div>
-                    <div class="a_addBox">
-                      <div style="font-size: 16px; color: #c7c7c7">内容</div>
+                  </div>
+                  <div
+                    class="left_top"
+                    :style="{
+                      width: worksDetail[sIndex].eList.length ? '45%' : '95%',
+                    }"
+                    v-if="worksDetail[sIndex].askInfo.length > 0"
+                  >
+                    <div>
                       <div
-                        class="a_add_box"
-                        v-for="(item1, index1) in worksDetail[sIndex].askInfo[0]
-                          .askCount"
-                        :key="index1"
+                        class="a_add_title"
+                        style="
+                          display: flex;
+                          flex-direction: row;
+                          align-items: center;
+                          justify-content: center;
+                          flex-wrap: wrap;
+                        "
                       >
-                        <div class="a_add_head">
-                          <div style="display: flex">
-                            {{ index1 + 1 + "、" }}
-                            <div>
-                              题目:{{
-                                worksDetail[sIndex].askInfo[0].askJson[index1]
-                                  .askstitle
-                              }}
+                        <div style="margin-right: 20px; font-size: 20px">
+                          标题:
+                        </div>
+                        <div style="font-size: 20px">
+                          {{ worksDetail[sIndex].askInfo[0].askJson.askTitle }}
+                        </div>
+                      </div>
+                      <div class="a_addBox">
+                        <div style="font-size: 16px; color: #c7c7c7">内容</div>
+                        <div
+                          class="a_add_box"
+                          v-for="(item1, index1) in worksDetail[sIndex]
+                            .askInfo[0].askJson.askCount"
+                          :key="index1"
+                        >
+                          <div class="a_add_head">
+                            <div style="display: flex">
+                              {{ index1 + 1 + "、" }}
+                              <div>
+                                题目:{{
+                                  worksDetail[sIndex].askInfo[0].askJson
+                                    .askJson[index1].askstitle
+                                }}
+                              </div>
                             </div>
                           </div>
-                        </div>
-                        <div class="a_add_body">
-                          <div class="a_add_input">
-                            <el-radio-group
-                              v-model="
-                                worksDetail[sIndex].askInfo[0].radio[index1]
-                              "
-                            >
-                              <el-radio
-                                v-for="(item2, checkIndex) in worksDetail[
-                                  sIndex
-                                ].askInfo[0].askJson[index1].checkList"
-                                :key="checkIndex"
-                                :label="checkIndex"
-                                disabled
-                                class="redioStyle"
-                                ><span v-html="item2"></span
-                              ></el-radio>
-                            </el-radio-group>
+                          <div class="a_add_body">
+                            <div class="a_add_input">
+                              <el-radio-group
+                                v-if="
+                                  worksDetail[sIndex].askInfo[0].askJson
+                                    .askJson[index1].type == '1' ||
+                                  !worksDetail[sIndex].askInfo[0].askJson
+                                    .askJson[index1].type
+                                "
+                                v-model="
+                                  worksDetail[sIndex].askInfo[0].anwer[index1]
+                                "
+                              >
+                                <el-radio
+                                  v-for="(item2, checkIndex) in worksDetail[
+                                    sIndex
+                                  ].askInfo[0].askJson.askJson[index1]
+                                    .checkList"
+                                  :key="checkIndex"
+                                  :label="checkIndex"
+                                  disabled
+                                  class="redioStyle"
+                                  ><span v-html="item2"></span
+                                ></el-radio>
+                              </el-radio-group>
+                              <el-checkbox-group
+                                v-model="
+                                  worksDetail[sIndex].askInfo[0].anwer[index1]
+                                "
+                                v-if="
+                                  worksDetail[sIndex].askInfo[0].askJson
+                                    .askJson[index1].type == '2'
+                                "
+                              >
+                                <el-checkbox
+                                  v-for="(item2, checkIndex1) in worksDetail[
+                                    sIndex
+                                  ].askInfo[0].askJson.askJson[index1]
+                                    .checkList"
+                                  :key="checkIndex1"
+                                  :label="checkIndex1"
+                                  disabled
+                                  class="redioStyle"
+                                  ><span v-html="item2"></span>
+                                </el-checkbox>
+                              </el-checkbox-group>
+                            </div>
                           </div>
                         </div>
                       </div>
                     </div>
                   </div>
-                </div>
-                <div
-                  class="left_top"
-                  :style="{
-                    width: '95%',
-                  }"
-                  v-else-if="worksDetail[sIndex].chooseInfo.length > 0"
-                >
-                  <div>
-                    <div class="a_addBox">
-                      <div style="font-size: 16px; color: #c7c7c7">
-                        题目内容
-                      </div>
+                  <div
+                    class="left_top"
+                    :style="{
+                      width: '95%',
+                    }"
+                    v-if="worksDetail[sIndex].chooseInfo.length > 0"
+                  >
+                    <div>
                       <div
-                        class="a_add_box"
-                        v-for="(item1, index1) in worksDetail[sIndex]
-                          .chooseInfo[0].testCount"
-                        :key="index1"
+                        class="a_add_title"
+                        style="
+                          display: flex;
+                          flex-direction: row;
+                          align-items: center;
+                          justify-content: center;
+                          flex-wrap: wrap;
+                        "
                       >
-                        <div class="a_add_head">
-                          <div style="display: flex">
-                            {{ index1 + 1 + "、" }}
-                            <div>
-                              题目:{{
+                        <div style="font-size: 20px">选择题</div>
+                      </div>
+                      <div class="a_addBox">
+                        <div style="font-size: 16px; color: #c7c7c7">
+                          题目内容
+                        </div>
+                        <div
+                          class="a_add_box"
+                          v-for="(item1, index1) in worksDetail[sIndex]
+                            .chooseInfo[0].testCount"
+                          :key="index1"
+                        >
+                          <div class="a_add_head">
+                            <div style="display: flex">
+                              {{ index1 + 1 + "、" }}
+                              <div>
+                                题目:{{
+                                  worksDetail[sIndex].chooseInfo[0].testJson[
+                                    index1
+                                  ].teststitle
+                                }}
+                              </div>
+                            </div>
+                            <img
+                              v-if="
                                 worksDetail[sIndex].chooseInfo[0].testJson[
                                   index1
-                                ].teststitle
-                              }}
-                            </div>
-                          </div>
-                          <img
-                            v-if="
-                              worksDetail[sIndex].chooseInfo[0].testJson[index1]
-                                .img
-                            "
-                            :src="
-                              worksDetail[sIndex].chooseInfo[0].testJson[index1]
-                                .img
-                            "
-                            style="
-                              height: 300px;
-                              margin-top: 10px;
-                              max-width: 100%;
-                            "
-                          />
-                        </div>
-                        <div class="a_add_body">
-                          <div class="a_add_input">
-                            <el-radio-group
-                              v-model="
-                                worksDetail[sIndex].chooseInfo[0].radio[index1]
+                                ].img
                               "
-                              v-if="
+                              :src="
                                 worksDetail[sIndex].chooseInfo[0].testJson[
                                   index1
-                                ].type == '1'
+                                ].img
                               "
-                            >
-                              <div class="radioBox">
-                                <el-radio
-                                  v-for="(item2, checkIndex) in worksDetail[
-                                    sIndex
-                                  ].chooseInfo[0].testJson[index1].checkList"
-                                  :key="checkIndex"
-                                  :label="checkIndex"
-                                  disabled
-                                  class="redioStyle"
-                                >
-                                  <div
-                                    style="margin-right: 10px"
-                                    v-if="
-                                      item2 &&
-                                      item2.imgType &&
-                                      item2.imgType == 1
-                                    "
+                              style="
+                                height: 300px;
+                                margin-top: 10px;
+                                max-width: 100%;
+                              "
+                            />
+                          </div>
+                          <div class="a_add_body">
+                            <div class="a_add_input">
+                              <el-radio-group
+                                v-model="
+                                  worksDetail[sIndex].chooseInfo[0].radio[
+                                    index1
+                                  ]
+                                "
+                                v-if="
+                                  worksDetail[sIndex].chooseInfo[0].testJson[
+                                    index1
+                                  ].type == '1'
+                                "
+                              >
+                                <div class="radioBox">
+                                  <el-radio
+                                    v-for="(item2, checkIndex) in worksDetail[
+                                      sIndex
+                                    ].chooseInfo[0].testJson[index1].checkList"
+                                    :key="checkIndex"
+                                    :label="checkIndex"
+                                    disabled
+                                    class="redioStyle"
                                   >
                                     <div
-                                      class="inImg"
-                                      @click.stop="previewImg(item2.src)"
+                                      style="margin-right: 10px"
+                                      v-if="
+                                        item2 &&
+                                        item2.imgType &&
+                                        item2.imgType == 1
+                                      "
                                     >
-                                      <img :src="item2.src" alt="" />
+                                      <div
+                                        class="inImg"
+                                        @click.stop="previewImg(item2.src)"
+                                      >
+                                        <img :src="item2.src" alt="" />
+                                      </div>
                                     </div>
-                                  </div>
-                                  <span v-else v-html="item2"></span>
-                                </el-radio>
-                              </div>
-                            </el-radio-group>
-                            <el-checkbox-group
-                              v-model="
-                                worksDetail[sIndex].chooseInfo[0].radio[index1]
-                              "
-                              v-if="
-                                worksDetail[sIndex].chooseInfo[0].testJson[
-                                  index1
-                                ].type == '2'
-                              "
-                            >
-                              <div class="radioBox">
-                                <el-checkbox
-                                  v-for="(item2, checkIndex) in worksDetail[
-                                    sIndex
-                                  ].chooseInfo[0].testJson[index1].checkList"
-                                  :key="checkIndex"
-                                  :label="checkIndex"
-                                  disabled
-                                  class="redioStyle"
-                                >
-                                  <div
-                                    style="margin-right: 10px"
-                                    v-if="
-                                      item2 &&
-                                      item2.imgType &&
-                                      item2.imgType == 1
-                                    "
+                                    <span v-else v-html="item2"></span>
+                                  </el-radio>
+                                </div>
+                              </el-radio-group>
+                              <el-checkbox-group
+                                v-model="
+                                  worksDetail[sIndex].chooseInfo[0].radio[
+                                    index1
+                                  ]
+                                "
+                                v-if="
+                                  worksDetail[sIndex].chooseInfo[0].testJson[
+                                    index1
+                                  ].type == '2'
+                                "
+                              >
+                                <div class="radioBox">
+                                  <el-checkbox
+                                    v-for="(item2, checkIndex) in worksDetail[
+                                      sIndex
+                                    ].chooseInfo[0].testJson[index1].checkList"
+                                    :key="checkIndex"
+                                    :label="checkIndex"
+                                    disabled
+                                    class="redioStyle"
                                   >
                                     <div
-                                      class="inImg"
-                                      @click.stop="previewImg(item2.src)"
+                                      style="margin-right: 10px"
+                                      v-if="
+                                        item2 &&
+                                        item2.imgType &&
+                                        item2.imgType == 1
+                                      "
                                     >
-                                      <img :src="item2.src" alt="" />
+                                      <div
+                                        class="inImg"
+                                        @click.stop="previewImg(item2.src)"
+                                      >
+                                        <img :src="item2.src" alt="" />
+                                      </div>
                                     </div>
-                                  </div>
-                                  <span v-else v-html="item2"></span>
-                                </el-checkbox>
-                              </div>
-                            </el-checkbox-group>
+                                    <span v-else v-html="item2"></span>
+                                  </el-checkbox>
+                                </div>
+                              </el-checkbox-group>
+                            </div>
                           </div>
                         </div>
                       </div>
                     </div>
                   </div>
-                </div>
-                <div
-                  class="left_top"
-                  :style="{
-                    width: worksDetail[sIndex].eList.length ? '45%' : '95%',
-                  }"
-                  v-else-if="worksDetail[sIndex].wpptInfo.length > 0"
-                >
                   <div
-                    style="height: 238px"
-                    @click="openFile(worksDetail[sIndex].wpptInfo[0])"
+                    class="left_top"
+                    :style="{
+                      width: worksDetail[sIndex].eList.length ? '45%' : '95%',
+                    }"
+                    v-if="worksDetail[sIndex].wpptInfo.length > 0"
                   >
                     <div
+                      style="height: 238px"
                       @click="openFile(worksDetail[sIndex].wpptInfo[0])"
-                      style="
-                        width: 300px;
-                        height: 300px;
-                        position: absolute;
-                        z-index: 999;
-                      "
-                    ></div>
-                    <pdf
-                      v-if="showPDF"
-                      :pdfUrl="worksDetail[sIndex].wpptInfo[0]"
-                      style="width: 100%; height: 520px; overflow: auto"
-                    ></pdf>
-                    <iframe
-                      v-else
-                      :src="worksDetail[sIndex].wpptInfo[0]"
-                      frameborder="0"
-                      width="100%"
-                      height="100%"
-                    ></iframe>
-                  </div>
-                </div>
-                <div
-                  class="right_top"
-                  v-show="
-                    worksDetail[sIndex].eList.length &&
-                    (worksDetail[sIndex].img.length > 0 ||
-                      worksDetail[sIndex].askInfo.length > 0 ||
-                      worksDetail[sIndex].answerInfo.length > 0 ||
-                      worksDetail[sIndex].wpptInfo.length > 0)
-                  "
-                >
-                  <div class="ech">
-                    <img src="../../../../assets/icon/pj/ech.png" alt="" />
-                  </div>
-                  <div class="data_body">
-                    <div style="width: 100%">
+                    >
                       <div
-                        class="echart charts_canvas"
-                        style="width: 100%; height: 100%; margin: 0 0 0 1rem"
+                        @click="openFile(worksDetail[sIndex].wpptInfo[0])"
+                        style="
+                          width: 300px;
+                          height: 300px;
+                          position: absolute;
+                          z-index: 999;
+                        "
                       ></div>
+                      <pdf
+                        v-if="showPDF"
+                        :pdfUrl="worksDetail[sIndex].wpptInfo[0]"
+                        style="width: 100%; height: 520px; overflow: auto"
+                      ></pdf>
+                      <iframe
+                        v-else
+                        :src="worksDetail[sIndex].wpptInfo[0]"
+                        frameborder="0"
+                        width="100%"
+                        height="100%"
+                      ></iframe>
+                    </div>
+                  </div>
+                  <div
+                    class="right_top"
+                    v-show="
+                      worksDetail[sIndex].eList.length &&
+                      (worksDetail[sIndex].img.length > 0 ||
+                        worksDetail[sIndex].askInfo.length > 0 ||
+                        worksDetail[sIndex].answerInfo.length > 0 ||
+                        worksDetail[sIndex].wpptInfo.length > 0)
+                    "
+                  >
+                    <div class="ech">
+                      <img src="../../../../assets/icon/pj/ech.png" alt="" />
+                    </div>
+                    <div class="data_body">
+                      <div style="width: 100%">
+                        <div
+                          class="echart charts_canvas"
+                          style="width: 100%; height: 100%; margin: 0 0 0 1rem"
+                        ></div>
+                      </div>
                     </div>
                   </div>
                 </div>
@@ -497,7 +553,7 @@
                   <div class="ech" style="margin-left: 23px">
                     <img src="../../../../assets/icon/pj/score.png" alt="" />
                   </div>
-                  <div style="height: 80%;">
+                  <div style="height: 80%">
                     <div
                       class="score_box"
                       v-for="(item, index) in worksDetail[sIndex].eList"
@@ -1043,14 +1099,100 @@ 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: [],
+                    };
+                    // this.checkJson[k].push({
+                    //   checkCount: [],
+                    //   checkPerson: [],
+                    //   rightPerson: [],
+                    // });
+                  }
+                  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].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;
+                    }
+                    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].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;
+                    }
+                    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++) {
@@ -1377,7 +1519,6 @@ export default {
       });
       //然后异步执行echarts的初始化函数
       newPromise.then(() => {
-
         const chartObj = _this.$echarts.init(
           //劳动课程
           // _this.$el.querySelector("#charts_canvas")
@@ -2554,8 +2695,8 @@ export default {
   background: #fff;
   padding: 15px;
   /* max-height: 400px; */
-  max-height: 160px;
-  overflow: auto;
+  /* max-height: 160px; */
+  /* overflow: auto; */
 }
 
 .a_add_box {
@@ -3119,4 +3260,8 @@ export default {
 .allRightBox {
   padding: 10px 12px;
 }
+.contentAuto {
+  height: 253px;
+  overflow: auto;
+}
 </style>

+ 0 - 1
src/components/pages/components/report/courseRadar.vue

@@ -154,7 +154,6 @@ export default {
           this.vcount = 0;
 
           for (var i = 0; i < workJson.length; i++) {
-            debugger
             if (workJson[i].ptool > workJson[i].tool) {
               workJson[i].work = 100
             } else if( workJson[i].tool === 0){

+ 425 - 278
src/components/pages/components/worksDetail2.vue

@@ -345,329 +345,386 @@
                     </div>
                     <div class="contentBox">
                       <div
-                        class="left_top"
+                        class="contentAuto"
                         :style="{
                           width: worksDetail[sIndex].eList.length
                             ? '45%'
                             : '95%',
                         }"
-                        v-if="worksDetail[sIndex].img.length > 0"
                       >
                         <div
-                          class="bigImg"
-                          v-if="
-                            worksDetail[sIndex].img &&
-                            worksDetail[sIndex].img.length
-                          "
-                        >
-                          <img
-                            @click="
-                              previewImg(
-                                worksDetail[sIndex].img[
-                                  worksDetail[sIndex].imgIndex
-                                ].src
-                              )
-                            "
-                            :src="
-                              worksDetail[sIndex].img[
-                                worksDetail[sIndex].imgIndex
-                              ].src
-                            "
-                            alt
-                          />
-                        </div>
-                        <div
-                          class="thumbnail"
-                          v-if="
-                            worksDetail[sIndex].img &&
-                            worksDetail[sIndex].img.length
-                          "
+                          class="left_top"
+                          :style="{
+                            width: worksDetail[sIndex].eList.length
+                              ? '45%'
+                              : '95%',
+                          }"
+                          v-if="worksDetail[sIndex].img.length > 0"
                         >
                           <div
-                            v-for="(item, index) in worksDetail[sIndex].img"
-                            :key="index"
-                            :class="
-                              worksDetail[sIndex].imgIndex == index
-                                ? 'isClick'
-                                : ''
+                            class="bigImg"
+                            v-if="
+                              worksDetail[sIndex].img &&
+                              worksDetail[sIndex].img.length
                             "
                           >
                             <img
-                              :src="item.src"
+                              @click="
+                                previewImg(
+                                  worksDetail[sIndex].img[
+                                    worksDetail[sIndex].imgIndex
+                                  ].src
+                                )
+                              "
+                              :src="
+                                worksDetail[sIndex].img[
+                                  worksDetail[sIndex].imgIndex
+                                ].src
+                              "
                               alt
-                              @click="worksDetail[sIndex].imgIndex = index"
                             />
                           </div>
-                        </div>
-                        <div class="work_nopicture" v-else>暂无上传截图</div>
-                      </div>
-                      <div
-                        class="left_top"
-                        :style="{
-                          width: worksDetail[sIndex].eList.length
-                            ? '45%'
-                            : '95%',
-                        }"
-                        v-else-if="worksDetail[sIndex].answerInfo.length > 0"
-                      >
-                        <div class="answerbox">
-                          <div style="min-width: 80px">问答标题</div>
-                          <div>
-                            {{ worksDetail[sIndex].answerInfo[0].answerTitle }}
-                          </div>
-                        </div>
-                        <div class="answerbox1">
-                          <div>学生回答</div>
-                          <div>
-                            {{ worksDetail[sIndex].answerInfo[0].answer }}
-                          </div>
-                        </div>
-                      </div>
-                      <div
-                        class="left_top"
-                        :style="{
-                          width: worksDetail[sIndex].eList.length
-                            ? '45%'
-                            : '95%',
-                        }"
-                        v-else-if="worksDetail[sIndex].askInfo.length > 0"
-                      >
-                        <div>
                           <div
-                            class="a_add_title"
-                            style="
-                              display: flex;
-                              flex-direction: row;
-                              align-items: center;
-                              justify-content: center;
-                              flex-wrap: wrap;
+                            class="thumbnail"
+                            v-if="
+                              worksDetail[sIndex].img &&
+                              worksDetail[sIndex].img.length
                             "
                           >
-                            <div style="margin-right: 20px; font-size: 20px">
-                              标题:
+                            <div
+                              v-for="(item, index) in worksDetail[sIndex].img"
+                              :key="index"
+                              :class="
+                                worksDetail[sIndex].imgIndex == index
+                                  ? 'isClick'
+                                  : ''
+                              "
+                            >
+                              <img
+                                :src="item.src"
+                                alt
+                                @click="worksDetail[sIndex].imgIndex = index"
+                              />
                             </div>
-                            <div style="font-size: 20px">
-                              {{ worksDetail[sIndex].askInfo[0].askTitle }}
+                          </div>
+                          <div class="work_nopicture" v-else>暂无上传截图</div>
+                        </div>
+                        <div
+                          class="left_top"
+                          :style="{
+                            width: worksDetail[sIndex].eList.length
+                              ? '45%'
+                              : '95%',
+                          }"
+                          v-if="worksDetail[sIndex].answerInfo.length > 0"
+                        >
+                          <div class="answerbox">
+                            <div style="min-width: 80px">问答标题</div>
+                            <div>
+                              {{
+                                worksDetail[sIndex].answerInfo[0].answerTitle
+                              }}
                             </div>
                           </div>
-                          <div class="a_addBox">
-                            <div style="font-size: 16px; color: #c7c7c7">
-                              内容
+                          <div class="answerbox1">
+                            <div>学生回答</div>
+                            <div>
+                              {{ worksDetail[sIndex].answerInfo[0].answer }}
                             </div>
+                          </div>
+                        </div>
+                        <div
+                          class="left_top"
+                          :style="{
+                            width: worksDetail[sIndex].eList.length
+                              ? '45%'
+                              : '95%',
+                          }"
+                          v-if="worksDetail[sIndex].askInfo.length > 0"
+                        >
+                          <div>
                             <div
-                              class="a_add_box"
-                              v-for="(item1, index1) in worksDetail[sIndex]
-                                .askInfo[0].askCount"
-                              :key="index1"
+                              class="a_add_title"
+                              style="
+                                display: flex;
+                                flex-direction: row;
+                                align-items: center;
+                                justify-content: center;
+                                flex-wrap: wrap;
+                              "
                             >
-                              <div class="a_add_head">
-                                <div style="display: flex">
-                                  {{ index1 + 1 + "、" }}
-                                  <div>
-                                    题目:{{
-                                      worksDetail[sIndex].askInfo[0].askJson[
-                                        index1
-                                      ].askstitle
-                                    }}
+                              <div style="margin-right: 20px; font-size: 20px">
+                                标题:
+                              </div>
+                              <div style="font-size: 20px">
+                                {{
+                                  worksDetail[sIndex].askInfo[0].askJson
+                                    .askTitle
+                                }}
+                              </div>
+                            </div>
+                            <div class="a_addBox">
+                              <div style="font-size: 16px; color: #c7c7c7">
+                                内容
+                              </div>
+                              <div
+                                class="a_add_box"
+                                v-for="(item1, index1) in worksDetail[sIndex]
+                                  .askInfo[0].askJson.askCount"
+                                :key="index1"
+                              >
+                                <div class="a_add_head">
+                                  <div style="display: flex">
+                                    {{ index1 + 1 + "、" }}
+                                    <div>
+                                      题目:{{
+                                        worksDetail[sIndex].askInfo[0].askJson
+                                          .askJson[index1].askstitle
+                                      }}
+                                    </div>
                                   </div>
                                 </div>
-                              </div>
-                              <div class="a_add_body">
-                                <div class="a_add_input">
-                                  <el-radio-group
-                                    v-model="
-                                      worksDetail[sIndex].askInfo[0].radio[
-                                        index1
-                                      ]
-                                    "
-                                  >
-                                    <el-radio
-                                      v-for="(item2, checkIndex) in worksDetail[
-                                        sIndex
-                                      ].askInfo[0].askJson[index1].checkList"
-                                      :key="checkIndex"
-                                      :label="checkIndex"
-                                      disabled
-                                      class="redioStyle"
-                                      ><span v-html="item2"></span
-                                    ></el-radio>
-                                  </el-radio-group>
+                                <div class="a_add_body">
+                                  <div class="a_add_input">
+                                    <el-radio-group
+                                      v-if="
+                                        worksDetail[sIndex].askInfo[0].askJson
+                                          .askJson[index1].type == '1' ||
+                                        !worksDetail[sIndex].askInfo[0].askJson
+                                          .askJson[index1].type
+                                      "
+                                      v-model="
+                                        worksDetail[sIndex].askInfo[0].anwer[
+                                          index1
+                                        ]
+                                      "
+                                    >
+                                      <el-radio
+                                        v-for="(
+                                          item2, checkIndex
+                                        ) in worksDetail[sIndex].askInfo[0]
+                                          .askJson.askJson[index1].checkList"
+                                        :key="checkIndex"
+                                        :label="checkIndex"
+                                        disabled
+                                        class="redioStyle"
+                                        ><span v-html="item2"></span
+                                      ></el-radio>
+                                    </el-radio-group>
+                                    <el-checkbox-group
+                                      v-model="
+                                        worksDetail[sIndex].askInfo[0].anwer[
+                                          index1
+                                        ]
+                                      "
+                                      v-if="
+                                        worksDetail[sIndex].askInfo[0].askJson
+                                          .askJson[index1].type == '2'
+                                      "
+                                    >
+                                      <el-checkbox
+                                        v-for="(
+                                          item2, checkIndex1
+                                        ) in worksDetail[sIndex].askInfo[0]
+                                          .askJson.askJson[index1].checkList"
+                                        :key="checkIndex1"
+                                        :label="checkIndex1"
+                                        disabled
+                                        class="redioStyle"
+                                        ><span v-html="item2"></span>
+                                      </el-checkbox>
+                                    </el-checkbox-group>
+                                  </div>
                                 </div>
                               </div>
                             </div>
                           </div>
                         </div>
-                      </div>
-                      <div
-                        class="left_top"
-                        :style="{
-                          width: '95%',
-                        }"
-                        v-else-if="worksDetail[sIndex].chooseInfo.length > 0"
-                      >
-                        <div>
-                          <div class="a_addBox">
-                            <div style="font-size: 16px; color: #c7c7c7">
-                              题目内容
-                            </div>
+                        <div
+                          class="left_top"
+                          :style="{
+                            width: '95%',
+                          }"
+                          v-if="worksDetail[sIndex].chooseInfo.length > 0"
+                        >
+                          <div>
                             <div
-                              class="a_add_box"
-                              v-for="(item1, index1) in worksDetail[sIndex]
-                                .chooseInfo[0].testCount"
-                              :key="index1"
+                              class="a_add_title"
+                              style="
+                                display: flex;
+                                flex-direction: row;
+                                align-items: center;
+                                justify-content: center;
+                                flex-wrap: wrap;
+                              "
                             >
-                              <div class="a_add_head">
-                                <div style="display: flex">
-                                  {{ index1 + 1 + "、" }}
-                                  <div>
-                                    题目:{{
-                                      worksDetail[sIndex].chooseInfo[0]
-                                        .testJson[index1].teststitle
-                                    }}
-                                  </div>
-                                </div>
-                                <img
-                                  v-if="
-                                    worksDetail[sIndex].chooseInfo[0].testJson[
-                                      index1
-                                    ].img
-                                  "
-                                  :src="
-                                    worksDetail[sIndex].chooseInfo[0].testJson[
-                                      index1
-                                    ].img
-                                  "
-                                  style="
-                                    height: 300px;
-                                    margin-top: 10px;
-                                    max-width: 100%;
-                                  "
-                                />
+                              <div style="font-size: 20px">选择题</div>
+                            </div>
+                            <div class="a_addBox">
+                              <div style="font-size: 16px; color: #c7c7c7">
+                                题目内容
                               </div>
-                              <div class="a_add_body">
-                                <div class="a_add_input">
-                                  <el-radio-group
-                                    v-model="
-                                      worksDetail[sIndex].chooseInfo[0].radio[
-                                        index1
-                                      ]
-                                    "
+                              <div
+                                class="a_add_box"
+                                v-for="(item1, index1) in worksDetail[sIndex]
+                                  .chooseInfo[0].testCount"
+                                :key="index1"
+                              >
+                                <div class="a_add_head">
+                                  <div style="display: flex">
+                                    {{ index1 + 1 + "、" }}
+                                    <div>
+                                      题目:{{
+                                        worksDetail[sIndex].chooseInfo[0]
+                                          .testJson[index1].teststitle
+                                      }}
+                                    </div>
+                                  </div>
+                                  <img
                                     v-if="
                                       worksDetail[sIndex].chooseInfo[0]
-                                        .testJson[index1].type == '1'
+                                        .testJson[index1].img
                                     "
-                                  >
-                                    <div class="radioBox">
-                                      <el-radio
-                                        v-for="(
-                                          item2, checkIndex
-                                        ) in worksDetail[sIndex].chooseInfo[0]
-                                          .testJson[index1].checkList"
-                                        :key="checkIndex"
-                                        :label="checkIndex"
-                                        disabled
-                                        class="redioStyle"
-                                      >
-                                        <div
-                                          style="margin-right: 10px"
-                                          v-if="
-                                            item2 &&
-                                            item2.imgType &&
-                                            item2.imgType == 1
-                                          "
+                                    :src="
+                                      worksDetail[sIndex].chooseInfo[0]
+                                        .testJson[index1].img
+                                    "
+                                    style="
+                                      height: 300px;
+                                      margin-top: 10px;
+                                      max-width: 100%;
+                                    "
+                                  />
+                                </div>
+                                <div class="a_add_body">
+                                  <div class="a_add_input">
+                                    <el-radio-group
+                                      v-model="
+                                        worksDetail[sIndex].chooseInfo[0].radio[
+                                          index1
+                                        ]
+                                      "
+                                      v-if="
+                                        worksDetail[sIndex].chooseInfo[0]
+                                          .testJson[index1].type == '1'
+                                      "
+                                    >
+                                      <div class="radioBox">
+                                        <el-radio
+                                          v-for="(
+                                            item2, checkIndex
+                                          ) in worksDetail[sIndex].chooseInfo[0]
+                                            .testJson[index1].checkList"
+                                          :key="checkIndex"
+                                          :label="checkIndex"
+                                          disabled
+                                          class="redioStyle"
                                         >
                                           <div
-                                            class="inImg"
-                                            @click.stop="previewImg(item2.src)"
+                                            style="margin-right: 10px"
+                                            v-if="
+                                              item2 &&
+                                              item2.imgType &&
+                                              item2.imgType == 1
+                                            "
                                           >
-                                            <img :src="item2.src" alt="" />
+                                            <div
+                                              class="inImg"
+                                              @click.stop="
+                                                previewImg(item2.src)
+                                              "
+                                            >
+                                              <img :src="item2.src" alt="" />
+                                            </div>
                                           </div>
-                                        </div>
-                                        <span v-else v-html="item2"></span>
-                                      </el-radio>
-                                    </div>
-                                  </el-radio-group>
-                                  <el-checkbox-group
-                                    v-model="
-                                      worksDetail[sIndex].chooseInfo[0].radio[
-                                        index1
-                                      ]
-                                    "
-                                    v-if="
-                                      worksDetail[sIndex].chooseInfo[0]
-                                        .testJson[index1].type == '2'
-                                    "
-                                  >
-                                    <div class="radioBox">
-                                      <el-checkbox
-                                        v-for="(
-                                          item2, checkIndex
-                                        ) in worksDetail[sIndex].chooseInfo[0]
-                                          .testJson[index1].checkList"
-                                        :key="checkIndex"
-                                        :label="checkIndex"
-                                        disabled
-                                        class="redioStyle"
-                                      >
-                                        <div
-                                          style="margin-right: 10px"
-                                          v-if="
-                                            item2 &&
-                                            item2.imgType &&
-                                            item2.imgType == 1
-                                          "
+                                          <span v-else v-html="item2"></span>
+                                        </el-radio>
+                                      </div>
+                                    </el-radio-group>
+                                    <el-checkbox-group
+                                      v-model="
+                                        worksDetail[sIndex].chooseInfo[0].radio[
+                                          index1
+                                        ]
+                                      "
+                                      v-if="
+                                        worksDetail[sIndex].chooseInfo[0]
+                                          .testJson[index1].type == '2'
+                                      "
+                                    >
+                                      <div class="radioBox">
+                                        <el-checkbox
+                                          v-for="(
+                                            item2, checkIndex
+                                          ) in worksDetail[sIndex].chooseInfo[0]
+                                            .testJson[index1].checkList"
+                                          :key="checkIndex"
+                                          :label="checkIndex"
+                                          disabled
+                                          class="redioStyle"
                                         >
                                           <div
-                                            class="inImg"
-                                            @click.stop="previewImg(item2.src)"
+                                            style="margin-right: 10px"
+                                            v-if="
+                                              item2 &&
+                                              item2.imgType &&
+                                              item2.imgType == 1
+                                            "
                                           >
-                                            <img :src="item2.src" alt="" />
+                                            <div
+                                              class="inImg"
+                                              @click.stop="
+                                                previewImg(item2.src)
+                                              "
+                                            >
+                                              <img :src="item2.src" alt="" />
+                                            </div>
                                           </div>
-                                        </div>
-                                        <span v-else v-html="item2"></span>
-                                      </el-checkbox>
-                                    </div>
-                                  </el-checkbox-group>
+                                          <span v-else v-html="item2"></span>
+                                        </el-checkbox>
+                                      </div>
+                                    </el-checkbox-group>
+                                  </div>
                                 </div>
                               </div>
                             </div>
                           </div>
                         </div>
-                      </div>
-                      <div
-                        class="left_top"
-                        :style="{
-                          width: worksDetail[sIndex].eList.length
-                            ? '45%'
-                            : '95%',
-                        }"
-                        v-else-if="worksDetail[sIndex].wpptInfo.length > 0"
-                      >
                         <div
-                          style="height: 238px"
-                          @click="openFile(worksDetail[sIndex].wpptInfo[0])"
+                          class="left_top"
+                          :style="{
+                            width: worksDetail[sIndex].eList.length
+                              ? '45%'
+                              : '95%',
+                          }"
+                          v-if="worksDetail[sIndex].wpptInfo.length > 0"
                         >
                           <div
+                            style="height: 238px"
                             @click="openFile(worksDetail[sIndex].wpptInfo[0])"
-                            style="
-                              width: 300px;
-                              height: 300px;
-                              position: absolute;
-                              z-index: 999;
-                            "
-                          ></div>
-                          <pdf
-                            v-if="showPDF"
-                            :pdfUrl="worksDetail[sIndex].wpptInfo[0]"
-                            style="width: 100%; height: 520px; overflow: auto"
-                          ></pdf>
-                          <iframe
-                            v-else
-                            :src="worksDetail[sIndex].wpptInfo[0]"
-                            frameborder="0"
-                            width="100%"
-                            height="100%"
-                          ></iframe>
+                          >
+                            <div
+                              @click="openFile(worksDetail[sIndex].wpptInfo[0])"
+                              style="
+                                width: 300px;
+                                height: 300px;
+                                position: absolute;
+                                z-index: 999;
+                              "
+                            ></div>
+                            <pdf
+                              v-if="showPDF"
+                              :pdfUrl="worksDetail[sIndex].wpptInfo[0]"
+                              style="width: 100%; height: 520px; overflow: auto"
+                            ></pdf>
+                            <iframe
+                              v-else
+                              :src="worksDetail[sIndex].wpptInfo[0]"
+                              frameborder="0"
+                              width="100%"
+                              height="100%"
+                            ></iframe>
+                          </div>
                         </div>
                       </div>
                       <div
@@ -1394,14 +1451,100 @@ 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.askJson.radio = c;
-                a.askJson.time = element.time;
-                workJson[k].askInfo.push(a.askJson);
+                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: [],
+                    };
+                    // this.checkJson[k].push({
+                    //   checkCount: [],
+                    //   checkPerson: [],
+                    //   rightPerson: [],
+                    // });
+                  }
+                  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].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;
+                    }
+                    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].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;
+                    }
+                    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);
+                    }
+                  }
+                }
+                this.checkJson[k].allRight = isCount / a.radio.length;
               }
             }
             for (var i = 0; i < chooseInfo.length; i++) {
@@ -3007,8 +3150,8 @@ export default {
   background: #fff;
   padding: 15px;
   /* max-height: 400px; */
-  max-height: 160px;
-  overflow: auto;
+  /* max-height: 160px; */
+  /* overflow: auto; */
 }
 
 .a_add_box {
@@ -3603,4 +3746,8 @@ export default {
 .typeCheck > span {
   margin-left: 10px;
 }
+.contentAuto {
+  height: 253px;
+  overflow: auto;
+}
 </style>

+ 421 - 275
src/components/pages/components/worksDetail3.vue

@@ -114,326 +114,382 @@
               </div>
               <div class="contentBox">
                 <div
-                  class="left_top"
+                  class="contentAuto"
                   :style="{
                     width: worksDetail[sIndex].eList.length ? '45%' : '95%',
                   }"
-                  v-if="worksDetail[sIndex].img.length > 0"
                 >
                   <div
-                    class="bigImg"
-                    v-if="
-                      worksDetail[sIndex].img && worksDetail[sIndex].img.length
-                    "
-                  >
-                    <img
-                      @click="
-                        previewImg(
-                          worksDetail[sIndex].img[worksDetail[sIndex].imgIndex]
-                            .src
-                        )
-                      "
-                      :src="
-                        worksDetail[sIndex].img[worksDetail[sIndex].imgIndex]
-                          .src
-                      "
-                      alt
-                    />
-                  </div>
-                  <div
-                    class="thumbnail"
-                    v-if="
-                      worksDetail[sIndex].img && worksDetail[sIndex].img.length
-                    "
+                    class="left_top"
+                    :style="{
+                      width: worksDetail[sIndex].eList.length ? '45%' : '95%',
+                    }"
+                    v-if="worksDetail[sIndex].img.length > 0"
                   >
                     <div
-                      v-for="(item, index) in worksDetail[sIndex].img"
-                      :key="index"
-                      :class="
-                        worksDetail[sIndex].imgIndex == index ? 'isClick' : ''
+                      class="bigImg"
+                      v-if="
+                        worksDetail[sIndex].img &&
+                        worksDetail[sIndex].img.length
                       "
                     >
                       <img
-                        :src="item.src"
+                        @click="
+                          previewImg(
+                            worksDetail[sIndex].img[
+                              worksDetail[sIndex].imgIndex
+                            ].src
+                          )
+                        "
+                        :src="
+                          worksDetail[sIndex].img[worksDetail[sIndex].imgIndex]
+                            .src
+                        "
                         alt
-                        @click="worksDetail[sIndex].imgIndex = index"
                       />
                     </div>
-                  </div>
-                  <div class="work_nopicture" v-else>暂无上传截图</div>
-                </div>
-                <div
-                  class="left_top"
-                  :style="{
-                    width: worksDetail[sIndex].eList.length ? '45%' : '95%',
-                  }"
-                  v-else-if="worksDetail[sIndex].answerInfo.length > 0"
-                >
-                  <div class="answerbox">
-                    <div style="min-width: 80px">问答标题</div>
-                    <div>
-                      {{ worksDetail[sIndex].answerInfo[0].answerTitle }}
-                    </div>
-                  </div>
-                  <div class="answerbox1">
-                    <div>学生回答</div>
-                    <div>
-                      {{ worksDetail[sIndex].answerInfo[0].answer }}
-                    </div>
-                  </div>
-                </div>
-                <div
-                  class="left_top"
-                  :style="{
-                    width: worksDetail[sIndex].eList.length ? '45%' : '95%',
-                  }"
-                  v-else-if="worksDetail[sIndex].askInfo.length > 0"
-                >
-                  <div>
                     <div
-                      class="a_add_title"
-                      style="
-                        display: flex;
-                        flex-direction: row;
-                        align-items: center;
-                        justify-content: center;
-                        flex-wrap: wrap;
+                      class="thumbnail"
+                      v-if="
+                        worksDetail[sIndex].img &&
+                        worksDetail[sIndex].img.length
                       "
                     >
-                      <div style="margin-right: 20px; font-size: 20px">
-                        标题:
+                      <div
+                        v-for="(item, index) in worksDetail[sIndex].img"
+                        :key="index"
+                        :class="
+                          worksDetail[sIndex].imgIndex == index ? 'isClick' : ''
+                        "
+                      >
+                        <img
+                          :src="item.src"
+                          alt
+                          @click="worksDetail[sIndex].imgIndex = index"
+                        />
+                      </div>
+                    </div>
+                    <div class="work_nopicture" v-else>暂无上传截图</div>
+                  </div>
+                  <div
+                    class="left_top"
+                    :style="{
+                      width: worksDetail[sIndex].eList.length ? '45%' : '95%',
+                    }"
+                    v-if="worksDetail[sIndex].answerInfo.length > 0"
+                  >
+                    <div class="answerbox">
+                      <div style="min-width: 80px">问答标题</div>
+                      <div>
+                        {{ worksDetail[sIndex].answerInfo[0].answerTitle }}
                       </div>
-                      <div style="font-size: 20px">
-                        {{ worksDetail[sIndex].askInfo[0].askTitle }}
+                    </div>
+                    <div class="answerbox1">
+                      <div>学生回答</div>
+                      <div>
+                        {{ worksDetail[sIndex].answerInfo[0].answer }}
                       </div>
                     </div>
-                    <div class="a_addBox">
-                      <div style="font-size: 16px; color: #c7c7c7">内容</div>
+                  </div>
+                  <div
+                    class="left_top"
+                    :style="{
+                      width: worksDetail[sIndex].eList.length ? '45%' : '95%',
+                    }"
+                    v-if="worksDetail[sIndex].askInfo.length > 0"
+                  >
+                    <div>
                       <div
-                        class="a_add_box"
-                        v-for="(item1, index1) in worksDetail[sIndex].askInfo[0]
-                          .askCount"
-                        :key="index1"
+                        class="a_add_title"
+                        style="
+                          display: flex;
+                          flex-direction: row;
+                          align-items: center;
+                          justify-content: center;
+                          flex-wrap: wrap;
+                        "
                       >
-                        <div class="a_add_head">
-                          <div style="display: flex">
-                            {{ index1 + 1 + "、" }}
-                            <div>
-                              题目:{{
-                                worksDetail[sIndex].askInfo[0].askJson[index1]
-                                  .askstitle
-                              }}
+                        <div style="margin-right: 20px; font-size: 20px">
+                          标题:
+                        </div>
+                        <div style="font-size: 20px">
+                          {{ worksDetail[sIndex].askInfo[0].askJson.askTitle }}
+                        </div>
+                      </div>
+                      <div class="a_addBox">
+                        <div style="font-size: 16px; color: #c7c7c7">内容</div>
+                        <div
+                          class="a_add_box"
+                          v-for="(item1, index1) in worksDetail[sIndex]
+                            .askInfo[0].askJson.askCount"
+                          :key="index1"
+                        >
+                          <div class="a_add_head">
+                            <div style="display: flex">
+                              {{ index1 + 1 + "、" }}
+                              <div>
+                                题目:{{
+                                  worksDetail[sIndex].askInfo[0].askJson
+                                    .askJson[index1].askstitle
+                                }}
+                              </div>
                             </div>
                           </div>
-                        </div>
-                        <div class="a_add_body">
-                          <div class="a_add_input">
-                            <el-radio-group
-                              v-model="
-                                worksDetail[sIndex].askInfo[0].radio[index1]
-                              "
-                            >
-                              <el-radio
-                                v-for="(item2, checkIndex) in worksDetail[
-                                  sIndex
-                                ].askInfo[0].askJson[index1].checkList"
-                                :key="checkIndex"
-                                :label="checkIndex"
-                                disabled
-                                class="redioStyle"
-                                ><span v-html="item2"></span
-                              ></el-radio>
-                            </el-radio-group>
+                          <div class="a_add_body">
+                            <div class="a_add_input">
+                              <el-radio-group
+                                v-if="
+                                  worksDetail[sIndex].askInfo[0].askJson
+                                    .askJson[index1].type == '1' ||
+                                  !worksDetail[sIndex].askInfo[0].askJson
+                                    .askJson[index1].type
+                                "
+                                v-model="
+                                  worksDetail[sIndex].askInfo[0].anwer[index1]
+                                "
+                              >
+                                <el-radio
+                                  v-for="(item2, checkIndex) in worksDetail[
+                                    sIndex
+                                  ].askInfo[0].askJson.askJson[index1]
+                                    .checkList"
+                                  :key="checkIndex"
+                                  :label="checkIndex"
+                                  disabled
+                                  class="redioStyle"
+                                  ><span v-html="item2"></span
+                                ></el-radio>
+                              </el-radio-group>
+                              <el-checkbox-group
+                                v-model="
+                                  worksDetail[sIndex].askInfo[0].anwer[index1]
+                                "
+                                v-if="
+                                  worksDetail[sIndex].askInfo[0].askJson
+                                    .askJson[index1].type == '2'
+                                "
+                              >
+                                <el-checkbox
+                                  v-for="(item2, checkIndex1) in worksDetail[
+                                    sIndex
+                                  ].askInfo[0].askJson.askJson[index1]
+                                    .checkList"
+                                  :key="checkIndex1"
+                                  :label="checkIndex1"
+                                  disabled
+                                  class="redioStyle"
+                                  ><span v-html="item2"></span>
+                                </el-checkbox>
+                              </el-checkbox-group>
+                            </div>
                           </div>
                         </div>
                       </div>
                     </div>
                   </div>
-                </div>
-                <div
-                  class="left_top"
-                  :style="{
-                    width: '95%',
-                  }"
-                  v-else-if="worksDetail[sIndex].chooseInfo.length > 0"
-                >
-                  <div>
-                    <div class="a_addBox">
-                      <div style="font-size: 16px; color: #c7c7c7">
-                        题目内容
-                      </div>
+                  <div
+                    class="left_top"
+                    :style="{
+                      width: '95%',
+                    }"
+                    v-if="worksDetail[sIndex].chooseInfo.length > 0"
+                  >
+                    <div>
                       <div
-                        class="a_add_box"
-                        v-for="(item1, index1) in worksDetail[sIndex]
-                          .chooseInfo[0].testCount"
-                        :key="index1"
+                        class="a_add_title"
+                        style="
+                          display: flex;
+                          flex-direction: row;
+                          align-items: center;
+                          justify-content: center;
+                          flex-wrap: wrap;
+                        "
                       >
-                        <div class="a_add_head">
-                          <div style="display: flex">
-                            {{ index1 + 1 + "、" }}
-                            <div>
-                              题目:{{
+                        <div style="font-size: 20px">选择题</div>
+                      </div>
+                      <div class="a_addBox">
+                        <div style="font-size: 16px; color: #c7c7c7">
+                          题目内容
+                        </div>
+                        <div
+                          class="a_add_box"
+                          v-for="(item1, index1) in worksDetail[sIndex]
+                            .chooseInfo[0].testCount"
+                          :key="index1"
+                        >
+                          <div class="a_add_head">
+                            <div style="display: flex">
+                              {{ index1 + 1 + "、" }}
+                              <div>
+                                题目:{{
+                                  worksDetail[sIndex].chooseInfo[0].testJson[
+                                    index1
+                                  ].teststitle
+                                }}
+                              </div>
+                            </div>
+                            <img
+                              v-if="
                                 worksDetail[sIndex].chooseInfo[0].testJson[
                                   index1
-                                ].teststitle
-                              }}
-                            </div>
-                          </div>
-                          <img
-                            v-if="
-                              worksDetail[sIndex].chooseInfo[0].testJson[index1]
-                                .img
-                            "
-                            :src="
-                              worksDetail[sIndex].chooseInfo[0].testJson[index1]
-                                .img
-                            "
-                            style="
-                              height: 300px;
-                              margin-top: 10px;
-                              max-width: 100%;
-                            "
-                          />
-                        </div>
-                        <div class="a_add_body">
-                          <div class="a_add_input">
-                            <el-radio-group
-                              v-model="
-                                worksDetail[sIndex].chooseInfo[0].radio[index1]
+                                ].img
                               "
-                              v-if="
+                              :src="
                                 worksDetail[sIndex].chooseInfo[0].testJson[
                                   index1
-                                ].type == '1'
+                                ].img
                               "
-                            >
-                              <div class="radioBox">
-                                <el-radio
-                                  v-for="(item2, checkIndex) in worksDetail[
-                                    sIndex
-                                  ].chooseInfo[0].testJson[index1].checkList"
-                                  :key="checkIndex"
-                                  :label="checkIndex"
-                                  disabled
-                                  class="redioStyle"
-                                >
-                                  <div
-                                    style="margin-right: 10px"
-                                    v-if="
-                                      item2 &&
-                                      item2.imgType &&
-                                      item2.imgType == 1
-                                    "
+                              style="
+                                height: 300px;
+                                margin-top: 10px;
+                                max-width: 100%;
+                              "
+                            />
+                          </div>
+                          <div class="a_add_body">
+                            <div class="a_add_input">
+                              <el-radio-group
+                                v-model="
+                                  worksDetail[sIndex].chooseInfo[0].radio[
+                                    index1
+                                  ]
+                                "
+                                v-if="
+                                  worksDetail[sIndex].chooseInfo[0].testJson[
+                                    index1
+                                  ].type == '1'
+                                "
+                              >
+                                <div class="radioBox">
+                                  <el-radio
+                                    v-for="(item2, checkIndex) in worksDetail[
+                                      sIndex
+                                    ].chooseInfo[0].testJson[index1].checkList"
+                                    :key="checkIndex"
+                                    :label="checkIndex"
+                                    disabled
+                                    class="redioStyle"
                                   >
                                     <div
-                                      class="inImg"
-                                      @click.stop="previewImg(item2.src)"
+                                      style="margin-right: 10px"
+                                      v-if="
+                                        item2 &&
+                                        item2.imgType &&
+                                        item2.imgType == 1
+                                      "
                                     >
-                                      <img :src="item2.src" alt="" />
+                                      <div
+                                        class="inImg"
+                                        @click.stop="previewImg(item2.src)"
+                                      >
+                                        <img :src="item2.src" alt="" />
+                                      </div>
                                     </div>
-                                  </div>
-                                  <span v-else v-html="item2"></span>
-                                </el-radio>
-                              </div>
-                            </el-radio-group>
-                            <el-checkbox-group
-                              v-model="
-                                worksDetail[sIndex].chooseInfo[0].radio[index1]
-                              "
-                              v-if="
-                                worksDetail[sIndex].chooseInfo[0].testJson[
-                                  index1
-                                ].type == '2'
-                              "
-                            >
-                              <div class="radioBox">
-                                <el-checkbox
-                                  v-for="(item2, checkIndex) in worksDetail[
-                                    sIndex
-                                  ].chooseInfo[0].testJson[index1].checkList"
-                                  :key="checkIndex"
-                                  :label="checkIndex"
-                                  disabled
-                                  class="redioStyle"
-                                >
-                                  <div
-                                    style="margin-right: 10px"
-                                    v-if="
-                                      item2 &&
-                                      item2.imgType &&
-                                      item2.imgType == 1
-                                    "
+                                    <span v-else v-html="item2"></span>
+                                  </el-radio>
+                                </div>
+                              </el-radio-group>
+                              <el-checkbox-group
+                                v-model="
+                                  worksDetail[sIndex].chooseInfo[0].radio[
+                                    index1
+                                  ]
+                                "
+                                v-if="
+                                  worksDetail[sIndex].chooseInfo[0].testJson[
+                                    index1
+                                  ].type == '2'
+                                "
+                              >
+                                <div class="radioBox">
+                                  <el-checkbox
+                                    v-for="(item2, checkIndex) in worksDetail[
+                                      sIndex
+                                    ].chooseInfo[0].testJson[index1].checkList"
+                                    :key="checkIndex"
+                                    :label="checkIndex"
+                                    disabled
+                                    class="redioStyle"
                                   >
                                     <div
-                                      class="inImg"
-                                      @click.stop="previewImg(item2.src)"
+                                      style="margin-right: 10px"
+                                      v-if="
+                                        item2 &&
+                                        item2.imgType &&
+                                        item2.imgType == 1
+                                      "
                                     >
-                                      <img :src="item2.src" alt="" />
+                                      <div
+                                        class="inImg"
+                                        @click.stop="previewImg(item2.src)"
+                                      >
+                                        <img :src="item2.src" alt="" />
+                                      </div>
                                     </div>
-                                  </div>
-                                  <span v-else v-html="item2"></span>
-                                </el-checkbox>
-                              </div>
-                            </el-checkbox-group>
+                                    <span v-else v-html="item2"></span>
+                                  </el-checkbox>
+                                </div>
+                              </el-checkbox-group>
+                            </div>
                           </div>
                         </div>
                       </div>
                     </div>
                   </div>
-                </div>
-                <div
-                  class="left_top"
-                  :style="{
-                    width: worksDetail[sIndex].eList.length ? '45%' : '95%',
-                  }"
-                  v-else-if="worksDetail[sIndex].wpptInfo.length > 0"
-                >
                   <div
-                    style="height: 238px"
-                    @click="openFile(worksDetail[sIndex].wpptInfo[0])"
+                    class="left_top"
+                    :style="{
+                      width: worksDetail[sIndex].eList.length ? '45%' : '95%',
+                    }"
+                    v-if="worksDetail[sIndex].wpptInfo.length > 0"
                   >
                     <div
+                      style="height: 238px"
                       @click="openFile(worksDetail[sIndex].wpptInfo[0])"
-                      style="
-                        width: 300px;
-                        height: 300px;
-                        position: absolute;
-                        z-index: 999;
-                      "
-                    ></div>
-                    <pdf
-                      v-if="showPDF"
-                      :pdfUrl="worksDetail[sIndex].wpptInfo[0]"
-                      style="width: 100%; height: 520px; overflow: auto"
-                    ></pdf>
-                    <iframe
-                      v-else
-                      :src="worksDetail[sIndex].wpptInfo[0]"
-                      frameborder="0"
-                      width="100%"
-                      height="100%"
-                    ></iframe>
-                  </div>
-                </div>
-                <div
-                  class="right_top"
-                  v-show="
-                    worksDetail[sIndex].eList.length &&
-                    (worksDetail[sIndex].img.length > 0 ||
-                      worksDetail[sIndex].askInfo.length > 0 ||
-                      worksDetail[sIndex].answerInfo.length > 0 ||
-                      worksDetail[sIndex].wpptInfo.length > 0)
-                  "
-                >
-                  <div class="ech">
-                    <img src="../../../assets/icon/pj/ech.png" alt="" />
-                  </div>
-                  <div class="data_body">
-                    <div style="width: 100%">
+                    >
                       <div
-                        class="echart charts_canvas"
-                        style="width: 100%; height: 100%; margin: 0 0 0 1rem"
+                        @click="openFile(worksDetail[sIndex].wpptInfo[0])"
+                        style="
+                          width: 300px;
+                          height: 300px;
+                          position: absolute;
+                          z-index: 999;
+                        "
                       ></div>
+                      <pdf
+                        v-if="showPDF"
+                        :pdfUrl="worksDetail[sIndex].wpptInfo[0]"
+                        style="width: 100%; height: 520px; overflow: auto"
+                      ></pdf>
+                      <iframe
+                        v-else
+                        :src="worksDetail[sIndex].wpptInfo[0]"
+                        frameborder="0"
+                        width="100%"
+                        height="100%"
+                      ></iframe>
+                    </div>
+                  </div>
+                  <div
+                    class="right_top"
+                    v-show="
+                      worksDetail[sIndex].eList.length &&
+                      (worksDetail[sIndex].img.length > 0 ||
+                        worksDetail[sIndex].askInfo.length > 0 ||
+                        worksDetail[sIndex].answerInfo.length > 0 ||
+                        worksDetail[sIndex].wpptInfo.length > 0)
+                    "
+                  >
+                    <div class="ech">
+                      <img src="../../../assets/icon/pj/ech.png" alt="" />
+                    </div>
+                    <div class="data_body">
+                      <div style="width: 100%">
+                        <div
+                          class="echart charts_canvas"
+                          style="width: 100%; height: 100%; margin: 0 0 0 1rem"
+                        ></div>
+                      </div>
                     </div>
                   </div>
                 </div>
@@ -497,7 +553,7 @@
                   <div class="ech" style="margin-left: 23px">
                     <img src="../../../assets/icon/pj/score.png" alt="" />
                   </div>
-                  <div style="height: 80%;">
+                  <div style="height: 80%">
                     <div
                       class="score_box"
                       v-for="(item, index) in worksDetail[sIndex].eList"
@@ -1043,14 +1099,100 @@ 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: [],
+                    };
+                    // this.checkJson[k].push({
+                    //   checkCount: [],
+                    //   checkPerson: [],
+                    //   rightPerson: [],
+                    // });
+                  }
+                  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].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;
+                    }
+                    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].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;
+                    }
+                    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++) {
@@ -2560,8 +2702,8 @@ export default {
   background: #fff;
   padding: 15px;
   /* max-height: 400px; */
-  max-height: 160px;
-  overflow: auto;
+  /* max-height: 160px; */
+  /* overflow: auto; */
 }
 
 .a_add_box {
@@ -3125,4 +3267,8 @@ export default {
 .allRightBox {
   padding: 10px 12px;
 }
+.contentAuto {
+  height: 253px;
+  overflow: auto;
+}
 </style>

+ 421 - 275
src/components/pages/myReport/components/MyLookComponent/worksDetail3.vue

@@ -114,326 +114,382 @@
               </div>
               <div class="contentBox">
                 <div
-                  class="left_top"
+                  class="contentAuto"
                   :style="{
                     width: worksDetail[sIndex].eList.length ? '45%' : '95%',
                   }"
-                  v-if="worksDetail[sIndex].img.length > 0"
                 >
                   <div
-                    class="bigImg"
-                    v-if="
-                      worksDetail[sIndex].img && worksDetail[sIndex].img.length
-                    "
-                  >
-                    <img
-                      @click="
-                        previewImg(
-                          worksDetail[sIndex].img[worksDetail[sIndex].imgIndex]
-                            .src
-                        )
-                      "
-                      :src="
-                        worksDetail[sIndex].img[worksDetail[sIndex].imgIndex]
-                          .src
-                      "
-                      alt
-                    />
-                  </div>
-                  <div
-                    class="thumbnail"
-                    v-if="
-                      worksDetail[sIndex].img && worksDetail[sIndex].img.length
-                    "
+                    class="left_top"
+                    :style="{
+                      width: worksDetail[sIndex].eList.length ? '45%' : '95%',
+                    }"
+                    v-if="worksDetail[sIndex].img.length > 0"
                   >
                     <div
-                      v-for="(item, index) in worksDetail[sIndex].img"
-                      :key="index"
-                      :class="
-                        worksDetail[sIndex].imgIndex == index ? 'isClick' : ''
+                      class="bigImg"
+                      v-if="
+                        worksDetail[sIndex].img &&
+                        worksDetail[sIndex].img.length
                       "
                     >
                       <img
-                        :src="item.src"
+                        @click="
+                          previewImg(
+                            worksDetail[sIndex].img[
+                              worksDetail[sIndex].imgIndex
+                            ].src
+                          )
+                        "
+                        :src="
+                          worksDetail[sIndex].img[worksDetail[sIndex].imgIndex]
+                            .src
+                        "
                         alt
-                        @click="worksDetail[sIndex].imgIndex = index"
                       />
                     </div>
-                  </div>
-                  <div class="work_nopicture" v-else>暂无上传截图</div>
-                </div>
-                <div
-                  class="left_top"
-                  :style="{
-                    width: worksDetail[sIndex].eList.length ? '45%' : '95%',
-                  }"
-                  v-else-if="worksDetail[sIndex].answerInfo.length > 0"
-                >
-                  <div class="answerbox">
-                    <div style="min-width: 80px">问答标题</div>
-                    <div>
-                      {{ worksDetail[sIndex].answerInfo[0].answerTitle }}
-                    </div>
-                  </div>
-                  <div class="answerbox1">
-                    <div>学生回答</div>
-                    <div>
-                      {{ worksDetail[sIndex].answerInfo[0].answer }}
-                    </div>
-                  </div>
-                </div>
-                <div
-                  class="left_top"
-                  :style="{
-                    width: worksDetail[sIndex].eList.length ? '45%' : '95%',
-                  }"
-                  v-else-if="worksDetail[sIndex].askInfo.length > 0"
-                >
-                  <div>
                     <div
-                      class="a_add_title"
-                      style="
-                        display: flex;
-                        flex-direction: row;
-                        align-items: center;
-                        justify-content: center;
-                        flex-wrap: wrap;
+                      class="thumbnail"
+                      v-if="
+                        worksDetail[sIndex].img &&
+                        worksDetail[sIndex].img.length
                       "
                     >
-                      <div style="margin-right: 20px; font-size: 20px">
-                        标题:
+                      <div
+                        v-for="(item, index) in worksDetail[sIndex].img"
+                        :key="index"
+                        :class="
+                          worksDetail[sIndex].imgIndex == index ? 'isClick' : ''
+                        "
+                      >
+                        <img
+                          :src="item.src"
+                          alt
+                          @click="worksDetail[sIndex].imgIndex = index"
+                        />
+                      </div>
+                    </div>
+                    <div class="work_nopicture" v-else>暂无上传截图</div>
+                  </div>
+                  <div
+                    class="left_top"
+                    :style="{
+                      width: worksDetail[sIndex].eList.length ? '45%' : '95%',
+                    }"
+                    v-if="worksDetail[sIndex].answerInfo.length > 0"
+                  >
+                    <div class="answerbox">
+                      <div style="min-width: 80px">问答标题</div>
+                      <div>
+                        {{ worksDetail[sIndex].answerInfo[0].answerTitle }}
                       </div>
-                      <div style="font-size: 20px">
-                        {{ worksDetail[sIndex].askInfo[0].askTitle }}
+                    </div>
+                    <div class="answerbox1">
+                      <div>学生回答</div>
+                      <div>
+                        {{ worksDetail[sIndex].answerInfo[0].answer }}
                       </div>
                     </div>
-                    <div class="a_addBox">
-                      <div style="font-size: 16px; color: #c7c7c7">内容</div>
+                  </div>
+                  <div
+                    class="left_top"
+                    :style="{
+                      width: worksDetail[sIndex].eList.length ? '45%' : '95%',
+                    }"
+                    v-if="worksDetail[sIndex].askInfo.length > 0"
+                  >
+                    <div>
                       <div
-                        class="a_add_box"
-                        v-for="(item1, index1) in worksDetail[sIndex].askInfo[0]
-                          .askCount"
-                        :key="index1"
+                        class="a_add_title"
+                        style="
+                          display: flex;
+                          flex-direction: row;
+                          align-items: center;
+                          justify-content: center;
+                          flex-wrap: wrap;
+                        "
                       >
-                        <div class="a_add_head">
-                          <div style="display: flex">
-                            {{ index1 + 1 + "、" }}
-                            <div>
-                              题目:{{
-                                worksDetail[sIndex].askInfo[0].askJson[index1]
-                                  .askstitle
-                              }}
+                        <div style="margin-right: 20px; font-size: 20px">
+                          标题:
+                        </div>
+                        <div style="font-size: 20px">
+                          {{ worksDetail[sIndex].askInfo[0].askJson.askTitle }}
+                        </div>
+                      </div>
+                      <div class="a_addBox">
+                        <div style="font-size: 16px; color: #c7c7c7">内容</div>
+                        <div
+                          class="a_add_box"
+                          v-for="(item1, index1) in worksDetail[sIndex]
+                            .askInfo[0].askJson.askCount"
+                          :key="index1"
+                        >
+                          <div class="a_add_head">
+                            <div style="display: flex">
+                              {{ index1 + 1 + "、" }}
+                              <div>
+                                题目:{{
+                                  worksDetail[sIndex].askInfo[0].askJson
+                                    .askJson[index1].askstitle
+                                }}
+                              </div>
                             </div>
                           </div>
-                        </div>
-                        <div class="a_add_body">
-                          <div class="a_add_input">
-                            <el-radio-group
-                              v-model="
-                                worksDetail[sIndex].askInfo[0].radio[index1]
-                              "
-                            >
-                              <el-radio
-                                v-for="(item2, checkIndex) in worksDetail[
-                                  sIndex
-                                ].askInfo[0].askJson[index1].checkList"
-                                :key="checkIndex"
-                                :label="checkIndex"
-                                disabled
-                                class="redioStyle"
-                                ><span v-html="item2"></span
-                              ></el-radio>
-                            </el-radio-group>
+                          <div class="a_add_body">
+                            <div class="a_add_input">
+                              <el-radio-group
+                                v-if="
+                                  worksDetail[sIndex].askInfo[0].askJson
+                                    .askJson[index1].type == '1' ||
+                                  !worksDetail[sIndex].askInfo[0].askJson
+                                    .askJson[index1].type
+                                "
+                                v-model="
+                                  worksDetail[sIndex].askInfo[0].anwer[index1]
+                                "
+                              >
+                                <el-radio
+                                  v-for="(item2, checkIndex) in worksDetail[
+                                    sIndex
+                                  ].askInfo[0].askJson.askJson[index1]
+                                    .checkList"
+                                  :key="checkIndex"
+                                  :label="checkIndex"
+                                  disabled
+                                  class="redioStyle"
+                                  ><span v-html="item2"></span
+                                ></el-radio>
+                              </el-radio-group>
+                              <el-checkbox-group
+                                v-model="
+                                  worksDetail[sIndex].askInfo[0].anwer[index1]
+                                "
+                                v-if="
+                                  worksDetail[sIndex].askInfo[0].askJson
+                                    .askJson[index1].type == '2'
+                                "
+                              >
+                                <el-checkbox
+                                  v-for="(item2, checkIndex1) in worksDetail[
+                                    sIndex
+                                  ].askInfo[0].askJson.askJson[index1]
+                                    .checkList"
+                                  :key="checkIndex1"
+                                  :label="checkIndex1"
+                                  disabled
+                                  class="redioStyle"
+                                  ><span v-html="item2"></span>
+                                </el-checkbox>
+                              </el-checkbox-group>
+                            </div>
                           </div>
                         </div>
                       </div>
                     </div>
                   </div>
-                </div>
-                <div
-                  class="left_top"
-                  :style="{
-                    width: '95%',
-                  }"
-                  v-else-if="worksDetail[sIndex].chooseInfo.length > 0"
-                >
-                  <div>
-                    <div class="a_addBox">
-                      <div style="font-size: 16px; color: #c7c7c7">
-                        题目内容
-                      </div>
+                  <div
+                    class="left_top"
+                    :style="{
+                      width: '95%',
+                    }"
+                    v-if="worksDetail[sIndex].chooseInfo.length > 0"
+                  >
+                    <div>
                       <div
-                        class="a_add_box"
-                        v-for="(item1, index1) in worksDetail[sIndex]
-                          .chooseInfo[0].testCount"
-                        :key="index1"
+                        class="a_add_title"
+                        style="
+                          display: flex;
+                          flex-direction: row;
+                          align-items: center;
+                          justify-content: center;
+                          flex-wrap: wrap;
+                        "
                       >
-                        <div class="a_add_head">
-                          <div style="display: flex">
-                            {{ index1 + 1 + "、" }}
-                            <div>
-                              题目:{{
+                        <div style="font-size: 20px">选择题</div>
+                      </div>
+                      <div class="a_addBox">
+                        <div style="font-size: 16px; color: #c7c7c7">
+                          题目内容
+                        </div>
+                        <div
+                          class="a_add_box"
+                          v-for="(item1, index1) in worksDetail[sIndex]
+                            .chooseInfo[0].testCount"
+                          :key="index1"
+                        >
+                          <div class="a_add_head">
+                            <div style="display: flex">
+                              {{ index1 + 1 + "、" }}
+                              <div>
+                                题目:{{
+                                  worksDetail[sIndex].chooseInfo[0].testJson[
+                                    index1
+                                  ].teststitle
+                                }}
+                              </div>
+                            </div>
+                            <img
+                              v-if="
                                 worksDetail[sIndex].chooseInfo[0].testJson[
                                   index1
-                                ].teststitle
-                              }}
-                            </div>
-                          </div>
-                          <img
-                            v-if="
-                              worksDetail[sIndex].chooseInfo[0].testJson[index1]
-                                .img
-                            "
-                            :src="
-                              worksDetail[sIndex].chooseInfo[0].testJson[index1]
-                                .img
-                            "
-                            style="
-                              height: 300px;
-                              margin-top: 10px;
-                              max-width: 100%;
-                            "
-                          />
-                        </div>
-                        <div class="a_add_body">
-                          <div class="a_add_input">
-                            <el-radio-group
-                              v-model="
-                                worksDetail[sIndex].chooseInfo[0].radio[index1]
+                                ].img
                               "
-                              v-if="
+                              :src="
                                 worksDetail[sIndex].chooseInfo[0].testJson[
                                   index1
-                                ].type == '1'
+                                ].img
                               "
-                            >
-                              <div class="radioBox">
-                                <el-radio
-                                  v-for="(item2, checkIndex) in worksDetail[
-                                    sIndex
-                                  ].chooseInfo[0].testJson[index1].checkList"
-                                  :key="checkIndex"
-                                  :label="checkIndex"
-                                  disabled
-                                  class="redioStyle"
-                                >
-                                  <div
-                                    style="margin-right: 10px"
-                                    v-if="
-                                      item2 &&
-                                      item2.imgType &&
-                                      item2.imgType == 1
-                                    "
+                              style="
+                                height: 300px;
+                                margin-top: 10px;
+                                max-width: 100%;
+                              "
+                            />
+                          </div>
+                          <div class="a_add_body">
+                            <div class="a_add_input">
+                              <el-radio-group
+                                v-model="
+                                  worksDetail[sIndex].chooseInfo[0].radio[
+                                    index1
+                                  ]
+                                "
+                                v-if="
+                                  worksDetail[sIndex].chooseInfo[0].testJson[
+                                    index1
+                                  ].type == '1'
+                                "
+                              >
+                                <div class="radioBox">
+                                  <el-radio
+                                    v-for="(item2, checkIndex) in worksDetail[
+                                      sIndex
+                                    ].chooseInfo[0].testJson[index1].checkList"
+                                    :key="checkIndex"
+                                    :label="checkIndex"
+                                    disabled
+                                    class="redioStyle"
                                   >
                                     <div
-                                      class="inImg"
-                                      @click.stop="previewImg(item2.src)"
+                                      style="margin-right: 10px"
+                                      v-if="
+                                        item2 &&
+                                        item2.imgType &&
+                                        item2.imgType == 1
+                                      "
                                     >
-                                      <img :src="item2.src" alt="" />
+                                      <div
+                                        class="inImg"
+                                        @click.stop="previewImg(item2.src)"
+                                      >
+                                        <img :src="item2.src" alt="" />
+                                      </div>
                                     </div>
-                                  </div>
-                                  <span v-else v-html="item2"></span>
-                                </el-radio>
-                              </div>
-                            </el-radio-group>
-                            <el-checkbox-group
-                              v-model="
-                                worksDetail[sIndex].chooseInfo[0].radio[index1]
-                              "
-                              v-if="
-                                worksDetail[sIndex].chooseInfo[0].testJson[
-                                  index1
-                                ].type == '2'
-                              "
-                            >
-                              <div class="radioBox">
-                                <el-checkbox
-                                  v-for="(item2, checkIndex) in worksDetail[
-                                    sIndex
-                                  ].chooseInfo[0].testJson[index1].checkList"
-                                  :key="checkIndex"
-                                  :label="checkIndex"
-                                  disabled
-                                  class="redioStyle"
-                                >
-                                  <div
-                                    style="margin-right: 10px"
-                                    v-if="
-                                      item2 &&
-                                      item2.imgType &&
-                                      item2.imgType == 1
-                                    "
+                                    <span v-else v-html="item2"></span>
+                                  </el-radio>
+                                </div>
+                              </el-radio-group>
+                              <el-checkbox-group
+                                v-model="
+                                  worksDetail[sIndex].chooseInfo[0].radio[
+                                    index1
+                                  ]
+                                "
+                                v-if="
+                                  worksDetail[sIndex].chooseInfo[0].testJson[
+                                    index1
+                                  ].type == '2'
+                                "
+                              >
+                                <div class="radioBox">
+                                  <el-checkbox
+                                    v-for="(item2, checkIndex) in worksDetail[
+                                      sIndex
+                                    ].chooseInfo[0].testJson[index1].checkList"
+                                    :key="checkIndex"
+                                    :label="checkIndex"
+                                    disabled
+                                    class="redioStyle"
                                   >
                                     <div
-                                      class="inImg"
-                                      @click.stop="previewImg(item2.src)"
+                                      style="margin-right: 10px"
+                                      v-if="
+                                        item2 &&
+                                        item2.imgType &&
+                                        item2.imgType == 1
+                                      "
                                     >
-                                      <img :src="item2.src" alt="" />
+                                      <div
+                                        class="inImg"
+                                        @click.stop="previewImg(item2.src)"
+                                      >
+                                        <img :src="item2.src" alt="" />
+                                      </div>
                                     </div>
-                                  </div>
-                                  <span v-else v-html="item2"></span>
-                                </el-checkbox>
-                              </div>
-                            </el-checkbox-group>
+                                    <span v-else v-html="item2"></span>
+                                  </el-checkbox>
+                                </div>
+                              </el-checkbox-group>
+                            </div>
                           </div>
                         </div>
                       </div>
                     </div>
                   </div>
-                </div>
-                <div
-                  class="left_top"
-                  :style="{
-                    width: worksDetail[sIndex].eList.length ? '45%' : '95%',
-                  }"
-                  v-else-if="worksDetail[sIndex].wpptInfo.length > 0"
-                >
                   <div
-                    style="height: 238px"
-                    @click="openFile(worksDetail[sIndex].wpptInfo[0])"
+                    class="left_top"
+                    :style="{
+                      width: worksDetail[sIndex].eList.length ? '45%' : '95%',
+                    }"
+                    v-if="worksDetail[sIndex].wpptInfo.length > 0"
                   >
                     <div
+                      style="height: 238px"
                       @click="openFile(worksDetail[sIndex].wpptInfo[0])"
-                      style="
-                        width: 300px;
-                        height: 300px;
-                        position: absolute;
-                        z-index: 999;
-                      "
-                    ></div>
-                    <pdf
-                      v-if="showPDF"
-                      :pdfUrl="worksDetail[sIndex].wpptInfo[0]"
-                      style="width: 100%; height: 520px; overflow: auto"
-                    ></pdf>
-                    <iframe
-                      v-else
-                      :src="worksDetail[sIndex].wpptInfo[0]"
-                      frameborder="0"
-                      width="100%"
-                      height="100%"
-                    ></iframe>
-                  </div>
-                </div>
-                <div
-                  class="right_top"
-                  v-show="
-                    worksDetail[sIndex].eList.length &&
-                    (worksDetail[sIndex].img.length > 0 ||
-                      worksDetail[sIndex].askInfo.length > 0 ||
-                      worksDetail[sIndex].answerInfo.length > 0 ||
-                      worksDetail[sIndex].wpptInfo.length > 0)
-                  "
-                >
-                  <div class="ech">
-                    <img src="../../../../../assets/icon/pj/ech.png" alt="" />
-                  </div>
-                  <div class="data_body">
-                    <div style="width: 100%">
+                    >
                       <div
-                        class="echart charts_canvas"
-                        style="width: 100%; height: 100%; margin: 0 0 0 1rem"
+                        @click="openFile(worksDetail[sIndex].wpptInfo[0])"
+                        style="
+                          width: 300px;
+                          height: 300px;
+                          position: absolute;
+                          z-index: 999;
+                        "
                       ></div>
+                      <pdf
+                        v-if="showPDF"
+                        :pdfUrl="worksDetail[sIndex].wpptInfo[0]"
+                        style="width: 100%; height: 520px; overflow: auto"
+                      ></pdf>
+                      <iframe
+                        v-else
+                        :src="worksDetail[sIndex].wpptInfo[0]"
+                        frameborder="0"
+                        width="100%"
+                        height="100%"
+                      ></iframe>
+                    </div>
+                  </div>
+                  <div
+                    class="right_top"
+                    v-show="
+                      worksDetail[sIndex].eList.length &&
+                      (worksDetail[sIndex].img.length > 0 ||
+                        worksDetail[sIndex].askInfo.length > 0 ||
+                        worksDetail[sIndex].answerInfo.length > 0 ||
+                        worksDetail[sIndex].wpptInfo.length > 0)
+                    "
+                  >
+                    <div class="ech">
+                      <img src="../../../../../assets/icon/pj/ech.png" alt="" />
+                    </div>
+                    <div class="data_body">
+                      <div style="width: 100%">
+                        <div
+                          class="echart charts_canvas"
+                          style="width: 100%; height: 100%; margin: 0 0 0 1rem"
+                        ></div>
+                      </div>
                     </div>
                   </div>
                 </div>
@@ -497,7 +553,7 @@
                   <div class="ech" style="margin-left: 23px">
                     <img src="../../../../../assets/icon/pj/score.png" alt="" />
                   </div>
-                  <div style="height: 80%;">
+                  <div style="height: 80%">
                     <div
                       class="score_box"
                       v-for="(item, index) in worksDetail[sIndex].eList"
@@ -1043,14 +1099,100 @@ 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: [],
+                    };
+                    // this.checkJson[k].push({
+                    //   checkCount: [],
+                    //   checkPerson: [],
+                    //   rightPerson: [],
+                    // });
+                  }
+                  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].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;
+                    }
+                    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].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;
+                    }
+                    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++) {
@@ -2560,8 +2702,8 @@ export default {
   background: #fff;
   padding: 15px;
   /* max-height: 400px; */
-  max-height: 160px;
-  overflow: auto;
+  /* max-height: 160px; */
+  /* overflow: auto; */
 }
 
 .a_add_box {
@@ -3125,4 +3267,8 @@ export default {
 .allRightBox {
   padding: 10px 12px;
 }
+.contentAuto {
+  height: 253px;
+  overflow: auto;
+}
 </style>

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