<!--填空题-->
<style>
  .fillInQuestion {
    width: 100%;
  }

  .tk_info {
    color: #A8A8B3;
    font-size: 12px;
    line-height: 24px;
    cursor: default;
    margin-top: 20px;
  }

</style>
<template>
  <div class="fillInQuestion">
    <table v-if="data&&data.length>0" class="common_TiTable">
      <tr v-for="(item,index) in data">
        <td style="width:50px;text-align:center;padding-top:8px;">
          第{{index+1}}空</el-checkbox>
        </td>
        <td>
          <div class="InpDIV" style="border:0;margin-top:-2px;" v-html="item.Content"></div>
        </td>
      </tr>
    </table>
    <br />
    <span v-if="setOption.IsMutex==1" style="font-size:13px;">答案顺序打乱也判正确</span>
    <br />
    <div class="tk_info">
      1. 一个空有多种答案时请用";"隔开。如：水;H2O
      </br>
      2. 若试题答案是数字，可设置范围，两个数字之间用"-"。如：1-9，学生填写1到9之间的数字都算正确（包括1和9）
    </div>
  </div>
</template>
<script>
  import UeEditor from '../editor/UeEditor'
  export default {
    props: {
      questionData: {
        type: Array,
      },
      setOption: {
        type: Object,
      }
    },
    components: {
      UeEditor
    },
    data() {
      return {
        data: this.questionData,
      };
    },
    created() {},
    methods: {
      //返回数据到父组件
      returnDataToParent() {
        if (this.data && this.data.length > 0) {
          var answer = "";
          this.data.forEach(item => {
            answer += "★" + item.Content;
          })
          if (answer != "") {
            answer = answer.substring(1);
          }
          this.setOption.Answer = answer;
        }
        this.$emit('getChild', this.data);
      },
    },
    mounted() {

    },
    watch: {
      data: {
        handler(newValue) {
          this.returnDataToParent();
        },
        deep: true
      },
    }
  };

</script>
