<commit_before><template>

  <div id="exercise-container">
    <assessment-wrapper
      v-ref:wrapper
      v-if="exercise"
      :item-id="itemId"
      :mastery-model="exercise.mastery_model"
      :mastery-spacing-time="exercise.masterySpacingTime">
      <perseus v-if="item" :item="item"></perseus>
    </assessment-wrapper>
  </div>

</template>


<script>

  module.exports = {
    data: () => ({
      item: undefined,
      exercise: undefined,
      itemId: undefined,
    }),
    methods: {
      setItemId() {
        const items = this.exercise.all_assessment_items;
        const attempts = this.$refs.totalattempts || 0;
        this.itemId = items[attempts % items.length];
        this.$emit('itemIdSet');
      },
      setItemData() {
        this.Kolibri.client(
          `${this.defaultFile.storage_url}${this.itemId}.json`
          ).then((itemResponse) => {
            const itemData = itemResponse.entity.itemData.replace(
              '${aronsfacehere}',
              this.defaultFile.storage_url);
            this.item = JSON.parse(itemData);
          }).catch(function(reason) {
            console.log('Oops, you got rejected: ', reason);
          });
      }
    },
    components: {
      perseus: require('./perseus'),
      assessmentWrapper: require('kolibri/core/vue/components/assessmentWrapper'),
    },
    created() {
      this.Kolibri.client(`${this.defaultFile.storage_url}exercise.json`).then(
        (exerciseResponse) => {
          this.exercise = exerciseResponse.entity;
          this.setItemId();
          this.setItemData();
          this.$emit('assessmentDataLoaded');
        }).catch(function(reason) {
          console.log('Oops, requesting exercise.json got rejected: ', reason);
        });;
    },
    props: [
      'defaultFile',
    ],
  };

</script>


<style lang="stylus" scoped>

  @require '~core-theme.styl'

  #exercise-container
    border: double 3px grey
    height: 100%
    overflow: auto<commit_msg>comply to new changes in kolibri master<commit_after><template>

  <div id="exercise-container">
    <assessment-wrapper
      v-ref:wrapper
      v-if="exercise"
      :item-id="itemId"
      :mastery-model="exercise.mastery_model"
      :mastery-spacing-time="exercise.masterySpacingTime">
      <perseus v-if="item" :item="item"></perseus>
    </assessment-wrapper>
  </div>

</template>


<script>

  module.exports = {
    data: () => ({
      item: undefined,
      exercise: undefined,
      itemId: undefined,
    }),
    methods: {
      setItemId() {
        const items = this.exercise.all_assessment_items;
        const attempts = this.$refs.totalattempts || 0;
        this.itemId = items[attempts % items.length];
        this.$emit('itemIdSet');
      },
      setItemData() {
        this.Kolibri.client(
          `${this.defaultFile.storage_url}${this.itemId}.json`
          ).then((itemResponse) => {
            const itemData = itemResponse.entity.itemData.replace(
              '${aronsfacehere}',
              this.defaultFile.storage_url);
            this.item = JSON.parse(itemData);
          }).catch(function(reason) {
            console.log('Oops, you got rejected: ', reason);
          });
      }
    },
    components: {
      perseus: require('./perseus'),
      assessmentWrapper: require('kolibri/core/assets/src/vue/assessment-wrapper'),
    },
    created() {
      this.Kolibri.client(`${this.defaultFile.storage_url}exercise.json`).then(
        (exerciseResponse) => {
          this.exercise = exerciseResponse.entity;
          this.setItemId();
          this.setItemData();
          this.$emit('assessmentDataLoaded');
        }).catch(function(reason) {
          console.log('Oops, requesting exercise.json got rejected: ', reason);
        });;
    },
    props: [
      'defaultFile',
    ],
  };

</script>


<style lang="stylus" scoped>

  @require '~kolibri/styles/coreTheme'

  #exercise-container
    border: double 3px grey
    height: 100%
    overflow: auto
{'fraction_non_alphanumeric': 0.1492760858711932, 'fraction_numerical': 0.0024962556165751375, 'mean_word_length': 2.3531380753138076, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '522071', 'n_tokens_mistral': 1261, 'n_tokens_neox': 1213, 'n_words': 187}