Blame view

src/views/AnswerResult/detail.vue 2.43 KB
78156aa6   yangzhi   级联菜单
1
2
3
4
  <template>
    <div class="container">
      <h3>{{ info.TestPaperName }}</h3>
      <div class="header-opts">
a63af57c   yangzhi   超哥牛批
5
        <el-button type="text">查看回放</el-button>
78156aa6   yangzhi   级联菜单
6
7
8
9
10
11
12
13
14
      </div>
      <div class="questions">
        <el-card class="box-card" v-for="item in list" :key="item.id">
          <h4>
            <el-tag size="mini" type="success" effect="dark">{{
              item.QuestionClassName
            }}</el-tag>
            【{{ item.subjectName }}】{{ item.subject }}
          </h4>
a63af57c   yangzhi   超哥牛批
15
16
17
18
19
20
21
22
23
24
25
          <div v-if="item.subjectType == 4">
            <audio controls>
              <source :src="BASE_URL + item.answer" />
            </audio>
          </div>
          <ul class="answer-list" v-if="item.subjectType == 1">
            <li
              v-for="i in item.subjectContentObj"
              :key="i.option"
              :class="{ active: item.answer == i.option }"
            >
78156aa6   yangzhi   级联菜单
26
27
28
29
30
31
              <el-tag size="mini" type="primary" effect="dark">{{
                i.option
              }}</el-tag>
              {{ i.optionContent }}
            </li>
          </ul>
a63af57c   yangzhi   超哥牛批
32
33
          <!-- <p v-if="item.subjectType == 1">Ta的答案:{{ item.answer }}</p> -->
          <!-- <p v-if="item.subjectType == 1">正确答案:B</p> -->
78156aa6   yangzhi   级联菜单
34
35
36
37
38
39
40
41
42
43
44
45
46
        </el-card>
      </div>
    </div>
  </template>
  <style lang="scss" scoped>
  .container {
    width: 80%;
    max-width: 1200px;
    min-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
a63af57c   yangzhi   超哥牛批
47
48
49
50
51
52
53
54
    .header-opts {
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 10px;
    }
    .box-card {
      margin-bottom: 20px;
78156aa6   yangzhi   级联菜单
55
56
57
58
    }
    .questions {
      width: 100%;
    }
a63af57c   yangzhi   超哥牛批
59
60
61
62
63
64
65
66
67
68
69
70
    .answer-list {
      display: flex;
      flex-direction: column;
      li {
        list-style: none;
        margin-bottom: 10px;
        padding: 10px 10px;
        &.active {
          border: 2px solid #00c9ff;
          border-radius: 10px;
        }
      }
78156aa6   yangzhi   级联菜单
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
    }
  }
  </style>
  <script>
  import { SelectQuestionBankListForHistoryId } from "@/api/HistoryAnswer";
  export default {
    data() {
      return {
        info: {},
        list: [],
      };
    },
    created() {
      let id = this.$route.query.id;
      this.getDetail(id);
    },
    methods: {
      getDetail(id) {
        SelectQuestionBankListForHistoryId(id).then((res) => {
          let { info, list } = res.data.data;
          this.info = info;
          this.list = list.map((t) => {
            t.subjectContentObj = JSON.parse(t.subjectContent);
            return t;
          });
        });
      },
      getList() {},
    },
  };
  </script>
  <style lang="scss" scoped>
  </style>