The worksheet file format - application/vnd.edufeed.worksheet+json

Von Edufeed ·

The worksheet file format

A worksheet is one JSON file. This is what the edufeed worksheet editor stores, what it uploads when a sheet is published, and what another tool has to read to draw or change a sheet.

How a published sheet is found and fetched (a kind 30142 event that names this file by address and SHA-256) is described in the article edufeed-editable-source, nostr:naddr1qqtk2er4vejk2epdv4jxjarpvfkx2ttnda6hycm9qythwumn8ghj7un9d3shjtn9v36kvet9vshx7un8qgstmssljwc79jm4vzxwe4aq5q9809memym8mjte30vlyylsdj2mcjqrqsqqq7rzszcrtc.

The sheet

{
    "v": 1,
    "title": "Brüche kürzen",
    "license": "https://creativecommons.org/licenses/by/4.0/",
    "basedOn": [
        {
            "address": "30142:<pubkey hex>:<d>",
            "title": "Brüche",
            "author": "Ada",
            "license": "https://creativecommons.org/licenses/by/4.0/",
            "url": "https://…/view/naddr1…"
        }
    ],
    "page": { "format": "A4", "margin": 20 },
    "defaults": { "font": "Open Sans", "fontSize": 10.5 },
    "pages": [{ "blocks": [] }]
}
Key Type Meaning
v number Format version. Now 1. A reader refuses a version it does not know.
title string The sheet's title. Optional, default empty.
license string Address of the licence the sheet is shared under: CC0, CC BY or CC BY-SA (any version). Optional. For a published sheet the licence in the event counts.
basedOn list Published sheets this one was copied from or took a task from, at most 50. address is the Nostr address of the source's event, url (optional, https) where it can be looked at. A copy inherits its source's list.
page object The paper, see below.
defaults object Document-wide settings, see below.
pages list At least one page; each is { "blocks": [...] }.

page

Key Type Meaning
format string "A4" (210 × 297).
margin number Margin of every side, 0 to 100.
margins object Optional: top, right, bottom, left, each 0 to 100, overriding margin for that side.
landscape boolean Optional: the paper lies on its side (297 × 210).
punch boolean Optional: a mark at the middle of the left edge for the hole punch.

defaults

Key Type Meaning
font string Font family name: letters, digits, space, _, -; at most 60 characters.
fontSize number In points, 4 to 72.
lang string Language of the texts (de, en, …), used for hyphenation and as the event's language.
hyphens boolean Automatic hyphenation.
gap object Look of cloze gaps: style, width.
number object How tasks are counted: kind (1, a, A), look.
meta object Texts for the header's placeholders (name, date, class, …).
pointKinds list The kinds of points the sheet counts.

A block

{
    "id": "b1f3a9c2",
    "type": "task",
    "x": 0,
    "y": 85,
    "w": 170,
    "h": 12,
    "autoHeight": true,
    "z": 1,
    "rotation": 0,
    "locked": false,
    "data": {},
    "style": {},
    "rights": {
        "license": "<url>",
        "credit": "…",
        "source": "<url>",
        "x": "<sha256>",
        "url": "<url>"
    }
}

Rich text

Texts with formatting are ProseMirror JSON as tiptap writes it: { "type": "doc", "content": [ … ] }. Only the nodes and marks listed here are kept.

What a reader must check

A sheet can come from a stranger. Before anything of it reaches HTML or CSS:

Block types

For each type: the keys its data starts with, as the editor creates the block. A block's form may add further optional keys; the editor's source (src/lib/blocks/<type>/) is the reference. points: null means the task carries no points yet.

abc

ABC Notation.

anagram

Anagramm (a task: numbered, may carry points).

arithmetic

Rechenaufgabe (a task: numbered, may carry points).

background

Hintergrund (as large as the paper).

choice-table

Auswahltabelle (a task: numbered, may carry points).

cloze

Lückentext (a task: numbered, may carry points).

code

Quellcode.

credits

Bildnachweis.

crossword

Kreuzworträtsel (a task: numbered, may carry points).

crossword-legend

KWR-Legende.

No data.

definition

Begriffsdefinition.

dialog

Dialog (a task: numbered, may carry points).

Fußzeile.

formula

Formel.

free-points

Freie Punkte.

function

Funktion.

grade

Benotung.

grade-table

Notenspiegel.

Kopfzeile.

heading

Überschrift.

hint

Hinweis.

image

Bild.

info-text

Informationstext.

line

Linie/Pfeil.

Logo.

multiple-choice

Multiple-Choice (a task: numbered, may carry points).

number-line

Zahlenstrahl (a task: numbered, may carry points).

number-sort

Zahlen sortieren (a task: numbered, may carry points).

ordering

Sortieraufgabe (a task: numbered, may carry points).

pairs

Paare bilden (a task: numbered, may carry points).

paper

Kästchen (beschreibbar).

plot

Math. Zeichnung.

points-total

Gesamtpunktzahl.

No data.

qr

QR-Code.

quote

Ausspruch.

ruled-text

Lineatur (beschreibbar).

schedule

Zeitplan.

sentence-order

Sätze ordnen (a task: numbered, may carry points).

shape

Formen.

signature

Unterschrift.

source-text

Textquelle.

speech-bubble

Sprechblase.

sticky-note

Klebezettel.

table

Tabelle.

task

Aufgabenstellung (a task: numbered, may carry points).

text-card

Textkarte.

tree

Baumdiagramm (a task: numbered, may carry points).

value-table

Wertetabelle.

word-bank

Wörter zuordnen (a task: numbered, may carry points).

word-problem

Mathe-Textaufgabe (a task: numbered, may carry points).

Wortsuchrätsel (a task: numbered, may carry points).

writing-area

Linien und Kästchen.

youtube

YouTube-Video.