soulcharmer / pubquiz_generator

Trivia quiz slide deck generator producing Reveal.js output
1 stars 0 forks source link

multimedia file discovery #3

Open soulcharmer opened 6 years ago

soulcharmer commented 6 years ago

many different multimedia formats can appear in a quiz. (jpg, png, gif, mp4, ogg, ...)

The naming scheme makes it easy to upload the files but manually editing the file extensions is tedious and unnecesary.

Need a file name checker to uncomment Reveal multimedia snippets if a file is present and to edit the extension if needed.

The checker should be smart and allow for ad hoc edits to the multimedia snippets, such as manual changing to dimensions or alt texts in the template. Also, it should comment out snippets if it sees the corresponding file is missing since the last rebuild.

zelial commented 4 years ago

The naming scheme makes it easy to upload the files but manually editing the file extensions is tedious and unnecesary.

What naming scheme? Why and how are you editing extensions? Examples please.

soulcharmer commented 4 years ago

If you have a question specified in YAML like this:

1-1_q1: | How do you say "emergency" in German? Definite article required for full answer. 1-1_a1: | die Not

The feature is to automatically recognize if the entry has some media files for question and answer prepared in the multimedia directory. For example, if you generating a quiz and the script sees files

multimedia/111q.png multimedia/111a.avi

it would recognize the media type and file suffix and add corresponding Reveal.js snippets into the quiz. For images, the snippet is

    <p><img data-src="multimedia/111q.png" height="600" alt="111q" /></p>

For audio files

    <p><audio controls id="sound"><source src="multimedia/111q.ogg"></audio></p>

For video files

    <p><video src="multimedia/111q.mp4" type="video/mp4"></video></p>

Note that answer slides need to also have class="fragment fade-up" as in here:

    <p class="fragment fade-up"><img data-src="multimedia/5-3b.jpg" height="600" alt="add image" /></p>
zelial commented 4 years ago

this conflict with unnumbered questions requested in issue#6

soulcharmer commented 4 years ago

A little bit :) We can make #6 a blocker for this one and then use the generated numbering for the media discovery or figure out another clever way to do it.

First things first though