<template>
  <table class="custom-table">
    <tr>
      <td rowspan="2">题型</td>
      <td rowspan="2">题量</td>
      <td rowspan="2">满分</td>
      <td rowspan="2">差异系数</td>
      <td colspan="3">优</td>
      <td colspan="3">良</td>
      <td colspan="3">可</td>
      <td colspan="3">差</td>
    </tr>
    <tr>
      <td>题量</td>
      <td>分值</td>
      <td>%</td>
      <td>题量</td>
      <td>分值</td>
      <td>%</td>
      <td>题量</td>
      <td>分值</td>
      <td>%</td>
      <td>题量</td>
      <td>分值</td>
      <td>%</td>
    </tr>
    <tr v-for="(item2, index) in props.questions" :key="index">
      <td>
        {{ item2.groupName || "全卷" }}
      </td>
      <td>
        {{ item2.questionCount }}
      </td>
      <td>
        {{ item2.totalScore }}
      </td>
      <td v-round-number>
        {{ item2.coefficient }}
      </td>
      <td>
        {{ item2.discriminationLevel.excellent.questionCount }}
      </td>
      <td>
        {{ item2.discriminationLevel.excellent.fullScore }}
      </td>
      <td v-number-to-percent>
        {{ item2.discriminationLevel.excellent.percent }}
      </td>
      <td>
        {{ item2.discriminationLevel.good.questionCount }}
      </td>
      <td>
        {{ item2.discriminationLevel.good.fullScore }}
      </td>
      <td v-number-to-percent>
        {{ item2.discriminationLevel.good.percent }}
      </td>
      <td>
        {{ item2.discriminationLevel.general.questionCount }}
      </td>
      <td>
        {{ item2.discriminationLevel.general.fullScore }}
      </td>
      <td v-number-to-percent>
        {{ item2.discriminationLevel.general.percent }}
      </td>
      <td>
        {{ item2.discriminationLevel.bad.questionCount }}
      </td>
      <td>
        {{ item2.discriminationLevel.bad.fullScore }}
      </td>
      <td v-number-to-percent>
        {{ item2.discriminationLevel.bad.percent }}
      </td>
    </tr>
  </table>
</template>

<script setup lang="ts">
import { SASQuestionGroup } from "@/types";

const props = defineProps<{ questions: SASQuestionGroup[] }>();
</script>
