<template>
  <CommonMarkHeader
    :isSingleStudent="isSingleStudent"
    :clearTasks="clearTasks"
    showScoreBoard
    :notShowHistoryToggle="true"
  >
    <slot name="taskInfo">
      <div>
        <span class="header-small-text">学号</span>
        <span class="highlight-text">
          {{ store.currentTask?.studentCode ?? "-" }}
        </span>
      </div>
      <div>
        <span class="header-small-text">姓名</span>
        <span class="highlight-text">
          {{ store.currentTask?.studentName ?? "-" }}
        </span>
      </div>
    </slot>
    <span>
      <span class="header-small-text">待复核</span>
      <span class="highlight-text">{{
        store.status.totalCount - store.status.markedCount ?? "-"
      }}</span>
    </span>
  </CommonMarkHeader>
</template>

<script setup lang="ts">
import { clearInspectedTask } from "@/api/inspectPage";
import { store } from "@/store/store";
import { useRoute } from "vue-router";
import CommonMarkHeader from "@/components/CommonMarkHeader.vue";

const route = useRoute();
let isSingleStudent = !!route.query.studentId;
const { studentId, subjectCode } = route.query as {
  studentId: string;
  subjectCode: string;
};

let clearTasks = clearInspectedTask.bind(null, studentId, subjectCode);
</script>
