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/*.
Metadata
Release files for tracklms-to-qti-results 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tracklms_to_qti_results-0.2.1.tar.gz | 20.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tracklms_to_qti_results-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.5 kB
Release files / tracklms_to_qti_results-0.2.1.tar.gz
| Download URL | tracklms_to_qti_results-0.2.1.tar.gz |
|---|---|
| Size | 20.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0ecd43e544fde03abb7f54376fa88957f76b517428619a26c6f67947e81f6bb0
|
|
BLAKE2b-256 checksum How to use checksums |
c9b1f8eae6a26b0a8933f5409b9d3ec6985bc6b2ede51ea0d279a1acf58b1029
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / tracklms_to_qti_results-0.2.1-py3-none-any.whl
| Download URL | tracklms_to_qti_results-0.2.1-py3-none-any.whl |
|---|---|
| Size | 15.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1dc1da3014dec83c3a586c88144da065f070605bb61ca7d7c8284fd9a71a2650
|
|
BLAKE2b-256 checksum How to use checksums |
97a90ec9a2c5379a826b300769fc23070ec470f8f166095fea2611360c3dc378
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|