Sure thing. The algorithm isn’t too dissimilar to the lesson ordering used in the Lesson Picker. Just to be clear the Lesson Picker uses the following lesson ordering:
Subject Level → Subject Type → Subject Lesson Position
That is to say that lower level subjects come before higher level subjects, Radicals come before Kanji, and Kanji come before Vocabulary. We assign a Lesson Position to each subject within a level so that referencing one subject from another ensures you have seen the referenced subject first.
With that bit of background… The Today’s Lessons algorithm works as follows:
- We get all of your available lessons ordering them the same way as mentioned above
- We group the subjects by type, meaning all radicals together, all kanji together and all vocabulary together. The subjects remain ordered in their groupings, that is to say lower level before higher level and honouring the lesson position within each level
- We then use your remaining daily limit to calculate how many of each subject type should be present in your lesson session so that you get a proportional number of subjects for each type. It is probably best to explain this by example. If you have 9 remaining lessons for the day, and you have 10 radicals, 10 kanji, and 10 vocabulary available to learn then your lesson session will contain 3 of each subject type. However if you have 5 radicals, 5 kanji, and 40 vocabulary you would get 1 radical, 1 kanji, and 7 vocabulary in your lesson session.
- We try to ensure that each lesson session has at least one of each subject type if availalble. We also round up the proportional values favouring having more radicals if available and more kanji too.e.g. if you had 10 radicals, 10 kanji, and 30 Vocabulary your lesson session of 9 would consist of 2 radical, 2 kanji, and 5 vocabulary.
- Once we have the proportion of subjects sorted we take that calculated number from each of the subject groups mentioned earlier.
- We then interleave the subjects as best we can to diversify each batch so if you had 2 radicals you would get one in each batch if there were 2 batches. We also interleave the subjects preferring that no 2 subjects of the same type show up next to each other. If you have a lot of one particular subject type we try to disperse them evenly within each batch.
Hopefully that clears things up for you and I haven’t made too much of a hash trying to explain it.