PHPackages                             dlnsk/uqfi - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dlnsk/uqfi

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dlnsk/uqfi
==========

Universal question format importer

v0.1.6(5mo ago)022GPL-3.0-or-laterPHP

Since Dec 5Pushed 5mo agoCompare

[ Source](https://github.com/dlnsk/uqfi)[ Packagist](https://packagist.org/packages/dlnsk/uqfi)[ Docs](https://github.com/dlnsk/uqfi)[ RSS](/packages/dlnsk-uqfi/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (1)Versions (8)Used By (0)

Universal Question Format Importer
==================================

[](#universal-question-format-importer)

Overview
--------

[](#overview)

Universal question format importer is a wrapper to native [Moodle's](https://moodle.org) 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:

1. GIFT
2. AIKEN
3. MissingWord
4. MoodleXML
5. BlackBoard 6

Installation
------------

[](#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:

```
composer require dlnsk/uqfi
```

Usage
-----

[](#usage)

```
// Autoload the dependencies
require 'vendor/autoload.php';

// Initialize library
\Dlnsk\UQFI\Importer::init();

// Use
$format = Dlnsk\UQFI\Importer::getFormat('gift', $file_path);
$questions = $format->readQuestions(); // or
$decorated = $format->readDecoratedQuestions(); // to get questions with much nicer structure
```

### Laravel

[](#laravel)

If you're going to use this package in Laravel, you don't need to load dependencies and initialise. Just use.

Methods
-------

[](#methods)

**init()**

```
Importer::init();
```

Some simple steps to fool Moodle native library.

**getFormat()**

```
$format = Importer::getFormat($format, $file_path);
```

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:

```
$format = new Gift($file_path);
```

**readQuestions()**

```
$questions = $format->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()**

```
$questions = $format->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
--------------

[](#question-types)

Currently, the package supports next question types:

1. calculated / calculatedsimple
2. essay
3. matching / match / ddmatch
4. multichoice
5. numerical
6. ordering
7. shortanswer

### Third party question types

[](#third-party-question-types)

To add support for any other type:

1. Copy third party question type sources to `qtypes` directory of the package.
2. Suppress any errors.
3. Make pull request.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance70

Regular maintenance activity

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

7

Last Release

170d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/332778?v=4)[Dmitry Pupinin](/maintainers/dlnsk)[@dlnsk](https://github.com/dlnsk)

---

Top Contributors

[![dlnsk](https://avatars.githubusercontent.com/u/332778?v=4)](https://github.com/dlnsk "dlnsk (34 commits)")

---

Tags

laravelmoodleformatgiftquestionsaikenmissingwordmoodle\_xmlblackboard6

### Embed Badge

![Health badge](/badges/dlnsk-uqfi/health.svg)

```
[![Health](https://phpackages.com/badges/dlnsk-uqfi/health.svg)](https://phpackages.com/packages/dlnsk-uqfi)
```

###  Alternatives

[akaunting/laravel-money

Currency formatting and conversion package for Laravel

7865.8M47](/packages/akaunting-laravel-money)[hallindavid/manny

a package of manipulators that hopefully come in useful for those of us who always forget regex when we need it (manny is short for manipulation)

38109.0k3](/packages/hallindavid-manny)[fresns/fresns

Cross-platform general-purpose multiple content forms social network service software.

4841.5k](/packages/fresns-fresns)[fresns/plugin-manager

Enhance Laravel Apps: Organized &amp; Scalable

523.2k2](/packages/fresns-plugin-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
