The Qti gem supports QTI 1.2 and 2.1. It currently supports the following interaction types:
- Multiple Choice
- Multiple Answer
$ cd your_project $ bundle install qti
require 'qti' @gem = Qti::Importer.new(path_of_quiz)
You can use the gem to access the manifest, the assessments, and the assessment items and use it in your own code!
Returns the version appropriate href from the manifest.xml
Returns the version appropriate Assessment/AssessmentTest model
Returns the version appropriate AssessmentItem model
Available Methods on the Assessment (QTI 1.2)
Available Methods on the AssessmentTest (QTI 2.1)
assessment_item_reference_hrefs(the hrefs of the xml files in the assessment.xml)
Available Methods on the AssessmentItem
interaction_model(ie Choice Interaction)
A simple docker environment has been provided for spinning up and testing this gem with multiple versions of Ruby. This requires docker and docker-compose to be installed. To run specs, run the following:
docker-compose build --pull docker-compose run --rm app
This will install the gem in a docker image with all versions of Ruby installed, and install all gem dependencies in the Ruby 2.5 set of gems. Then it will run wwtd, which runs all specs across all supported versions of Ruby and gem dependencies.
The first build will take a long time, however, docker images and gems are cached, making additional runs significantly faster.
Individual spec runs can be started like so:
docker-compose run --rm app /bin/bash -l -c \ "BUNDLE_GEMFILE=spec/gemfiles/rails-6.0.gemfile rvm-exec 2.5 rspec"
If you'd like to mount your git checkout within the docker container running tests so changes are easier to test, use the override provided:
cp docker-compose.override.example.yml docker-compose.override.yml
Bug reports and pull requests are welcome on GitHub at:
The gem is available as open source under the terms of the MIT License.