<commit_before>(function() {
  angular.module('words').factory('sprintManager', ['wordManager', 'config', function(wordManager, config) {
    var current;
    var sprintUrl = config.apiUrl + '/sprint';
    
    var factory = {
      init: function(callback) {
        wordManager.init(sprintUrl, function() {
          factory.onLoad();
          callback();
        });
      },
      onLoad: function() {
        current = wordManager.getWord();
      },
      word: function() {
        return current.word;
      },
      answer: function() {
        return current.guess;
      },
      isCorrect: function(answer) {
        return answer === current.answer;
      },
      next: function() {
        return wordManager.nextWord();
      },
      isLoaded: function() {
        return  angular.isDefined(current);
      },
      clear: function() {
        wordManager.clear();
        current = undefined;
      }
    };

    return factory;
  }]);
}());
<commit_msg>Added logic for sprint quiz<commit_after>(function() {
  angular.module('words').factory('sprintManager', ['wordManager', 'config', function(wordManager, config) {
    var current;
    var sprintUrl = config.apiUrl + '/sprint';

    var factory = {
      init: function(callback) {
        wordManager.init(sprintUrl, function() {
          factory.onLoad();
          callback();
        });
      },
      onLoad: function() {
        current = wordManager.getWord();
      },
      word: function() {
        return current.word;
      },
      answer: function() {
        return current.guess;
      },
      isCorrect: function(answer) {
        var isCorrect = current.translation.indexOf(current.guess) !== -1;
        return answer === isCorrect;
      },
      next: function() {
        return wordManager.nextWord();
      },
      isLoaded: function() {
        return  angular.isDefined(current);
      },
      clear: function() {
        wordManager.clear();
        current = undefined;
      }
    };

    return factory;
  }]);
}());

{'fraction_non_alphanumeric': 0.1441263573543929, 'fraction_numerical': 0.0004935834155972359, 'mean_word_length': 2.0619335347432024, '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': '2198930', 'n_tokens_mistral': 565, 'n_tokens_neox': 556, 'n_words': 112}