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

const role = inject('role') as string

defineProps<{ node: any }>()

const { userAttrList } = useUserAttr()
</script>

<template>
  <ConfigViewTemplate :node="node">
    <div>
      <el-form-item :label="role === 'student' ? '我的答案' : '学生答案'" style="margin-bottom: 0"></el-form-item>
      <el-form-item v-for="(item, index) in node.data.student?.rules" :key="index" style="margin-left: 30px">
        {{ userAttrList.find(c => c.id === item.attr_id)?.name }}
        =
        {{ item.value }}
      </el-form-item>
    </div>
    <div>
      <el-form-item label="正确答案" style="margin-bottom: 0"></el-form-item>
      <el-form-item v-for="(item, index) in node.data.teacher?.rules" :key="index" style="margin-left: 30px">
        {{ userAttrList.find(c => c.id === item.attr_id)?.name }}
        =
        {{ item.value }}
      </el-form-item>
    </div>
  </ConfigViewTemplate>
</template>
