A CLI for converting graded Moodle quiz HTMLs to a vik.wiki quiz wikitext
Project description
moodle-to-vikwikiquiz
📖 About
A CLI for converting graded Moodle quizzes saved as HTML files to a vik.viki quiz wikitext.
📥 Installation
✨ Easy
-
If using Linux: follow these steps.
-
Run the following command in the terminal:
pipx install moodle-to-vikwikiquiz
🛠️ Executable zipapp
-
Download the
.pyz
file of the latest release from here. -
Run the following command in the terminal:
python3 moodle-to-vikwikiquiz.pyz [parameters]
🧑💻 Usage
moodle-to-vikwikiquiz [--verbose|-v] [--new|-n] [--recursive|-r] source_path
Parameters:
--new
: Create a new quiz on vik.wiki by automatically opening an edit page for the new article.--recursive
: Import HTML files from the current directory recursively.source_path
: The absolute or relative path of the file or directory where the Moodle quiz HTML files are located. These HTML files should contain the Review page of the quizzes.
Always check and correct the output before submitting it to the wiki! This includes uploading all images and adding their filenames to the quiz manually.
📋 Features
- Imports multiple HTML files at once (recursively, if desired)
- Can open an existing article or create a new one on vik.wiki with the edit summary pre-filled
- Copies the generated wikitext to the clipboard
- Supports true or false, 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
⏫ Updating
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 this line to the beginning of the file:
PATH=~/.local/bin
If there is already a line beginning with
PATH=
, add:~/.local/bin
to the end of it. -
Add the following line to the end of the file:
@daily pipx upgrade-all
You may replace
@daily
with@weekly
or@monthly
.
🧑💻 Development
🏗️ Building
-
Wheels (
.whl
):- Install
build
:python3 -m pip install --upgrade pip pip install build
- Create the wheels:
python3 -m build
- Install
-
zipapp
(.pyz
):- Install
shiv
:pipx install shiv
- Create the executable:
shiv --entry-point moodle_to_vikwikiquiz.main:main --output-file moodle-to-vikwikiquiz.pyz --reproducible .
- Install
📜 License
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file moodle_to_vikwikiquiz-1.2.0.tar.gz
.
File metadata
- Download URL: moodle_to_vikwikiquiz-1.2.0.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a2534e1f2de66094f3d78d58f4fdac6b29626e0a9a493397eba0b93ae49eed9 |
|
MD5 | 67a2758ff509cfd5892c4ea2f8191ef1 |
|
BLAKE2b-256 | fa13e6ac78e69787807f178d10d66f9e9cb6029d500f9e83a2960b25a5185c7d |
File details
Details for the file moodle_to_vikwikiquiz-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: moodle_to_vikwikiquiz-1.2.0-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb762bc5dfd471b1011b01f8886402298a8045e28c1ec2333a86a182f4dad82b |
|
MD5 | f08b8466224d1fcbda8c84bd66f26d8d |
|
BLAKE2b-256 | 0136dfbcfddd3c4a8c841f8d24b9ad556c3cf134299a7d3a481ff509a2995ff0 |