<template>
  <div>
    <p>{{intituleQuestion}} (Note sur {{noteDefaut}})</p>
    <p>Réponses possibles : ({{(reponses.length)}}) </p>
    <div v-for="i in reponses.length" :key="i">
      <ul>
        <li>  {{reponses[i-1]}} ({{notes[i-1]}} %)</li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  name: "Question_Numerique",
  props: {
    questionParsee: {}
  },
  data: function () {
    return {
      intituleQuestion: '',
      noteDefaut: '',
      reponses: [],
      notes: [],
      prefixes: ['', '', '', '', '']
    }
  },
  watch: {
    questionParsee: function () {
      if (this.questionParsee.type_question === 'numerical') {



        this.noteDefaut = this.questionParsee.note_defaut
        let div = document.createElement("div");
        div.innerHTML = this.questionParsee.intitule_question;
        this.intituleQuestion = div.innerText
        div.remove()

        //console.log(this.questionParsee)

        this.reponses = this.questionParsee.liste_reponse
        this.notes = this.questionParsee.liste_note

      }
    }
  },
}
</script>

<style scoped>

</style>