PHPackages                             escolalms/topic-type-gift - 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. escolalms/topic-type-gift

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

escolalms/topic-type-gift
=========================

Escola Headles LMS Topic Type GIFT

0.0.30(2w ago)06.9k↑40%2MITPHPPHP &gt;=7.4CI passing

Since Mar 20Pushed 2w ago1 watchersCompare

[ Source](https://github.com/EscolaLMS/Topic-Type-GIFT)[ Packagist](https://packagist.org/packages/escolalms/topic-type-gift)[ RSS](/packages/escolalms-topic-type-gift/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (27)Versions (38)Used By (2)

Topic Type GIFT
===============

[](#topic-type-gift)

[![swagger](https://camo.githubusercontent.com/bf46f50926ef796b1bb0b6e41af746af52ff3aacdffb0533450f3b614a7334a2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63756d656e746174696f6e2d737761676765722d677265656e)](https://escolalms.github.io/Topic-Type-GIFT/)[![codecov](https://camo.githubusercontent.com/f4d054b5d8f27db2c899db86214d1dd41a50e6e25a2f3659a0658641846c9d20/68747470733a2f2f636f6465636f762e696f2f67682f4573636f6c614c4d532f546f7069632d547970652d474946542f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d4e52414e34523841475a)](https://codecov.io/gh/EscolaLMS/Topic-Type-GIFT)[![phpunit](https://github.com/EscolaLMS/Topic-Type-GIFT/actions/workflows/test.yml/badge.svg)](https://github.com/EscolaLMS/Topic-Type-GIFT/actions/workflows/test.yml)[![downloads](https://camo.githubusercontent.com/c5f94516a8c86d1c6daf6307e360ef3dc7a6b46a08b51bc474dcc6e8673f75f2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6573636f6c616c6d732f746f7069632d747970652d67696674)](https://packagist.org/packages/escolalms/topic-type-gift)[![downloads](https://camo.githubusercontent.com/f37804cf467e481e2e387b0653957c699f59b0027cfa1ccbd3c2dea6c454e3cb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6573636f6c616c6d732f746f7069632d747970652d67696674)](https://packagist.org/packages/escolalms/topic-type-gift)[![downloads](https://camo.githubusercontent.com/c5df11c8009c42b2c80671b08bb557e9f06e55baee58069a3cf9a5f3b8ab4823/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6573636f6c616c6d732f746f7069632d747970652d67696674)](https://packagist.org/packages/escolalms/topic-type-gift)[![Maintainability](https://camo.githubusercontent.com/a7a11bc808d5fc966372dd6a3df45e9e09ea7d864c9d376b55f0abbc15bbda30/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f30633965323539336662333065323034386639352f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/EscolaLMS/Topic-Type-GIFT/maintainability)

What does it do
---------------

[](#what-does-it-do)

This package is another [TopicType](https://github.com/EscolaLMS/topic-types). It is used to make knowledge tests. If you want to learn more about this format then see [Moodle GIFT format](https://docs.moodle.org/402/en/GIFT_format)

This package supports the following types of questions:

- multiple choice
- multiple choice with multiple right answers
- true-false
- short answers
- matching
- numerical question
- essay
- description

Each question is stored in the database as a string. In the tests you can see examples of questions of different types. See [examples](https://github.com/EscolaLMS/Topic-Type-GIFT/blob/main/tests/GiftQuestionTesting.php)

The quiz can have a set maximum number of attempts for the user to solve the test and a maximum time for each attempt. If the user doesn't complete the attempt then it is closed automatically after the time set by the variable `Config::get('escolalms_gift_quiz.max_quiz_time');`The user will see the results when the attempt is finished.

The answer to an essay type question is not automatically graded. The teacher should do it.

When the quiz has `randomize_order` enabled, both the order of questions and the order of the answer options within each question are randomized per attempt (single/multiple choice options, and the two columns of matching questions). The shuffle is seeded with the attempt id, so the whole layout is random but stable for a given attempt (refreshing the page returns the same order), while different attempts of the same user may get a different one. When it is disabled (the default) the questions keep their configured `order` and choice options keep their source order (matching questions still shuffle their columns, as they always have, otherwise the pairs would line up).

Installing
----------

[](#installing)

- `composer require escolalms/topic-type-gift`
- `php artisan migrate`
- `php artisan db:seed --class="EscolaLms\TopicTypeGift\Database\Seeders\TopicTypeGiftPermissionSeeder"`

Endpoints
---------

[](#endpoints)

The endpoints are defined in [![swagger](https://camo.githubusercontent.com/bf46f50926ef796b1bb0b6e41af746af52ff3aacdffb0533450f3b614a7334a2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63756d656e746174696f6e2d737761676765722d677265656e)](https://escolalms.github.io/Topic-Type-GIFT/)

Database
--------

[](#database)

See the database schema snippet for a better understanding of how it is made.

 ```
classDiagram
direction BT
class topic_gift_attempt_answers {
   bigint topic_gift_quiz_attempt_id
   bigint topic_gift_question_id
   json answer
   varchar feedback
   double precision score
   bigint id
}
class topic_gift_questions {
   bigint topic_gift_quiz_id
   text value
   varchar type
   integer score
   integer order
   integer category_id
   bigint id
}
class topic_gift_quiz_attempts {
   timestamp started_at
   timestamp end_at
   bigint user_id
   bigint topic_gift_quiz_id
   bigint id
}
class topic_gift_quizzes {
   text value
   integer max_attempts
   integer max_execution_time
   double precision min_pass_score
   boolean counts_to_grade
   boolean randomize_order
   bigint id
}

topic_gift_attempt_answers  -->  topic_gift_questions : topic_gift_question_id.id
topic_gift_attempt_answers  -->  topic_gift_quiz_attempts : topic_gift_quiz_attempt_id.id
topic_gift_questions  -->  topic_gift_quizzes : topic_gift_quiz_id.id
topic_gift_quiz_attempts  -->  topic_gift_quizzes : topic_gift_quiz_id.id

```

      Loading Student flow
------------

[](#student-flow)

See diagram of how student flow works.

 ```
graph TD
A[Start] --> B[Is attempt active?]
B -- Yes --> E
B -- No --> C[Is attempt limit exceeded?]
C -- Yes --> K
C -- No --> D[Create new attempt]
D --> E[Return questions]
E -- Sequential saving --> F[End attempt]
E -- All-at-once saving --> G[Attempt closes automatically]
F --> H
G --> H[Show results]
H --> K[End]
```

      Loading Tests
-----

[](#tests)

Run `./vendor/bin/phpunit` to run tests. Test details [![codecov](https://camo.githubusercontent.com/f4d054b5d8f27db2c899db86214d1dd41a50e6e25a2f3659a0658641846c9d20/68747470733a2f2f636f6465636f762e696f2f67682f4573636f6c614c4d532f546f7069632d547970652d474946542f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d4e52414e34523841475a)](https://codecov.io/gh/EscolaLMS/Topic-Type-GIFT)

Events
------

[](#events)

- `QuizAttemptStartedEvent` - This event is dispatched when the user starts a new attempt to solve the test.
- `QuizAttemptFinishedEvent` - This event is dispatched when the user has finished solving the test.

Listeners
---------

[](#listeners)

This package does not listen for any events.

Permissions
-----------

[](#permissions)

Permissions are defined in [seeder](https://github.com/EscolaLMS/Topic-Type-GIFT/blob/main/database/seeders/TopicTypeGiftPermissionSeeder.php).

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance96

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~42 days

Recently: every ~6 days

Total

30

Last Release

18d ago

PHP version history (2 changes)0.0.1PHP ^7.4|^8.0|^8.1

0.0.22PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/c857f3115c790c573d0617d7e9ba4011269ef7b9dfdb003dc4388846a62b14f7?d=identicon)[qunabu](/maintainers/qunabu)

---

Top Contributors

[![mako321](https://avatars.githubusercontent.com/u/59456825?v=4)](https://github.com/mako321 "mako321 (32 commits)")[![dawidchabel-escl](https://avatars.githubusercontent.com/u/288282693?v=4)](https://github.com/dawidchabel-escl "dawidchabel-escl (13 commits)")[![daVitekPL](https://avatars.githubusercontent.com/u/58150098?v=4)](https://github.com/daVitekPL "daVitekPL (9 commits)")[![dicani0](https://avatars.githubusercontent.com/u/58490533?v=4)](https://github.com/dicani0 "dicani0 (4 commits)")[![qunabu](https://avatars.githubusercontent.com/u/214608?v=4)](https://github.com/qunabu "qunabu (2 commits)")[![dyfero](https://avatars.githubusercontent.com/u/59400506?v=4)](https://github.com/dyfero "dyfero (2 commits)")[![mateusz-wojczal](https://avatars.githubusercontent.com/u/299093561?v=4)](https://github.com/mateusz-wojczal "mateusz-wojczal (1 commits)")[![ArtKob](https://avatars.githubusercontent.com/u/108077902?v=4)](https://github.com/ArtKob "ArtKob (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/escolalms-topic-type-gift/health.svg)

```
[![Health](https://phpackages.com/badges/escolalms-topic-type-gift/health.svg)](https://phpackages.com/packages/escolalms-topic-type-gift)
```

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

10.8k2.5k](/packages/unopim-unopim)[typicms/base

A modular multilingual CMS built with Laravel, enabling developers to manage structured content like pages, news, events, and more.

1.6k20.4k](/packages/typicms-base)[dcat-plus/laravel-admin

dcat-plus admin

1494.6k10](/packages/dcat-plus-laravel-admin)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.8k](/packages/tomshaw-electricgrid)[team-nifty-gmbh/tall-datatables

Server-side rendered datatables for Laravel and Livewire

1422.0k5](/packages/team-nifty-gmbh-tall-datatables)

PHPackages © 2026

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