RPFlankerResult.fromResults constructor

RPFlankerResult.fromResults(
  1. int wrong,
  2. int right,
  3. int time,
  4. int score,
  5. double meanCongruent,
  6. double meanIncongruent,
  7. int numberCardsCongruent,
  8. int numberCardsIncongruent,
)

Create a Flanker Test result based on obtained results.

  • wrong: number of wrong answers
  • right: number of right answers
  • time: time taken to finish the test
  • score: score of the test calculated in model class

Implementation

factory RPFlankerResult.fromResults(
  int wrong,
  int right,
  int time,
  int score,
  double meanCongruent,
  double meanIncongruent,
  int numberCardsCongruent,
  int numberCardsIncongruent,
) {
  var res = RPFlankerResult(identifier: 'FlankerTaskResult');
  res.results.addAll({'wrong swipes': wrong});
  res.results.addAll({'right swipes': right});
  res.results.addAll({'time': time});
  res.results.addAll({'score': score});
  res.results.addAll({'meanCongruent': meanCongruent});
  res.results.addAll({'meanIncongruent': meanIncongruent});
  res.results.addAll({'numberCardsCongruent': numberCardsCongruent});
  res.results.addAll({'numberCardsIncongruent': numberCardsIncongruent});
  return res;
}