Universal converter that transforms text-based question banks into QTI packages compatible with Canvas LMS
Project description
txttoqti
txttoqti is a universal converter that transforms text-based question banks into QTI (Question & Test Interoperability) packages compatible with Canvas LMS and other learning management systems. This package is designed to simplify the process of creating QTI packages from plain text files, making it easier for educators and developers to manage and distribute assessments.
Features
- Universal Format Support: Convert plain text question banks to QTI packages
- Canvas LMS Compatibility: Full compatibility with Canvas LMS and other QTI-compliant systems
- Smart Conversion: Change detection and incremental updates with
SmartConverter - Educational Workflow: Zero-configuration auto-detection for educational environments
- Comprehensive Validation: Built-in question format validation and error reporting
- Multiple Interfaces: Command-line tools, Python API, and educational CLI
- No Dependencies: Uses only Python standard library (Python 3.10+)
Quick Start
Installation
Install from PyPI:
pip install txttoqti
Or install from source:
git clone https://github.com/julihocc/txttoqti.git
cd txttoqti
pip install .
Basic Usage
Python API:
from txttoqti import convert_txt_to_qti
# Simple conversion
qti_file = convert_txt_to_qti("questions.txt")
print(f"QTI package created: {qti_file}")
Command Line:
# Basic CLI
txttoqti -i questions.txt -o quiz.zip
# Educational CLI with auto-detection
txttoqti-edu
Question Format
Questions should follow this format:
Q1: What is the result of type(42) in Python?
A) <class 'float'>
B) <class 'int'>
C) <class 'str'>
D) <class 'number'>
RESPUESTA: B
Documentation
| Document | Description |
|---|---|
| Installation Guide | Detailed installation instructions and setup |
| API Reference | Complete API documentation with all classes and methods |
| CLI Documentation | Command-line interface usage and options |
| Question Format | Supported question formats and validation rules |
| Examples | Comprehensive usage examples and integration patterns |
Supported Question Types
- Multiple Choice: Standard A/B/C/D format with single correct answer
- True/False: Binary choice questions
- Short Answer: Text input questions
- Essay: Long-form text responses
Command-Line Tools
Basic CLI (txttoqti)
Simple, direct conversion tool:
txttoqti -i input.txt -o output.zip
Educational CLI (txttoqti-edu)
Enhanced tool with auto-detection and interactive features:
txttoqti-edu --interactive # Interactive troubleshooting
txttoqti-edu --status # Show current status
txttoqti-edu --force # Force regeneration
Advanced Features
Smart Conversion
from txttoqti import SmartConverter
converter = SmartConverter()
# Only converts if source file has changed
qti_file = converter.convert_file("questions.txt")
Educational Workflows
from txttoqti.educational import QtiConverter
converter = QtiConverter() # Auto-detects course structure
success = converter.convert()
Batch Processing
from txttoqti import TxtToQtiConverter
from pathlib import Path
converter = TxtToQtiConverter()
for txt_file in Path("questions").glob("*.txt"):
converter.convert_file(str(txt_file))
Requirements
- Python 3.10 or higher
- No external dependencies (uses only standard library)
Contributing
Contributions are welcome! Please feel free to:
- Submit bug reports and feature requests via GitHub Issues
- Submit pull requests for improvements
- Improve documentation
- Add support for additional question formats
Development Setup
git clone https://github.com/julihocc/txttoqti.git
cd txttoqti
pip install -e ".[dev]"
License
This project is licensed under the MIT License. See the LICENSE file for details.
Support
- Documentation: Comprehensive guides in the
docs/directory - Examples: See
examples/directory for sample question files - Issues: Report bugs on GitHub Issues
- Interactive Help: Use
txttoqti-edu --interactivefor troubleshooting
Related Projects
- QTI Specification - Official QTI standards
- Canvas LMS - Learning management system
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
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 txttoqti-0.4.0.tar.gz.
File metadata
- Download URL: txttoqti-0.4.0.tar.gz
- Upload date:
- Size: 75.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5a0235a51d5aeed50f21d8d6e7479c7dc944fd74880e60be900fedf6be7c2cf
|
|
| MD5 |
1bc0b8608bd059f9dc9ddf216dc96919
|
|
| BLAKE2b-256 |
403b9aa38c5e48ec5121ac1441de629faf5a5ca5b7b9effd59eea1f43bb850bf
|
File details
Details for the file txttoqti-0.4.0-py3-none-any.whl.
File metadata
- Download URL: txttoqti-0.4.0-py3-none-any.whl
- Upload date:
- Size: 29.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3d6ad72d634f450b815a41c889b274590b405540ceec86eb5af2bc579eabf53
|
|
| MD5 |
bd5e8f1ebc856526a6475511ee53ee3f
|
|
| BLAKE2b-256 |
884375c8ede136a49c458ae488edee5202f1236a2f5b57073094de283380d70b
|