闫增涛
2024-05-15 cc232247648ea4cd6b4d3909bb71caea61e388e1
src/components/examinations/index.vue
@@ -1,6 +1,11 @@
<template>
  <div class="examination" v-loading="loading">
    <div v-for="(item, nindex) in cardList" :key="nindex" class="border-box" v-show="item.infoList.length">
    <div
      v-for="(item, nindex) in cardList"
      :key="nindex"
      class="border-box"
      v-show="item.infoList.length"
    >
      <p class="catalogName">
        <span v-if="nindex == 0">一、</span>
        <span v-if="nindex == 1">二、</span>
@@ -23,8 +28,8 @@
                :style="{
                  marginTop: value.questionType == 'completion' ? '12px' : '0',
                }"
                >{{ index + 1 }}. </span
              >
                >{{ index + 1 }}.
              </span>
              <!-- 听力进度条 -->
              <!-- <answerAudioPlayer :audioUrl="value.src" v-show="item.name == '听力题'" /> -->
              <!-- 题干 -->
@@ -207,7 +212,7 @@
          ></TEditorVue> -->
            <el-input
              :disabled="value.isComplete"
              style="width: 90%; margin: 0 auto"
              style="width: 94%; margin: 0 auto"
              v-else-if="value.questionType == 'shortAnswer'"
              type="textarea"
              :rows="6"
@@ -313,8 +318,8 @@
                    <span class="analysisColor"
                      >{{
                        value.isUnfold ? "收起答案和解析" : "查看答案与解析"
                      }} </span
                    >
                      }}
                    </span>
                  </p>
                </div>
                <!-- :class="['analysisDetailBox', value.isUnfold ? 'open' : 'close'].join(' ') -->
@@ -360,18 +365,27 @@
    </div>
    <div class="bottom-btn" v-if="!loading">
      <el-button style="height: 34px; padding: 4px 10px">保存</el-button>
      <el-button style="height: 30px; width: 78px; padding: 4px 10px"
        >保存</el-button
      >
      <el-button
        @click="handleQuestion"
        style="border-color: #1eb9ee; height: 34px; padding: 4px 10px"
        style="
          border-color: #1eb9ee;
          height: 30px;
          width: 78px;
          padding: 4px 10px;
        "
        >提交</el-button
      >
      <el-button @click="redo" style="height: 34px; padding: 4px 10px"
      <el-button
        @click="redo"
        style="height: 30px; width: 78px; padding: 4px 10px"
        >重做</el-button
      >
      <el-button
        @click="openAnswers"
        style="border-color: #1eb9ee; height: 34px; padding: 4px 10px"
        style="border-color: #1eb9ee; height: 30px; padding: 4px 10px"
        >查看答案</el-button
      >
    </div>
@@ -386,12 +400,10 @@
  data() {
    return {
      type: "option",
      cardList: [],
      loading: false,
    };
  },
  mounted() {
  },
  mounted() {},
  methods: {
    // 数组转为字符串方法
    arrayToString(data) {
@@ -451,8 +463,6 @@
      this.$data.loading = false;
    },
    watchParsing(data) {
      debugger
      data.isUnfold = !data.isUnfold;
    },
    // // 获取试卷下题目类型
@@ -700,7 +710,7 @@
    // },
    // 批改题目  (练习,我的做题,我的收藏模式下)
    handleQuestion() {
      const list = this.$props.cardList
      const list = this.$props.cardList;
      for (let index = 0; index < list.length; index++) {
        const item = list[index];
        for (let cindex = 0; cindex < item.infoList.length; cindex++) {
@@ -724,7 +734,7 @@
              citem.questionType == "singleChoice" ||
              citem.questionType == "judge"
            ) {
              if(citem.id == '63825') console.log('i',item);
            if (citem.id == "63825") console.log("i", item);
              citem.isRight = citem.answer == citem.userAnswer;
            } else if (citem.questionType == "shortAnswer") {
              // 简答 翻译
@@ -738,16 +748,14 @@
                  citem.isRight = false;
                } else {
                  citem.isRight = citem.answer.every(
                    (value, index) =>
                      value === citem.userAnswer[index]
                  (value, index) => value === citem.userAnswer[index]
                  );
                }
              }
            }
        }
      }
      this.$props.cardList = list
      this.$props.cardList = list;
      console.log(this.$props.cardList);
    },
  },
@@ -769,14 +777,12 @@
}
.border-box {
  padding-top: 20px;
  border: 2px solid #e9e9e9;
}
.border-box:first-child {
  border-top:2px solid #e9e9e9 ;
  // border: 2px solid #e9e9e9;
}
.questionContent {
  // display: flex;
  // justify-content: center;
  text-indent: 0em !important;
  margin-left: 20px;
  /deep/ .el-textarea__inner:focus {
    border-color: #15c0f2;
@@ -856,6 +862,8 @@
    display: flex;
    align-items: flex-start;
    .questionNum {
      text-indent: 0 !important;
      margin-right: 5px;
      height: 32px;
      line-height: 32px;
      text-align: center;
@@ -946,7 +954,7 @@
}
.analysis {
  margin: 20px 0;
  width:550px;
  width: 94%;
  // margin-left: 12px;
}
.el-collapse {