Packaging Lesson Plans

/images/_afb96080-dcb3-4d43-93e4-3fc8dafd1dc1.jpeg

As mentioned here, I recently got some exciting features working in console mode, but now I have to get them working on my phone. Getting the new code there should be easy enough - I can just pull the git repo - but delivering the lesson content is going to be a bit more complicated.

The TUI interface running on Android can already import text documents directly, in either plain text or EPUB formats. It can also use external AI services to create text translations, but it cannot currently generate speech audio from a cloud service, nor can it make use of the translation services built into the phone. Rather than tackle that particular hornet’s nest right now, though, I’d rather just continue building my lesson packs on my laptop. That process already works, but I want to get them onto my phone, because that’s where I’ll actually use them the most. The problem is that a complete lesson pack is made up of more than just one file - often hundreds of files - and I don’t want to send them individually. I need a way to pack them up and deliver them as a cohesive block.

When I talk about a lesson pack, I mean all the files that represent a complete FrankenTongues lesson document. Whether it’s a short poem or an entire novel, that means a file listing the text for every sentence in both L1 (ie English), and one for L2 (norsk), plus a separate audio recording for each sentence, in each of L1, L2, and L2-slow. For reference, Mary Shelley’s Frankenstein has 3,378 sentences, so that’s over 10,000 audio files.

Wondering why I don’t just have one long audio file for each language and play a specific timecode snippet for each sentence? I tried that, but the overhead required by the audio library to open a large file and seek to the correct location added an unacceptable pause that was interfering with the rapid feedback loop of the learning experience. That pause goes away when you cut up the files.

Currently I build the packs as a collection of files on my hard drive, but ingesting it into Frankie requires having all the component files in a specific structure of folders and filenames, in a specific set of formats, coordinated by an FCSV file, which is a Frankie-specific layout of CSV records. I’m thinking I can simply bundle all that up into a structured zip file (renamed to an FZIP) and send that. Since the code already knows how to ingest all those files when they’re spread out in a folder tree, the receiving app could simply unpack the collection into a temp folder and then use the existing FCSV reader to load the lesson content.

I don’t love how much work is currently involved in constructing that collection of folders in the first place, but I can deal with that later. For now, I want to start practicing with the packs I already have, and see how well they work before I invest more time in locking down the format.

Once I’m happy with that, I’d love to move the package creation process into Frankie directly, but that would be a tricky feat, for reasons too complicated to get into today. Maybe I’ll tell you about it in a future update.