@@ -26,7 +26,7 @@ public class SpacedRepetitionHelper {
2626 * @param wordLearningEventGson The _first_ time a {@link ai.elimu.model.v2.gson.content.WordGson} was learned. If
2727 * there are several {@link WordLearningEventGson}s for the same
2828 * {@link ai.elimu.model.v2.gson.content.WordGson}, the oldest one is used.
29- * @param wordAssessmentEventGsons List of assessments in _ascending_ order, i.e. oldest events are first in the list.
29+ * @param wordAssessmentEventGsons List of assessments in _descending_ order, i.e. most recent events are first in the list.
3030 * @return {@code true} if the {@link ai.elimu.model.v2.gson.content.WordGson} has one or more pending reviews.
3131 */
3232 public static boolean isReviewPending (WordLearningEventGson wordLearningEventGson , List <WordAssessmentEventGson > wordAssessmentEventGsons ) {
@@ -44,7 +44,7 @@ public static boolean isReviewPending(WordLearningEventGson wordLearningEventGso
4444 // At least one review has already been performed
4545
4646 int numberOfCorrectReviewsInSequence = 0 ;
47- for (int i = wordAssessmentEventGsons .size () - 1 ; i >= 0 ; i -- ) {
47+ for (int i = 0 ; i < wordAssessmentEventGsons .size (); i ++ ) {
4848 WordAssessmentEventGson wordAssessmentEventGson = wordAssessmentEventGsons .get (i );
4949 if (wordAssessmentEventGson .getMasteryScore () == 1.00f ) {
5050 numberOfCorrectReviewsInSequence ++;
@@ -59,7 +59,7 @@ public static boolean isReviewPending(WordLearningEventGson wordLearningEventGso
5959 } else {
6060 // The most recent review was mastered
6161
62- WordAssessmentEventGson previousWordAssessmentEventGson = wordAssessmentEventGsons .get (wordAssessmentEventGsons . size () - 1 );
62+ WordAssessmentEventGson previousWordAssessmentEventGson = wordAssessmentEventGsons .get (0 );
6363 long milliSecondsPassedSincePreviousAssessmentEvent = Calendar .getInstance ().getTimeInMillis () - previousWordAssessmentEventGson .getTime ().getTimeInMillis ();
6464 Double minutesPassedSincePreviousAssessmentEvent = Double .valueOf (milliSecondsPassedSincePreviousAssessmentEvent / 1000 / 60 );
6565
0 commit comments