TL;DR: Parser for the current Technisches Hilfswerk theory questions (basic training) into Anki flashcards.
As far as I know the up-to-date questions are currently (15.04.2024) provided in Ilias as Aufgaben_Theorie_2022_3-4.pdf
.
This format is quite useless to learn with.
A better alternative is the online learning website Die Theorie.
This even provides an offline version (which I do not want to install) and the source code (503 Service Unavailable).
Even better in my opinion are tools like Anki. This scripts creates multiple choice flashcards for all questions with relatively little manual preparation necessary.
Assumes Anki installed with the multiple choice addon.
- Prepare input questions. Desired format: text file with separated values ("," and ";" are used in questions, use e.g tabulator as separator instead).
- Visit each topic (Lernabschnitt) like https://www.thw-theorie.de/loesung/abschnitt-1.html
- Replace their tick symbols with "X" via browser developer tools for copy & pasting compatibility
- Open developer tools (e.g. Firefox: press F12)
- Execute the following command in the console:
document.body.innerHTML = document.body.innerHTML.replaceAll('<img src="img/haken.gif" width="16" height="16" alt="X">', "X")
- Copy the tables (which now use "X" for correct answers) into a spreadsheet tool like Google Sheets.
- Once all questions of all topics are pasted into your spreadsheet (without any empty rows!) export the file as (my recommendation) tab-separated value file (.tsv)
- Parse questions into an Anki compatible format by executing the python script
python3 parser.py
- variables at the top of the script allow to customize input and output file names and the separator of the input file
- Import questions into Anki
- Enjoy learning efficiently
1.2 Wann wurde das THW gegründet? 1949 A
1950 B X
1956 C
I do not upload my spreadsheet, .tsv or Anki files here as they would get outdated sooner or later. If the format does not change significantly in future question sets, the tool could stay relevant. When the format changes feel free to contribute fixes.