This repository will implement a tool that converts Markdown question files into IMS QTI 3.0. The authoring format is defined in:
- Install Java 23. Use
tools/gradle-java23.ps1(it auto-downloads JDK 23 if missing), or setJAVA_HOME_23to an existing JDK 23 installation. - This project uses the Gradle wrapper. You can use
./gradlew(orgradlew.baton Windows) to run Gradle tasks.
If you need to pin Gradle to a specific JDK, set JAVA_HOME_23 to the JDK 23 installation directory.
- Build:
.\\tools\\gradle-java23.ps1 build - Test:
.\\tools\\gradle-java23.ps1 test - Lint:
.\\tools\\gradle-java23.ps1 detekt - Format:
.\\tools\\gradle-java23.ps1 spotlessApply - Format check:
.\\tools\\gradle-java23.ps1 spotlessCheck
Generate QTI XML from one or more Markdown files:
gradle run --args="--input path/to/question.md --test-title \"Example Test\""
Recommended (avoids Gradle argument parsing issues, especially with non-ASCII titles):
.\tools\gradle-java23.ps1 installDistbuild/install/markdown-to-qti/bin/markdown-to-qti --input path/to/question.md --test-title "Example Test"
Validate inputs without writing output:
.\tools\gradle-java23.ps1 run --args="--input path/to/question.md --test-title \"Example Test\" --validate-only"
Non-ASCII test titles:
- Prefer the installed CLI (
.\tools\gradle-java23.ps1 installDistthenbuild/install/markdown-to-qti/bin/markdown-to-qti) to avoid Gradle task parsing issues.
Options:
--input <path>: Markdown file or directory (directories scan for*.md). Use-for stdin.--test-title <title>: Assessment test title (required).--output-dir <dir>: Output directory for.qti.xmlfiles. Defaults toqti-outunder each input file directory.--validate-only: Parse and validate XML without writing files.--dry-run: Alias for--validate-only.--verbose: Log processed files.--json: Output machine-readable JSON summary to stdout.--version,-V: Show version.
- When
--inputis a directory, all*.mdfiles inside it are processed. - When
--inputis-, it reads from stdin. Identifier defaults tostdin. - Output files are written as
<input-file>.qti.xmlunder--output-diror<input-dir>/qti-outwhen omitted. - An
assessment-test.qti.xmlfile is written alongside outputs, referencing all generated items in that directory. --validate-only(or--dry-run) performs XML well-formedness checks without writing files.- Local image files referenced in Markdown are copied to the output directory, preserving the relative paths.
- Errors include the input path when possible and return a non-zero exit code.
Prompt, options, and explanation content are parsed as CommonMark with GFM-style
tables, strikethrough, and task lists enabled. The supported constructs are
mapped to QTI elements as described in docs/qti-mapping.md.
Raw HTML blocks/inline HTML are not supported and will raise an error.
None yet.
Not applicable yet.