RPVisualArrayChangeResult.fromResults constructor

RPVisualArrayChangeResult.fromResults(
  1. int wrong,
  2. int right,
  3. List times,
  4. List memoryTimes,
  5. int score,
)

Create a RPVisualArrayChangeResult from a set of results:

  • right: the number of correct answers
  • wrong: the number of wrong answers
  • times: time taken to find the change
  • memoryTimes: time taken to memorize the shapes
  • score: score of the test calculated in model class

Implementation

factory RPVisualArrayChangeResult.fromResults(
  int wrong,
  int right,
  List<dynamic> times,
  List<dynamic> memoryTimes,
  int score,
) {
  var res = RPVisualArrayChangeResult(identifier: 'VisualArrayChangeResults');
  res.results.addAll({'Wrong guesses': wrong});
  res.results.addAll({'Right guesses': right});
  res.results.addAll({'Time taken to memorize': memoryTimes});
  res.results.addAll({'Time taken to guess': times});
  res.results.addAll({'score': score});
  return res;
}