<script setup lang="ts">
import ConfigViewTemplate from '../../ConfigViewTemplate.vue'
import { useGroup } from '../../../composables/useAllData'

const role = inject('role') as string

defineProps<{ node: any }>()

const { groupList } = useGroup()
</script>

<template>
  <ConfigViewTemplate :node="node">
    <el-form-item :label="role === 'student' ? '我的答案' : '学生答案'">
      {{ node.data.student?.in_group === '0' ? '不在群组' : node.data.student?.in_group === '1' ? '不在群组中' : '' }}
      {{ groupList.find(c => c.id === node.data.student?.group_id)?.name }}
    </el-form-item>
    <el-form-item label="正确答案">
      {{ node.data.teacher?.in_group === '0' ? '不在群组' : node.data.teacher?.in_group === '1' ? '不在群组中' : '' }}
      {{ groupList.find(c => c.id === node.data.teacher?.group_id)?.name }}
    </el-form-item>
  </ConfigViewTemplate>
</template>
