Convert Track LMS exports into QTI 3.0 Results Reporting XML.
Project description
tracklms-to-qti-results
Convert Track LMS exports into QTI 3.0 Results Reporting artifacts.
Status
Converter and CLI are available.
Setup
- Python 3.11+
- Create and activate a virtual environment
- Install dev tools:
python -m pip install -r requirements-dev.txt
Environment variables
None.
Specs
- Input spec: docs/input-spec.md
- Output spec: docs/output-spec.md
- CLI JSON schema: docs/cli-output.schema.json
Agent rules (AGENTS.md)
This repository uses composed agent rules.
- Source modules live in:
- agent-rules/ (git submodule)
- agent-rules-local/ (project-specific additions)
- The ruleset is defined in agent-ruleset.json.
- Generate/update
AGENTS.mdfrom the project root:
node agent-rules-tools/tools/compose-agents.cjs
Planned tech
- Python + Pydantic
Development
Tests
python -m unittest discover -s tests
Lint
python -m ruff check .
Security audit
python -m pip_audit -r requirements-dev.txt
Usage
from pathlib import Path
from tracklms_to_qti_results import convert_csv_text_to_qti_results
csv_text = Path("tracklms-export.csv").read_text(encoding="utf-8")
results = convert_csv_text_to_qti_results(csv_text, timezone="Asia/Tokyo")
for result in results:
output_path = Path(f"assessmentResult-{result.result_id}.xml")
output_path.write_text(result.xml, encoding="utf-8")
Notes:
- One XML document is produced per input row (resultId).
- The timezone parameter applies to startAt/endAt conversion.
- Use allowed_statuses to include only specific Track LMS statuses.
CLI
python run_cli.py <input.csv|-> \
[--timezone Asia/Tokyo] \
[--output <output_dir|->] \
[--assessment-test <assessment-test.qti.xml>] \
[--only-status <status>] \
[--dry-run] \
[--json] \
[--yes]
Notes:
- Run from the repository root;
run_cli.pybootstrapssrc/automatically. - If your environment allows,
python -m tracklms_to_qti_results ...also works. - Use
-instead of a file path to read CSV data from stdin. - If
--output/--out-diris omitted, outputs go to<input_dir>/qti-results(or./qti-resultswhen reading stdin). - Use
--output -to emit a single XML document to stdout. - Use
--dry-runto preview planned outputs without writing files. - Use
--jsonto emit a machine-readable summary to stdout. - Use
--yes/--forceto overwrite existing files without prompting. - Output files are written as
assessmentResult-<resultId>.xml. - Use
--assessment-test <path>to include rubric-based scoring results.- Descriptive items set all rubric criteria to false.
- Choice and fill-in-the-blank items set all criteria to true when q{n}/score is non-zero.
- itemResult identifiers follow the assessment test item order.
- Use
--only-statusmultiple times to include multiple statuses (example:--only-status Completed --only-status DeadlineExpired).
Versioning
This project follows Semantic Versioning.
Breaking changes include (but are not limited to):
- Changes to CLI flags or defaults that alter outputs or behavior.
- Changes to input/output formats or required columns.
- Changes to public Python API signatures or return types.
Release
- Update
CHANGELOG.mdwith a new version section and migration notes for breaking changes. - Update
src/tracklms_to_qti_results/version.py. - Run
python -m pip_audit -r requirements-dev.txtand address critical issues. - Run
python -m build. - Run
python -m twine check dist/*. - Tag the release (example:
v1.2.3) and push the tag. - Create a GitHub Release with notes based on
CHANGELOG.md. - Publish to PyPI with
python -m twine upload dist/*.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tracklms_to_qti_results-0.2.1.tar.gz.
File metadata
- Download URL: tracklms_to_qti_results-0.2.1.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ecd43e544fde03abb7f54376fa88957f76b517428619a26c6f67947e81f6bb0
|
|
| MD5 |
449ff6d26bae1f70962dd1941b180251
|
|
| BLAKE2b-256 |
c9b1f8eae6a26b0a8933f5409b9d3ec6985bc6b2ede51ea0d279a1acf58b1029
|
File details
Details for the file tracklms_to_qti_results-0.2.1-py3-none-any.whl.
File metadata
- Download URL: tracklms_to_qti_results-0.2.1-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1dc1da3014dec83c3a586c88144da065f070605bb61ca7d7c8284fd9a71a2650
|
|
| MD5 |
74a42fd37b19b62555a7c53aaf0d55dc
|
|
| BLAKE2b-256 |
97a90ec9a2c5379a826b300769fc23070ec470f8f166095fea2611360c3dc378
|