<!--简答题-->
<style>
  .v_shortAnswerQuestion {
    width: 100%;
    margin-bottom: 20px;
  }

  .v_shortAnswerQuestionBold {
    font-weight: bold;
  }

</style>
<template>
  <div class="v_shortAnswerQuestion">
    <div style="display:flex;" v-if="isShowAnswer">
      <div class="v_shortAnswerQuestionBold">答案：</div>
      <div v-html="data.Answer"></div>
    </div>
    <div style="display:flex;" v-if="isOperate">
      <el-input v-model="data.Answer" placeholder="请填写问题答案"> </el-input>
    </div>
    <div v-if="isShowStudentAnswer" style="display:flex;align-items:center;">
      <div class="v_shortAnswerQuestionBold" style="margin:10px 0">考生答案：</div>
      <div v-html="data.StundetAnswer"></div>
    </div>
    <div v-if="isShowStudentAnswer" style="display:flex;;margin-bottom:20px;">
      <q-input v-if="isEditStudentScore" filled v-model="data.StudentScore" label="得分："
        maxlength="20" @input="getQuestionScore" />
      <span v-else class="v_shortAnswerQuestionBold">考生得分：{{data.StudentScore}}</span>
    </div>
    <div style="display:flex;" v-if="isShowAnswer">
      <div class="v_shortAnswerQuestionBold">解析：</div>
      <div v-html="data.AnswerParse"></div>
    </div>
  </div>
</template>
<script>
  export default {
    props: {
      questionObj: {
        type: Object,
      },
      //是否显示答案和解析
      isShowAnswer: {
        type: Boolean,
        default: false,
      },
      //是否可操作(PC端考试使用【可以填写答案】)
      isOperate: {
        type: Boolean,
        default: false,
      },
      //是否显示学生答案
      isShowStudentAnswer: {
        type: Boolean,
        default: false
      },
      //是否可以编辑学生得分
      isEditStudentScore: {
        type: Boolean,
        default: false,
      }
    },
    data() {
      return {
        data: this.questionObj,
      };
    },
    methods: {
      //调用父组件计算学生分数
      getQuestionScore() {
        this.$emit('getScore');
      },
    },
    mounted() {

    },
    watch: {
      isShowAnswer: {
        handler(newValue) {

        },
        deep: true
      },
    }
  };

</script>
