<commit_before>'use strict';

/* Controllers */

angular.module('flashcardsApp.controllers', [])
  .controller('flashcardCtrl', [
    '$scope', function ($scope) {
      $scope.card = {
        'question': 'Nexus Sausage',
        'answer': 'Fast just got faster with Nexus S.'
      };

      $scope.score = $scope.attempts = 0;
      $scope.scorePct = 100;

      $scope.answerCorrect = function () {
        $scope.score++;
        $scope.attempt();
      }

      $scope.answerWrong = function () {
        $scope.attempt();
      }

      $scope.attempt = function () {
        $scope.attempts++;
        $scope.scorePct = ($scope.score / $scope.attempts) * 100;
      }
    }
  ]);<commit_msg>loop on last card<commit_after>'use strict';

/* Controllers */

angular.module('flashcardsApp.controllers', [])
  .controller('flashcardCtrl', [
    '$scope', function ($scope, $location) {
      $scope.cards = [
        {
          'question': 'Nexus Sausage',
          'answer': 'Fast just got faster with Nexus S.'
        },
        {
          'question': 'Cake ',
          'answer': 'blah'
        },
      ];

      $scope.counter = $scope.score = $scope.attempts = 0;
      $scope.scorePct = 100;

      $scope.answerCorrect = function () {
        $scope.score++;
        $scope.attempt();
      }

      $scope.answerWrong = function () {
        $scope.attempt();
      }

      $scope.attempt = function () {
        $scope.counter++;

        // Wrap around when we go past the last card.
        if ($scope.counter == $scope.cards.length) {
          $scope.counter = 0;
        }

        $scope.attempts++;
        $scope.scorePct = ($scope.score / $scope.attempts) * 100;
      }
    }
  ]);
{'fraction_non_alphanumeric': 0.1654970760233918, 'fraction_numerical': 0.008771929824561403, 'mean_word_length': 1.9148211243611584, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6471849', 'n_tokens_mistral': 566, 'n_tokens_neox': 524, 'n_words': 102}