Download the PHP package dlnsk/uqfi without Composer
On this page you can find all versions of the php package dlnsk/uqfi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package uqfi
Short Description Universal question format importer
License GPL-3.0-or-later
Homepage https://github.com/dlnsk/uqfi
Informations about the package uqfi
Universal Question Format Importer
Overview
Universal question format importer is a wrapper to native Moodle's question engine. It uses code of Moodle format imports as is. Some classes and libraries are replaced by stub.
It supports next question's bank formats:
- GIFT
- AIKEN
- MissingWord
- MoodleXML
- BlackBoard 6
Installation
Simply add a dependency on dlnsk/uqfi to your project's composer.json file if you use Composer to manage
the dependencies of your project. Use following command to add the package to your project's dependencies:
Usage
Laravel
If you're going to use this package in Laravel, you don't need to load dependencies and initialise. Just use.
Methods
init()
Some simple steps to fool Moodle native library.
getFormat()
Creates a formatter class for given format and file. The format parameter can be one of
"gift", "aiken", "missingword", "moodlexml" or "blackboard6". Keep in mind that "blackboard6" format
require zip file as source of a questions bank.
You also can directly create a necessary class:
readQuestions()
Returns the set of question objects with native Moodle structure. This structure maybe good to save questions into Moodle database, but not quite well to use.
readDecoratedQuestions()
Returns a set of question objects with a slightly fixed structure. We move some dependent fields into parent elements, transform files' data, and so on. The structure of a decorated question is quite close to MoodleXML file.
See BaseFormat class for some helpful methods.
Question types
Currently, the package supports next question types:
- calculated / calculatedsimple
- essay
- matching / match / ddmatch
- multichoice
- numerical
- ordering
- shortanswer
Third party question types
To add support for any other type:
- Copy third party question type sources to
qtypesdirectory of the package. - Suppress any errors.
- Make pull request.