FS#11864 - Working LUA Flashcard Program

Attached to Project: Rockbox
Opened by Steve (sbmull) - Friday, 07 January 2011, 17:39 GMT
Task Type Patches
Category Plugins
Status Unconfirmed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Release 3.7.1
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


I have written a basic flashcard program for LUA and am attaching source code and an example data file. I am using a Sansa Clip+ so YMMV. It uses ANKI format text files which are tab delimited txt. You may use UTF8 for the flashcard if you have your device set as such. To use, save the two included text files in the same directory and run. The card data file, Russian.txt, is a typically UTF8 encoded text file exported straight from ANKI with no modifications. I am using a size 8-fixed font in the screen shots.

Things I would like to see done:

1. Making the code more generic to run on all rockbox platforms.

2. If someone would tell me how to play vorbis files from LUA on a clip+, I might be able to implement playing the vocabulary words as they are displayed on the device. I am already parsing the audio file names from the database, but I need a function to play them.

3. If LUA/Rockbox supported SQLite, It might be possible to read and write native ANKI database with scheduling information. This would facilitate programming of advanced flashcard scheduling for efficient learning.

4. A menu to select different databases.

Looking forward to feedback!
This task depends upon

Comment by Ivan Garcia (capiscuas) - Friday, 29 April 2011, 13:57 GMT

I'm using Anki decks and I'd love to see you have some support for .ank files with SQlite, is there any chance in Rockbox? What about the menu with 4 buttons (Bad, Good, Easy, Very Easy?)

Thanks for ur work.
Comment by Steve (sbmull) - Friday, 29 April 2011, 14:17 GMT
Thanks for the reply. Are you using the LUA program I wrote?

There was someone who proposed replacing the native rockbox database with SQlite and had a library built and working in rockbox; but it was C only and not LUA. The program would not be hard to write in C, but the LUA one works fine for me and I am not sure it would be worth the time and effort to link it to SQLite and program the scheduler algorithm. If a better programmer than me wanted to port it to c and use native anki databases, I'd be grateful ;).

I like to do my work on the desktop with anki and then export the cards that are giving me lots of trouble so I can review them on the go. So for me, the LUA program serves as a supplement to the desktop ANKI.

Best Regards!
Comment by Ivan Garcia (capiscuas) - Friday, 29 April 2011, 14:46 GMT

Currently i have no rockbox device so I cannot try out.

I think that exporting the decks into ANKI Text tab separated files is ok too.

Do you implement the functionality to delay cards, fail cards, etc?

Best Regards.
Comment by Steve (sbmull) - Friday, 29 April 2011, 14:54 GMT
At this point, it is simply a yes I know the card or no I do not. If you do not know the card it will review it after you go through the deck and continue till all the cards are know. Simple, but it works.