A CLI for converting a graded Moodle quiz saved as an HTML file to a vik.viki quiz wikitext.
- Imports multiple HTML files at once
- Can create a new article on vik.wiki with the generated quiz wikitext and summary pre-filled in the editor
- Can open an existing article on vik.wiki with the summary pre-filled in the editor
- Copies the generated wikitext to the clipboard
- Supports single and multiple choice questions
- Deduplicates questions with the same text
- Asks for correct answers if it can't be determined from a graded question
- Adds the only remaining correct answer automatically if it can be determined from the grade
- Formats LaTeX equations as wikitext
- Creates placeholders for illustrations
- Install Homebrew
- Run the following command in the terminal:
brew install pipx && pipx ensurepath && pipx install moodle-to-vikwikiquiz
moodle-to-vikwikiquiz [--verbose|-v] [--new|-n] [[--grading|-g] grading_method] source_directory parent_article title
Parameters:
new
: Create a new quiz on vik.wiki by automatically opening an edit page for the new article.grading_method
:+
or-
. See https://vik.wiki/wiki/Segítség:Kvíz#Pontozás for further info.source_directory
: The absolute path of the directory where the Moodle quiz HTML files are located. These HTML files should contain the Review page of the quizzes.parent_article
: The article name of the course on vik.wiki.title
: How the quiz should be named on vik.wiki. This usually is in the following form:[course name] kvíz – [exam name]
. (The hyphen and the part after it can be omitted.) This might be an existing article name if the--new
argument is not provided.
Example:
- Convert all Elektronika alapjai Moodle quizzes downloaded to
~/Downloads/downloaded_ELA_quizzes
:moodle-to-vikwikiquiz --new --grading + ~/Downloads/downloaded_ELA_quizzes "Elektronika alapjai" "Elektronika alapjai kvíz"
Always check the output before uploading it to vik.wiki. Upload all images and add their filenames to the quiz manually on vik.wiki.
Run the following command in the terminal:
pipx upgrade-all
If you want this to run automatically, create a cron job:
- Open the
crontab
file:
crontab -e
- Add the following line to the end of the file:
@daily pipx upgrade-all
You may replace @daily
with @weekly
or @monthly
.
This project is licensed under the GNU General Public License v3.0. See the license file (or the GPL-3.0 license tab on GitHub) for its full text.