Giter VIP home page Giter VIP logo

moodle-questions's Introduction

moodle-questions

Python 3 library for manipulating quiz questions in Moodle XML format.

About

I needed to create some types of Moodle questions programatically for a project and I could not find any suitable library. This led to me to an idea to work on such library myself (beyond the requirements of the original project). However throughout the work on this I realized that Moodle XML format is an unpredictable and barely documented mess which severly undermined my motivation to make this a complete library covering all types of Moodle questions. I will keep working occasionally and I welcome contributions, but as of now I can not promise this will ever be finished.

Installation

pip install moodle-questions

Example

from moodle_questions import Quiz, DragAndDropOntoImageQuestion

quiz = Quiz()

question = DragAndDropOntoImageQuestion(name="DragAndDropOntoImage",
                                        background="background.jpg",
                                        question_text="Drag the images in the correct boxes",
                                        default_mark=1,
                                        correct_feedback="Congratulations!",
                                        shuffle=True)

question.add_dragimage(file="image1.jpg", unlimited=True, dropzones=[(100, 100, "some dropzone text")])

question.add_dragtext(text="This is a box with test.", dropzones=[(300,100,"some dropzone text 2")])

quiz.add_question(question)

quiz.save("draganddropontoimage.xml")

Current status

Current status of moodle-questions implementation:

Question Type Create New
Calculated
Calculated multi-choice
Calculated simple
Drag and drop into text ✔️
Drag and drop markers
Drag and drop onto image ✔️
Description
Essay
Matching
Embedded Answers (Cloze Test / Gap Fill)
Multiple choice ✔️
Short Answer ✔️
Numerical ✔️
Random short-answer matching
Select missing words
True/False

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.