FlatRehearsalAlgorithm 0.1.0-alpha
dotnet add package FlatRehearsalAlgorithm --version 0.1.0-alpha
NuGet\Install-Package FlatRehearsalAlgorithm -Version 0.1.0-alpha
<PackageReference Include="FlatRehearsalAlgorithm" Version="0.1.0-alpha" />
paket add FlatRehearsalAlgorithm --version 0.1.0-alpha
#r "nuget: FlatRehearsalAlgorithm, 0.1.0-alpha"
// Install FlatRehearsalAlgorithm as a Cake Addin #addin nuget:?package=FlatRehearsalAlgorithm&version=0.1.0-alpha&prerelease // Install FlatRehearsalAlgorithm as a Cake Tool #tool nuget:?package=FlatRehearsalAlgorithm&version=0.1.0-alpha&prerelease
FlatRehearsalAlgorithm for C#
FlatRehearsalAlgorithm for C# provides an algorithm for rote learning - memorization of information based on repetition. It is designed for both a small and a great number of pieces of information (let's say 20 items for kids and over a 1000 items for adults). This rehearsal algorithm is called "flat" because no learn item should depend on a specific other learn item before it can be studied - the algorithm treats all learn items as independent. Note however that this algorithm can be used for mastering "layered topics" as well: one set of items (let's say "addition until 10") could be studied first and when the score for that topic is high enough, another topic (let's say "addition until 30") can be studied next by then feeding those other items to the algorithm. Also note that the learn items don't need to be static like lists of words: you can also design learn items that allow generating slightly different content on-the-fly.
This library is in pre-release and still needs to be tested and fine tuned.
An execution timeline
- You or the user of your app provides a list of "learn items" - those can be words from one language to another, names and faces, simple questions about topographic maps, etc.
- For each of those items, you instantiate a
LearnItem
- which inherits the interfaceILearnItem
from this package and you feed all those items to theLearnItemPicker
. Immediately a firstCurrentLearnItem
has been picked that you can display to the user in whatever way fits your app. - When the user has answered, you check whether the user has answered correctly (
100
points), incorrectly (0
points) or you may choose something in between and then you calllearnItem.ProcessNewAnswerScore(score)
- this method sets all properties that theILearnItem
interface has:LastTimeAskedUtcTicks
,ScoreHistory
andScore
. No other interaction with theILearnItem
interface is needed. You could also give the user the option not to process the answer in case of a typo - such things are up to you. Then you calllearnItemPicker.NextLearnItem()
to load another learn item asCurrentLearnItem
. - You can repeat step 3 many times. Because you called
learnItem.ProcessNewAnswerScore(score)
many times now, theLearnItemPicker
will be able to sort and pick items for the user intelligently: if an item has a low score, it will be repeated more often but not too often. Items that seem to be mastered, will almost never be asked but won't be forgotten. - Gradually, more learn items are added to the pool of items that the user studies.
- ...until all items are mastered.
How to use this library
In Visual Studio's Solution Explorer
, right-click a project and click Manage NuGet Packages...
. Browse and install "FlatRehearsalAlgorithm".
Add
using FlatRehearsalAlgorithm;
Then you can declare a class that implements ILearnItem
:
public class MyLearnItem : ILearnItem
{
public anything Id { get; set; }
public anything DummyQuestion { get; set; } // An image? A text with variable parts?
public anything DummyCorrectAnswers { get; set; }
// only the properties below are required:
public long? LastTimeAskedUtcTicks { get; set; }
public int Score { get; set; }
public string? ScoreHistory { get; set; }
}
You can instantiate this class for each item for a one-time rote learn session, but you probably want to store the progress in a database. In the latter case, use varchar(200)
for ScoreHistory
.
Now you have items
and you can feed them to the LearnItemPicker
and play with it:
var learnItemPicker = new LearnItemPicker<MyLearnItem>(items);
var firstItem = learnItemPicker.CurrentLearnItem;
// display first item to the user, get the user's answer, provide feedback, etc.
firstItem.ProcessNewAnswerScore(0);
var secondItem = learnItemPicker.NextLearnItem();
// display second item to the user, get the user's answer, provide feedback, etc.
secondLearnItem.ProcessNewAnswerScore(100);
var thirdItem = learnItemPicker.NextLearnItem();
// etc.
Ask or contribute
- ask questions about anything that is not clear or when you'd like help.
- share ideas or what you've made.
- report a bug.
- request an enhancement.
- open a pull request.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.1.0-alpha | 200 | 2/8/2023 |