dataformat_jsonl
Export Moodle reports as JSON Lines (.jsonl) file.
How It Works
Extends core\dataformat\base. On export:
- Sanitizes column names (lowercase, alphanumeric).
- Each record JSON-encoded as
{col: val, col2: val2, ...}+ newline. - Streamed directly to browser (no temp file).
JSON flags: JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR | JSON_UNESCAPED_SLASHES.
On JSON encode failure, outputs null for that line.
Use
Select “JSON Lines (.jsonl)” in any report export dropdown. File downloads as report.jsonl.
Details
| Property | Value |
|---|---|
| MIME type | application/x-ndjson (pending application/jsonl standardization) |
| Extension | .jsonl |
| Privacy | No personal data stored |
Format
Each line is valid JSON. One record per line.
{"name": "Alice", "grade": "85"}
{"name": "Bob", "grade": "92"}Ideal for streaming, log processing, and big data pipelines.