makeGuess method

void makeGuess()

Implementation

void makeGuess() {
  if (currentNum > 2) {
    resultsList2 = wordBuffer;
    sWidget.eventLogger.testEnded();
    timesTaken.add(seconds);
    timer?.cancel();
    wordRecallScore = sWidget.activity
        .calculateScore({'wordsList': words, 'resultsList': resultsList2});
    var result = RPWordRecallResult.fromResults(
        words, resultsList1, resultsList2, timesTaken, wordRecallScore);

    sWidget.onResultChange(result.results);
    if (sWidget.activity.includeResults) {
      sWidget.eventLogger.resultsShown();
      setState(() {
        finished = true;
      });
    } else {
      setState(() {
        finished = true;
      });
    }
  } else {
    resultsList1 = wordBuffer;
    wordBuffer = ['', '', '', '', ''];
    timesTaken.add(seconds);
    timer?.cancel();
    resetTest();
  }
}