Skip to main content

🎓 moodle-to-vikwikiquiz

Lines of code Build status Code quality Type hinting used Code style: Black

Recent activity Commits since latest release PRs welcome

📖 About

A CLI for converting graded and downloaded Moodle quizzes to a vik.viki quiz wikitext.

📥 Installation

🌍 Global

  1. Install uv

  2. If using Linux: follow these steps.

  3. Run the following command in the terminal:

    uv tool install moodle-to-vikwikiquiz
    

🏠 Local

🛠️ Executable zipapp

  1. Download the .pyz file of the latest release from here.

  2. Run the following commands in the terminal:

    chmod +x moodle-to-vikwikiquiz_x.x.x.pyz
    ./moodle-to-vikwikiquiz_x.x.x.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)
  • Supports true or false, single and multiple choice questions
  • Opens an existing article or creates a new one on vik.wiki with the edit summary pre-filled
  • Formats LaTeX equations as wikitext
  • Adds the only remaining correct answer automatically if it can be determined from the grade
  • Asks for correct answers if it can't be determined from a graded question
  • Deduplicates questions with the same text
  • Prepares illustrations for batch upload
    • If they are unavailable: creates placeholders for them
  • Copies the generated wikitext to the clipboard

🏫 Compatibility

file format tested can it be imported?
.html ✅ ✅
.webarchive yes, except illustrations ✅
.mhtml ❌ maybe
all others ❌ maybe
Moodle instance tested can it import a quiz from there?
BME VIK ✅ ✅
BME VIK HIT ❌ ❌
BME GTK ✅ ✅
Moodle language is it understood by the app?
Hungarian ✅
English ✅
German ❌

⏫ Updating

Run the following command in the terminal:

uv tool upgrade --all

If you want this to run automatically, create a cron job:

  1. Open the crontab file:

    crontab -e
    
  2. 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.

  3. Add the following line to the end of the file:

    @daily		uv tool upgrade --all
    

    You may replace @daily with @weekly or @monthly.

🧑‍💻 Development

⌨️ Developing

  1. Create a venv:
    uv venv
    
  2. Activate the venv in your IDE
  3. Install the dependencies:
    uv sync --extra dev
    

📤 Release

🛠️ Setup

  1. Install vermin:
    uv tool install vermin
    
  2. Check the minimum Python version:
    vermin --backport argparse --backport enum --backport typing_extensions --eval-annotations .
    
  3. If the result is higher than the one in pyproject.toml, update it.
  4. Bump the version number:
    uv version --bump [major|minor|patch]
    
  5. Commit and push the changes

🏗️ Building

To build a repruducible zipapp (.pyz):

  1. Install shiv:
    uv tool install shiv
    
  2. Create the executable:
    shiv --entry-point moodle_to_vikwikiquiz.main:main --output-file moodle-to-vikwikiquiz.pyz --reproducible .
    
  3. Optional: compare its hash with the one of the latest release.

📜 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.

Metadata

Release files for moodle-to-vikwikiquiz 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for moodle-to-vikwikiquiz 2.1.0
File Size Uploaded
moodle_to_vikwikiquiz-2.1.0.tar.gz 18.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for moodle-to-vikwikiquiz 2.1.0
File Interpreter ABI Platform
moodle_to_vikwikiquiz-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 38.7 kB

Release files / moodle_to_vikwikiquiz-2.1.0.tar.gz

Download URL moodle_to_vikwikiquiz-2.1.0.tar.gz
Size 18.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a752ebec2e22201d429f058e2d732adf4c8ee02bd2cd17dac07017584fe009e2
BLAKE2b-256 checksum
How to use checksums
a5da9a8733bfd5d6b70ac03c33eff375bd2ab551aafc8fe9f14e23e5dd3e6bef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.22

Release files / moodle_to_vikwikiquiz-2.1.0-py3-none-any.whl

Download URL moodle_to_vikwikiquiz-2.1.0-py3-none-any.whl
Size 20.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
22e4bf5153a06f65302eae723c32dc7ada34b81c4f1794e6e6da3c48ebd2db07
BLAKE2b-256 checksum
How to use checksums
1c9dc4a386e450361ecbe5984f9b5a011f84232a37802c7d5ec11897b7478f70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.22

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

1.3.0

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page