Skip to main content

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

Agent rules (AGENTS.md)

This repository uses composed agent rules.

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.py bootstraps src/ 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-dir is omitted, outputs go to <input_dir>/qti-results (or ./qti-results when reading stdin).
  • Use --output - to emit a single XML document to stdout.
  • Use --dry-run to preview planned outputs without writing files.
  • Use --json to emit a machine-readable summary to stdout.
  • Use --yes/--force to 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-status multiple 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

  1. Update CHANGELOG.md with a new version section and migration notes for breaking changes.
  2. Update src/tracklms_to_qti_results/version.py.
  3. Run python -m pip_audit -r requirements-dev.txt and address critical issues.
  4. Run python -m build.
  5. Run python -m twine check dist/*.
  6. Tag the release (example: v1.2.3) and push the tag.
  7. Create a GitHub Release with notes based on CHANGELOG.md.
  8. Publish to PyPI with python -m twine upload dist/*.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tracklms_to_qti_results-0.2.1.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tracklms_to_qti_results-0.2.1-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

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

Hashes for tracklms_to_qti_results-0.2.1.tar.gz
Algorithm Hash digest
SHA256 0ecd43e544fde03abb7f54376fa88957f76b517428619a26c6f67947e81f6bb0
MD5 449ff6d26bae1f70962dd1941b180251
BLAKE2b-256 c9b1f8eae6a26b0a8933f5409b9d3ec6985bc6b2ede51ea0d279a1acf58b1029

See more details on using hashes here.

File details

Details for the file tracklms_to_qti_results-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for tracklms_to_qti_results-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1dc1da3014dec83c3a586c88144da065f070605bb61ca7d7c8284fd9a71a2650
MD5 74a42fd37b19b62555a7c53aaf0d55dc
BLAKE2b-256 97a90ec9a2c5379a826b300769fc23070ec470f8f166095fea2611360c3dc378

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page