Implement an enum LearningMode with the following:
review: will only focus on the already known (seen, practising and learned) resources
learn: will review only today's element and then introduce new words
Implement a KnowledgeRepository that:
can access the user to read/update LearningMode and newResourcesIntroduced
can interact with the database to retrieve the next X elements to review
can determine what the next X elements to review or learn based on (see Learning order system section)
can update the knowledge level in bulk based on a list of KnowledgeUpdate (see Update Knowledge section)
Learning mode
Update the UI:
to show a BottomSheetDialog every Y (for now: 15) new words learned on the same day asking to switch learning mode to review. The mode will be reset to learn the next day.
to have an icon button on the AppBar of to easily switch from learning to review mode and vice-versa
Learning order system
The learning order system determines in which order we need to learn the resources. It's divided into two parts:
levels: a list of resources to learn, it should not have more than 30 resources on it
stages: a list of levels, it should not have more than 10 levels on it
The stages and levels will be built based on the JLPT. It will introduce resources from the same JLPT level and some resources from other JLPT levels.
Rules
A level should not have more than 30 resources
Maximum three (3) resources from a level are introduced at the same time
New resources from the same level are introduced when:
60% of the already seen resources (from the level) have a review gap of 3 days or more
A level is considered finished when:
100% of the resources on it have been seen
60% of the resources have a review gap of 3 days or more
A stage should not have more than 10 levels
A stage is considered finished when:
100% of the levels are finished
80% of the resources in the levels have a review gap of 10 days or more
Determine the next element to review or learn
The method should:
signature:
the number of resources to return, by default 30;
an optional List<ResourceUid> restrain to restrain the possible selection
returns: List<KnowledgeUpdate>
In general, follow this:
retrieve from the database, the resource to review before tomorrow (KnowledgeLevel.next_review) limited to the learning order system
Learning mode:
LearningMode.learn: complete with new elements from either restrain or the learning level system
LearningMode.review:
if restrain is provided go to 3., otherwise complete with any resource to review before tomorrow (including the entire KnowledgeLevel table)
complete with resource ordered by additional_review_before_next_review ASC and next_review ASC, limited to restrain if provided
Flow diagram for the selection of the next elements to review or learn
![Diagrams drawio](https://github.com/RoadTripMoustache/kana_to_kanji/assets/22211097/5997565b-556c-4695-812f-29d05219ba49)
Update KnowledgeLevel
Before updating the KnowledgeLevel.gap and dates, if the current day is review day (today = next_review excluding time):
reset additional_review_before_next_review to 0
last_review = today (time midnight)
Otherwise, increase additional_review_before_next_review by 1.
To calculate the new KnowledgeLevel.gap use the following:
As a developer, I want a central place to interact with the knowledge-level and memorizing algorithm
Requirements
Implement a
KnowledgeLevel
model using Isar and freezed. The schema can be found on https://github.com/RoadTripMoustache/kana_to_kanji_api/issues/15Implement an enum
LearningMode
with the following:review
: will only focus on the already known (seen, practising and learned) resourceslearn
: will review only today's element and then introduce new wordsImplement a
KnowledgeRepository
that:LearningMode
andnewResourcesIntroduced
KnowledgeUpdate
(see Update Knowledge section)Learning mode
Update the UI:
BottomSheetDialog
every Y (for now: 15) new words learned on the same day asking to switch learning mode toreview
. The mode will be reset tolearn
the next day.AppBar
of to easily switch from learning to review mode and vice-versaLearning order system
The learning order system determines in which order we need to learn the resources. It's divided into two parts:
The stages and levels will be built based on the JLPT. It will introduce resources from the same JLPT level and some resources from other JLPT levels.
Rules
A
level
should not have more than 30 resourcesMaximum three (3) resources from a
level
are introduced at the same timeNew resources from the same
level
are introduced when:A
level
is considered finished when:A
stage
should not have more than 10 levelsA
stage
is considered finished when:Determine the next element to review or learn
The method should:
List<ResourceUid> restrain
to restrain the possible selectionList<KnowledgeUpdate>
In general, follow this:
KnowledgeLevel.next_review
) limited to the learning order systemLearningMode.learn
: complete with new elements from eitherrestrain
or the learning level systemLearningMode.review
:restrain
is provided go to 3., otherwise complete with any resource to review before tomorrow (including the entireKnowledgeLevel
table)additional_review_before_next_review
ASC andnext_review
ASC, limited torestrain
if providedFlow diagram for the selection of the next elements to review or learn
![Diagrams drawio](https://github.com/RoadTripMoustache/kana_to_kanji/assets/22211097/5997565b-556c-4695-812f-29d05219ba49)Update KnowledgeLevel
Before updating the
KnowledgeLevel.gap
and dates, if the current day is review day (today =next_review
excluding time):additional_review_before_next_review
to 0last_review
= today (time midnight) Otherwise, increaseadditional_review_before_next_review
by 1.To calculate the new
KnowledgeLevel.gap
use the following:Update
KnowledgeLevel.gap
andnext_review
based onnew_cap
.Coefficients:
mitigation_coefficient
: 0.3memorization_coefficient
:grade <= 1
: 01 < grade <= 2
: 0.32 < grade <= 3
: 0.53 < grade
: 0.8A resource knowledge level is considered:
Dependencies
Child of #160
Depends on:
135
167
216
Parent of:
224
225
229
230
226
227
228
231
232
233
271
281
Dev notes