Project

qti

0.02
A long-lived project that still receives updates
QTI 1.2 and 2.1 import and export models
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 11.0
>= 0
~> 3.8
~> 1.4
~> 2.1
~> 13.0
~> 1.8.1

Runtime

~> 1.4.0
~> 1.5.1
~> 1.10
~> 2.0
>= 5.3
>= 5.2, < 6.2
>= 5.2, < 6.2
~> 1.2.0, < 1.3
 Project Readme

QTI Gem

The Qti gem supports QTI 1.2 and 2.1. It currently supports the following interaction types:

  • True/False
  • Multiple Choice
  • Multiple Answer

Installation

$ cd your_project
$ bundle install qti

Usage

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!

Available methods

  • import_manifest

Returns the version appropriate href from the manifest.xml

  • test_object

Returns the version appropriate Assessment/AssessmentTest model

  • create_assessment_item(assessment_item_ref)

Returns the version appropriate AssessmentItem model

Available Methods on the Assessment (QTI 1.2)

  • title
  • assessment_items

Available Methods on the AssessmentTest (QTI 2.1)

  • title
  • assessment_item_reference_hrefs (the hrefs of the xml files in the assessment.xml)
  • test_parts
  • assessment_sections

Available Methods on the AssessmentItem

  • identifier
  • title
  • points_possible
  • rcardinality (QTI 1.2)
  • interaction_model (ie Choice Interaction)
  • scoring_data_structs

Development

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 bash -lc \
  "BUNDLE_GEMFILE=spec/gemfiles/rails-6.1.gemfile rvm-exec 2.7 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

Contributing

Bug reports and pull requests are welcome on GitHub at:

License

The gem is available as open source under the terms of the MIT License.