<commit_before><template>

  <div id="exercise-container">
    <assessment-wrapper
      id = "assessment-container"
      ref:wrapper
      v-if="exercise"
      :itemId="itemId"
      :masterySpacingTime="exercise.masterySpacingTime"
      :masteryCriterion="exercise.mastery_model"
      @nextquestion="nextQuestion"
    >
      <perseus
        v-if="item"
        :item="item"
        :passRatioM="passRatioM"
        :passRatioN="passRatioN"
        @hinttaken="hintTaken"
        @answerchecked="answerChecked"
        @exercisepassed="exercisePassed"
      ></perseus>
    </assessment-wrapper>
    <div id="attemptprogress-container">
      <exercise-attempts
        class="attemptprogress"
        :waiting="waiting"
        :success="success"
        :numSpaces="passRatioN"
        :log="recentAttempts"
      />
      <p class="message">GOAL: Get <b>{{passRatioM}}</b> check marks showing up!</p>
    </div>
  </div>

</template>


<script>

  const ss = require('seededshuffle');
  const logging = require('kolibri.lib.logging').getLogger(__filename);

  module.exports = {

    data: () => ({
      item: undefined,
      items: undefined,
      exercise: undefined,
      itemId: undefined,
      // how many questions need to get right?
      passRatioM: 4,
      // how many most recent questions taken into account?
      passRatioN: 5,
      waiting: true,
      success: false,
    }),

    computed: {
      recentAttempts() {
        if (!this.pastattempts) {
          return [];
        }
        // map the list of attempt objects to simple strings
        // ordered from first to last
        return this.pastattempts.map(attempt => {
          if (attempt.hinted) {
            return 'hint';
          }
          return attempt.correct ? 'right' : 'wrong';
        }).reverse();
      },
    },

    methods: {
      answerChecked() {
        this.waiting = false;
      },
      hintTaken() {
        this.waiting = false;
      },
      nextQuestion() {
        this.waiting = true;
        this.setItemData();
      },
      exercisePassed() {
        this.success = true;
      },
      loadItemData(attempts) {
        const itemIndex = attempts % this.items.length;<commit_msg>wrap exercise string<commit_after><template>

  <div id="exercise-container">
    <assessment-wrapper
      id = "assessment-container"
      ref:wrapper
      v-if="exercise"
      :itemId="itemId"
      :masterySpacingTime="exercise.masterySpacingTime"
      :masteryCriterion="exercise.mastery_model"
      @nextquestion="nextQuestion"
    >
      <perseus
        v-if="item"
        :item="item"
        :passRatioM="passRatioM"
        :passRatioN="passRatioN"
        @hinttaken="hintTaken"
        @answerchecked="answerChecked"
        @exercisepassed="exercisePassed"
      ></perseus>
    </assessment-wrapper>
    <div id="attemptprogress-container">
      <exercise-attempts
        class="attemptprogress"
        :waiting="waiting"
        :success="success"
        :numSpaces="passRatioN"
        :log="recentAttempts"
      />
      <p class="message">{{ $tr('goal', {count: passRatioM}) }}</p>
    </div>
  </div>

</template>


<script>

  const ss = require('seededshuffle');
  const logging = require('kolibri.lib.logging').getLogger(__filename);

  module.exports = {
    $trNameSpace: 'perseus-renderer',
    $trs: {
      goal: 'Try to get {count, number, integer} {count, plural, one {check mark} other {check marks}} to show up',
    },
    data: () => ({
      item: undefined,
      items: undefined,
      exercise: undefined,
      itemId: undefined,
      // how many questions need to get right?
      passRatioM: 4,
      // how many most recent questions taken into account?
      passRatioN: 5,
      waiting: true,
      success: false,
    }),
    computed: {
      recentAttempts() {
        if (!this.pastattempts) {
          return [];
        }
        // map the list of attempt objects to simple strings
        // ordered from first to last
        return this.pastattempts.map(attempt => {
          if (attempt.hinted) {
            return 'hint';
          }
          return attempt.correct ? 'right' : 'wrong';
        }).reverse();
      },
    },
    methods: {
      answerChecked() {
        this.waiting = false;
      },
      hintTaken() {
        this.waiting = false;
      },
      nextQuestion() {
        this.waiting = true;
        this.setItemData();
      },
      exercisePassed() {
        this.success = true;
      },
      loadItemData(attempts) {
        const itemIndex = attempts % this.items.length;
{'fraction_non_alphanumeric': 0.13050108932461874, 'fraction_numerical': 0.0008714596949891067, 'mean_word_length': 2.1167684996605565, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 37, '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': '5707396', 'n_tokens_mistral': 1417, 'n_tokens_neox': 1355, 'n_words': 280}