Skip to main content

Quiz generation for Moodle in XML.

Project description

pymoodef

The goal of the pymoodef package is to support the definition of Moodle questions to be included in the question bank to define quizzes.

To define the questions for the quizzes we can use the component for this purpose that includes Moodle, based on entering data through screens. It allows the import and export of questions in various formats, including xml.

Complementary, using the pymoodef package, we can define questionnaires from python. We have generalized 9 types of questions and simplified their definition. So, we define a question by including a row in a csv file or an Excel file. The result is an xml file that we import into Moodle. If necessary, some parameter not considered in the generalization can be defined or adjusted there.

In each question we can include an image that is embedded in xml. We can set up the size of the images so that they are homogeneous when displayed in quizzes.

Installation

$ pip install pymoodef

Usage

pymoodef can be used to generate Moodle question xml files from csv or Excel files:

$ python -m pymoodef tests/questions.xlsx result.xml

If the name of the result file is not indicated, one is created with the same name as the input file but with an xml extension in the folder that contains it.

$ python -m pymoodef tests/questions.csv 

By default, csv files with columns separated by “,” are considered. In case of using “;” as a separator, simply add a “2” after the file name, as shown below for file tests/questions1.csv.

$ python -m pymoodef tests/questions1.csv2

Below is the content of one of the question files used.

type question image image_alt answer a_1 a_2 a_3
What are the basic arithmetic operations? Addition, subtraction, multiplication and division. Addition and subtraction. Addition, subtraction, multiplication, division and square root.
Match each operation with its symbol. Addition<|>+ Subtraction<|>- Multiplication<|>*
The square root is a basic arithmetic operation. False
What basic operation does it have as a + symbol? Addition
The symbol for addition is [[1]], the symbol for subtraction is [[2]]. + -
x The symbol for addition is [[1]], the symbol for subtraction is [[2]]. + -
h Sort the result from smallest to largest. 6/2 6-2 6+2 6*2
x Sort the result from smallest to largest. 6/2 6-2 6+2 6*2
What is the result of SQRT(4)? 2 -2
What is the result of 4/3? 1.33<|>0.03
Describe the addition operation.
What basic operation has the symbol shown in the figure as its symbol? divide.png Operation Division
x Place the name of the operations as they appear in the figure. ops.png Operations Addition Multiplication Division Subtraction

The configuration can be defined using an ini file with the same name as the questions csv or Excel file located in the same folder. Finally, the ini configuration file is displayed.

[DEFAULT]
category = Initial test
first_question_number = 1
copyright = Copyright © 2024 Universidad de Granada
license = License Creative Commons Attribution-ShareAlike 4.0
correct_feedback = Correct.
partially_correct_feedback = Partially correct.
incorrect_feedback = Incorrect.
adapt_images = True
width = 800
height = 600

The result obtained is an xml file of questions that can be imported directly into Moodle.

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

pymoodef was created by Jose Samos. It is licensed under the terms of the MIT license.

Credits

pymoodef was created with cookiecutter and the py-pkgs-cookiecutter template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymoodef-0.1.0.tar.gz (205.1 kB view details)

Uploaded Source

Built Distribution

pymoodef-0.1.0-py3-none-any.whl (207.5 kB view details)

Uploaded Python 3

File details

Details for the file pymoodef-0.1.0.tar.gz.

File metadata

  • Download URL: pymoodef-0.1.0.tar.gz
  • Upload date:
  • Size: 205.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Windows/11

File hashes

Hashes for pymoodef-0.1.0.tar.gz
Algorithm Hash digest
SHA256 955ec919d5f12a3902140743a23b0d1b9670b4949cf89d08b0c16f0a182dd2b8
MD5 d7d63c23331b81a94c8cb5f0611b25ab
BLAKE2b-256 2ad1c5909e74c937a51bee22a3d75da205e8235c0307822089e767ac3730119b

See more details on using hashes here.

File details

Details for the file pymoodef-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pymoodef-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 207.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Windows/11

File hashes

Hashes for pymoodef-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eded900aac3c4b0a29e1aa279eab7d1e3fdb533067008c4a86573ac6aadff527
MD5 3078140648e8aee4cb802b703d90e83f
BLAKE2b-256 bf2035c1224ee2c09543c2fccda63c313092e61cb7e8d3e958970d1f67169bf9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page