example.vue
2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<template>
 
  <el-table :data="tableData" border style="width: 100%">
    <el-table-column prop="title" label="题号" align="center"></el-table-column>
    <el-table-column prop="questionType" label="题型" align="center">
      <template slot-scope="scoped">{{
        setSubPro(scoped.row.questionType)
      }}</template>
    </el-table-column>
    <el-table-column prop="answeredNum" label="答题人数" sortable align="center"></el-table-column>
    <el-table-column prop="correctAnswerNum" label="答对人数" sortable align="center"></el-table-column>
    <el-table-column prop="participationRate" label="班级参与度" sortable align="center"><template slot-scope="scoped">{{
      scoped.row.participationRate }}%</template></el-table-column>
    <el-table-column prop="classCorrectRate" label="班级正确率" sortable align="center"><template slot-scope="scoped">{{
      scoped.row.classCorrectRate }}%</template></el-table-column>
    <el-table-column prop="answerCorrectRate" label="已答正确率" sortable align="center"><template slot-scope="scoped">{{
      scoped.row.answerCorrectRate }}%</template></el-table-column>
    <el-table-column prop="correctAnswer" label="正确答案" align="center">
      <template slot-scope="scoped">{{
        scoped.row.correctAnswer == 1 && scoped.row.questionType == 4
        ? "✓"
        : scoped.row.correctAnswer == 2 && scoped.row.questionType == 4
          ? "✗"
          : scoped.row.correctAnswer
      }}</template></el-table-column>
    <el-table-column prop="fallible" label="干扰答案" align="center"><template slot-scope="scoped">{{
      scoped.row.fallible == 1 && scoped.row.questionType == 4
      ? "✓"
      : scoped.row.fallible == 2 && scoped.row.questionType == 4
        ? "✗"
        : scoped.row.fallible
    }}</template></el-table-column>
  </el-table>
</template>
<script>
export default {
  props: {
    tableData: Array,
  },
  data() {
    return {};
  },
  created() { },
  methods: {
    setSubPro(type) {
      let tit;
      switch (type) {
        case 2:
          tit = "单选题";
          break;
        case 3:
          tit = "多选题";
          break;
        case 4:
          tit = "判断题";
          break;
        case 5:
          tit = "主观题";
          break;
        default:
          tit = "其他";
      }
      return tit;
    },
  }
};
</script>