@@ -11,12 +11,14 @@ public class SpacedRepetitionHelper {
1111 /**
1212 * Verifies that a {@link ai.elimu.model.v2.gson.content.WordGson} has been reviewed (with mastery) 6 times after
1313 * the original {@link WordLearningEventGson}:
14- * • After 1 hour
15- * • After 4 hours
16- * • After 16 hours
17- * • After 64 hours (~3 days)
18- * • After 256 hours (~11 days)
19- * • After 1,024 hours (~43 days)
14+ * • After 4 minutes
15+ * • After 16 minutes
16+ * • After 64 minutes (~1 hour)
17+ * • After 256 minutes (~4 hours)
18+ * • After 1,024 minutes (~17 hours)
19+ * • After 4,096 minutes (~3 days)
20+ * • After 16,384 minutes (~11 days)
21+ * • After 65,536 minutes (~46 days)
2022 *
2123 * If the student fails to demonstrate mastery during an assessment event, the sequence is restarted from the
2224 * beginning.
@@ -34,8 +36,8 @@ public static boolean isReviewPending(WordLearningEventGson wordLearningEventGso
3436 // No reviews have been performed
3537
3638 long milliSecondsPassedSinceWordLearningEvent = Calendar .getInstance ().getTimeInMillis () - wordLearningEventGson .getTime ().getTimeInMillis ();
37- Double hoursPassedSinceWordLearningEvent = Double .valueOf (milliSecondsPassedSinceWordLearningEvent / 1000 / 60 / 60 );
38- if (hoursPassedSinceWordLearningEvent >= 1.00 ) {
39+ Double minutesPassedSinceWordLearningEvent = Double .valueOf (milliSecondsPassedSinceWordLearningEvent / 1000 / 60 );
40+ if (minutesPassedSinceWordLearningEvent >= 4 ) {
3941 isReviewPending = true ;
4042 }
4143 } else {
@@ -59,31 +61,41 @@ public static boolean isReviewPending(WordLearningEventGson wordLearningEventGso
5961
6062 WordAssessmentEventGson previousWordAssessmentEventGson = wordAssessmentEventGsons .get (wordAssessmentEventGsons .size () - 1 );
6163 long milliSecondsPassedSincePreviousAssessmentEvent = Calendar .getInstance ().getTimeInMillis () - previousWordAssessmentEventGson .getTime ().getTimeInMillis ();
62- Double hoursPassedSincePreviousAssessmentEvent = Double .valueOf (milliSecondsPassedSincePreviousAssessmentEvent / 1000 / 60 / 60 );
64+ Double minutesPassedSincePreviousAssessmentEvent = Double .valueOf (milliSecondsPassedSincePreviousAssessmentEvent / 1000 / 60 );
6365
6466 if (numberOfCorrectReviewsInSequence == 1 ) {
6567 // Check if it's time for the 2nd review
66- if (hoursPassedSincePreviousAssessmentEvent >= 4.00 ) {
68+ if (minutesPassedSincePreviousAssessmentEvent >= 16 ) {
6769 isReviewPending = true ;
6870 }
6971 } else if (numberOfCorrectReviewsInSequence == 2 ) {
7072 // Check if it's time for the 3rd review
71- if (hoursPassedSincePreviousAssessmentEvent >= 16.00 ) {
73+ if (minutesPassedSincePreviousAssessmentEvent >= 64 ) {
7274 isReviewPending = true ;
7375 }
7476 } else if (numberOfCorrectReviewsInSequence == 3 ) {
7577 // Check if it's time for the 4th review
76- if (hoursPassedSincePreviousAssessmentEvent >= 64.00 ) {
78+ if (minutesPassedSincePreviousAssessmentEvent >= 256 ) {
7779 isReviewPending = true ;
7880 }
7981 } else if (numberOfCorrectReviewsInSequence == 4 ) {
8082 // Check if it's time for the 5th review
81- if (hoursPassedSincePreviousAssessmentEvent >= 256.00 ) {
83+ if (minutesPassedSincePreviousAssessmentEvent >= 1_024 ) {
8284 isReviewPending = true ;
8385 }
8486 } else if (numberOfCorrectReviewsInSequence == 5 ) {
8587 // Check if it's time for the 6th review
86- if (hoursPassedSincePreviousAssessmentEvent >= 1024.00 ) {
88+ if (minutesPassedSincePreviousAssessmentEvent >= 4_096 ) {
89+ isReviewPending = true ;
90+ }
91+ } else if (numberOfCorrectReviewsInSequence == 6 ) {
92+ // Check if it's time for the 7th review
93+ if (minutesPassedSincePreviousAssessmentEvent >= 16_384 ) {
94+ isReviewPending = true ;
95+ }
96+ } else if (numberOfCorrectReviewsInSequence == 7 ) {
97+ // Check if it's time for the 8th review
98+ if (minutesPassedSincePreviousAssessmentEvent >= 65_536 ) {
8799 isReviewPending = true ;
88100 }
89101 }
0 commit comments