An LTI Tool that Supports Quizzes in the GIFT format
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
export
store
tests/Util
xml
.gitignore
.htaccess
LICENSE
README.md
ajax-loader.gif
composer.json
configure.php
convert.php
getzip.php
grade-detail.php
grades.php
index.php
lti_config.php
make_qti.php
make_zip.php
makeassess.php
parse.php
phpunit.xml.dist
process.php
quiz.php
register.php
sample.php
templates.php
tsugi.php
util.php
viewxml.php
waiting.php

README.md

GIFT Quiz Tool

Apereo Incubating badge

This tool currently contains two pieces of related functionality:

  • It can author and deliver GIFT-authored quizzes using LTI (index.php)
  • It can convert to QTI 1.2 (convert.php)

These two pieces are related because they share a bunch of library code.

Preloading Quizzes

You can have this quiz tool consult a folder to pre-load quizzes. Use the following configuration option in your config.php:

$CFG->giftquizzes = $CFG->dirroot.'/../php-solutions/quiz';

It should be a folder with a serires of files that end in *.txt in the GIFT format. You can store these files in a private GitHub repo. You can also add a password to all the files by creating the file .lock in the folder and put in a single line with the plaintext password to unlock the quzzes.

You can request a default quiz from this folder using a GET parameter:

http://localhost:8888/wa4e/mod/gift/?quiz=00-CSS.txt

The instructor still needs to go in and configure the quiz - but the right quiz will be pre-populated in the configuration drop down and pre-loaded if there is no .lock file.

Quiz format convertor from GIFT to QTI 1.2

This is a simple converter that lets you paste in GIFT formatted quiz questions like:

// multiple choice with specified feedback for right and wrong answers
::Q2:: What's between orange and green in the spectrum? 
{ =yellow # right; good! ~red # wrong, it's yellow ~blue # wrong, it's yellow }

And get them downloaded as QTI 1.2 for import into lots of systems like Sakai and Canvas.

GIFT seems to be a micro-format invented by the Moodle community - and a pretty cool idea if I do say so myself. I like it because I can put quizzes in GitHub :)

https://docs.moodle.org/28/en/GIFT_format

You can play with my demo server at:

https://lti-tools.dr-chuck.com/tsugi/mod/gift/convert.php

Comments (and Pull requests) welcome.

Unit Tests

If you want to run and/or make Unit tests, first install composer from

https://getcomposer.org/doc/

At some point you can run composer from the command line. Then from the gift folder do:

composer update

This will install phpunit into a vendor folder - don't worry - this won't go back into github - it is ignored.

Then to run the unit tests do:

vendor/bin/phpunit

It should look like this:

PHPUnit 5.7.27 by Sebastian Bergmann and contributors.
.  1 / 1 (100%)
Time: 21 ms, Memory: 4.00MB

OK (1 test, 4 assertions)

The unit tests are in folders under the folder tests - just add a subfolder and your unit tests in php files.

-- Chuck