Carl Worth [Mon, 26 Sep 2011 05:11:04 +0000 (22:11 -0700)]
Remove the enumeration of challenge types.
With the move toward a more general library, I'd like each application
to be able to support its own challenge types, (without the library
being aware of them). We move toward that by having the library simply
store and save a string for the challenge type.
A next step will include the library providing support to load only
categories of a particular challenge type.
Carl Worth [Mon, 26 Sep 2011 04:56:38 +0000 (21:56 -0700)]
Further separation of mnemon main program from mnemon library.
As I'm starting to generate a real interface here, I continue to find
functionality that would violate that interface. Fix this by moving things
up into the main program as necessary to keep the interface fairly clean.
For example, all session-based notions, (such as to_introduce,
to_master, etc.), are now part of a new progress_t within main.c
instead of being part of mnemon_t in the library, (since one program
might have a vey different notion of what a session is than another).
Carl Worth [Mon, 26 Sep 2011 02:53:02 +0000 (19:53 -0700)]
Break mnemon up into a main program and a mnemon "library"
This is in preparation for other programs to start sharing the mnemon
code, (likely as a git submodule, so we don't actually build the code
as an actual library).
Carl Worth [Wed, 8 Apr 2009 00:03:35 +0000 (17:03 -0700)]
Tweak the implementation of to_master
I think the to_master counter got off from some point from its original
purpose, (and probably because I never documented it that well).
Here are my current thoughts and what should be implemented now:
A mnemon session consists of three phases, some of which may be entirely
empty, as follows:
1. The introduction phase
This phase is controlled by the to_introduce counter which is initially
set to 10. It is decremented every time an item is introduced from the
bin with score 0, or (if there is no bin with score 0), every time an
item is introduced from the bin with the lowest non-negative score of
any bin.
2. The mastering phase
This phase is controlled by the to_master counter which is initially
set to 10. It begins at the beginning of the session so can run
concurrently with the introduction phase. The to_master counter is
decremented every time an item with a positive (non-zero) score is
answered correctly. It is also incremented every time an item with
a positive (non-zero) score is answered incorrectly during the
introduction phase. If perfect mastery is demonstrated, the mastering
phase is likely to be complete simultaneous with the introduction
stage. If the user is really struggling with mastery, the mastering
phase will extend long after the introduction phase is over. But
since we never incremeent to_master after the introduction phase is
over, the user cannot build an infinite snowball of to_master items
and have to give up in despair.
3. The solidifying phase
This final phase continues after the mastering phase for as long as
any items with a negative score remain. The idea here is that we
want to quickly give the reinforcement from a missed item in the
current session. Also, there's a bit of a challenge to the user to
demonstrate good mastery of any non-negative items presented so that
the phase actually terminates. It's possible for this phase to extend
for an arbitrary amount of time, but not very likely, (since the
negative items are chosen preferentially and the user will continue
to see the correct answers to them over and over).
Carl Worth [Thu, 2 Apr 2009 15:13:05 +0000 (08:13 -0700)]
Add a new midi challenge type
Doing this instead of the audio type means we can save file size,
(these midi files are much smaller than resulting .wav files), and
also skip once processing step in preparing the files.
Using the -Os option to timidity means that if we have two overlapping
invocations of timidity the second one won't fail due to contention
for /dev/dsp.
Carl Worth [Mon, 30 Mar 2009 01:13:37 +0000 (18:13 -0700)]
Replay audio challenges after the correct answer is shown
This is necessary reinforcement, since unlike the other challenge types,
the original channel is no longer observable when the correct answer
is displayed.
Carl Worth [Sun, 29 Mar 2009 23:23:15 +0000 (16:23 -0700)]
Add support for audio challenges as well.
This will work with anything supported by the play command. It's still
cheesy in that it uses system like the image support, but at least the
audio support doesn't use killall.
Carl Worth [Fri, 27 Mar 2009 22:17:18 +0000 (15:17 -0700)]
Fix bug when there are no new items to introduce
Previously, mnemon would keep challenging infinitely (waiting for 10
new items to be introduced). Instead, we now decrement the to_introduce
counter every time an item is selected from the smallest-number bin.
Carl Worth [Fri, 27 Mar 2009 22:05:08 +0000 (15:05 -0700)]
Add support for image-based challenges
The support right now is extremely cheesy. It depends on two
external programs (xli and killall), and also uses system()
to execute them with the shell (ick). Oh, and it will also
indiscriminately kill any innocent xli processes that happen
to get in the way. Clearly it's a pretty ugly hack.
Carl Worth [Sun, 22 Mar 2009 22:17:08 +0000 (15:17 -0700)]
Add an fsync (Ted T'so would be pleased)
We've been using open;write;close;rename for udpating mnemon files,
but with recent discussion of ext4 failure modes, Ted has taught
that the only reliable way of getting the desired results is to
fsync before the close. That fsync does more than we really want
here, but there's no way to ask for a less heavy version of what
we want.
Carl Worth [Sat, 14 Mar 2009 19:09:24 +0000 (12:09 -0700)]
Print histogram when complete.
This helps the user track progress, and also waits for the user
to press enter before quitting, (useful for when executing
mnemon as the comman within a terminal session, for example).
Carl Worth [Sat, 14 Mar 2009 19:03:19 +0000 (12:03 -0700)]
Add support for timed-response categories
The syntax is, for example 'time = 2.0' in the data file, meaning
that each answer in that category needs to be answered in less than
2.0 seconds or it will be handled as an incorrect answer even if
correct. (Good for practicing multiplication facts, for example.)
Carl Worth [Tue, 15 May 2007 23:34:35 +0000 (16:34 -0700)]
Fix state transition to enter mastery stage
Previously it would only enter the mastery stage when unlearned
became 0, but it would miss entering the stage when unlearned
was already 0 and to_introduce became 0. (That is, if you got
all the newly introduced items right on the first try, you could
then go on to demonstrate mastery of many items without being
credited for them towards the mastery quota.)
Carl Worth [Tue, 15 May 2007 23:25:34 +0000 (16:25 -0700)]
Add support for sequential introduction of a category
This allows a particular category to be configured so that new items
will be introduced in the order they exist in the file, rather than
randomly, (though once an item leaves bin 0 it gets the same random
treatment as all other items).
The behavior is controlled by a new option at the beginning of the
file that looks like this:
order = sequential
If there is no option it will be treated as random, (and when written
out the order option will be set to either sequential or random).
Carl Worth [Mon, 14 May 2007 20:49:09 +0000 (13:49 -0700)]
Ease mastering requirement to not require consecutive success
Formerly, a session would only exit after consecutively demonstrating
mastery of some number of items. This had the affect of skewing the
set positive, and potentially doing a large amount of review without
introducing any new material.
The original intent of the mastery requirement was simply to provide
some review of previously learned material after introducing new
material. So we now simply require some number of items to be mastered,
but we don't require them to be achieved consecutively, (that is,
we don't reset the count at any miss).
Carl Worth [Tue, 17 Apr 2007 21:26:20 +0000 (14:26 -0700)]
Make the program terminate when no items are left to be learned
An item is considered learned once its score goes positive.
The program now runs until no items have a negative score.
If there are fewer than 10 items with a negative score
when it starts, it will introduce some new items from the
pool of items with a score of 0, (otherwise these items
will not be presented).
But items that do have positive scores are always available
to be presented for reinforcement, (and will also go into
the pool of words to be learned before the program terminates
if they are missed).
Carl Worth [Tue, 17 Apr 2007 18:22:57 +0000 (11:22 -0700)]
Eliminate the correct response bonus
As questions get missed repeatedly, they get asked more frequently, to
the point where it is likely to get asked consecutively. At this point,
there really isn't any learning going on, so it's better to give it a
single increment in the count, (leaving it negative), instead of
moving it all the way to +1.
Carl Worth [Tue, 17 Apr 2007 17:37:40 +0000 (10:37 -0700)]
Add interactive querying of items
We select a bin with an expoentially-distributed pseudo-random number,
(so the items that have been misses the most get the most repetition),
then select an item within that bin with a uniformly distributed
random number. After querying the user, the item's count is adjusted
to the next higher/lower positive/negative number if the user's
response is correct/incorrect. And the item is moved into the new
bin based on its count.