Skip to content

Citolab/qti-creator

Repository files navigation

Citolab.QTI.Package.Creator for .NET

This library helps to create a qti-package with simple item-types and scoring. It uses Razor templates to create a qti-package. It's build to do conversions and never created to be production tool.

Packages can be installed using NuGet:

  • Install-Package Citolab.QTI.Package.Creator

Usage

With ASP.NET Core:

var services = new ServiceCollection();
services.AddQtiCreator();

Or just create an instance in .NET (Core)

var qtiCreator = new QtiPackageCreator();

It's important to make sure PreserveCompilationContext is set to true

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>

    <PreserveCompilationContext>true</PreserveCompilationContext>
    <TargetFramework>netcoreapp2.2</TargetFramework>
  </PropertyGroup>

</Project>

API

Currently it supports multiple choice and textEntry with simple scoring only.

There are two methods:

CreatePackageWithPlainTextItems

Creates a package with items with plain text or QTI compatible html. A simple div tag: <div>alternative A</div> will be QTI compatible. But if there is a inline style like: div style='color: red;' or the html contains images then you should use the rich text method.

CreatePackageWithRichTextItems

Creates a package with items with rich text. The content of item.body and alternatives will be converted to qti compatible html. You need to provide a handler to process images. The input will the src of the image tag and the return value should be of IRetrievedFile. This because images can be in a database or file location. If all images are base64 then you can pass, null since these are processed automatically.

See /Demo for a sample.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published