Skip to Content
Pluginsdataformat_jsonl

dataformat_jsonl

Export Moodle reports as JSON Lines (.jsonl) file.

How It Works

Extends core\dataformat\base. On export:

  1. Sanitizes column names (lowercase, alphanumeric).
  2. Each record JSON-encoded as {col: val, col2: val2, ...} + newline.
  3. 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

PropertyValue
MIME typeapplication/x-ndjson (pending application/jsonl standardization)
Extension.jsonl
PrivacyNo 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.