Documentation
¶
Overview ¶
Package openview builds the open views of the measurement's tasks: the file that tutor's release carries for canvas's sample page, until modules has content. Each task in it is the open view of a task of the module format that ModuleFormatVersion names, spec's open.Task: what the learner's app shows — the statement, the canvas and the items with their answer slots — and none of the key, the solution, the traps, the leak phrases or the checks, which stay with tutor. tutor's banks are not modules: their tasks of the format are built by package task, by the kind of each file's tasks, and their open views are module-kit's. The file names each bank by its path in the repository and the digest of its bytes, by which the runner at the same tag finds a task's key.
Index ¶
Constants ¶
const ( Format = "tutor-open-tasks" Version = 0 )
Format is the name the file declares in its "format" field, and Version its version.
const ModuleFormatVersion formatv0.ModuleFormatVersion = "0.6"
ModuleFormatVersion is the version of the module format whose open views of a task the file holds. It is written here rather than read from spec.Format: the committed file names it too, so a tag that changes the format changes the file's bytes, and TestPatterns fails until the move writes the file anew and reviews it.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bank ¶
type Bank struct {
Bank string `json:"bank"`
Digest formatv0.Digest `json:"digest"`
Language formatv0.LanguageTag `json:"language"`
Tasks []open.Task `json:"tasks"`
}
Bank is a file of the measurement's tasks: its path in the repository, the digest of its bytes, sha256: and the SHA-256 in hexadecimal as the format writes a digest, the language of its texts, and the open views of its tasks in its order.
type File ¶
type File struct {
Format string `json:"format"`
Version int `json:"version"`
ModuleFormatVersion formatv0.ModuleFormatVersion `json:"module_format_version"`
Banks []Bank `json:"banks"`
}
File is the file of open views: the banks of the measurement, each with its tasks.
func Build ¶
Build builds the file of open views of the given files: banks of tasks, the workbook and the essays, each read and checked as strictly as anywhere else. The file passes Check.
func Read ¶
Read reads a file of open views and checks it. The file is to be as Marshal writes it, byte for byte: so no field is in it that the types do not have — a closed field of a task among them — nor a field in another letter case or twice, which encoding/json alone would take.
func (*File) Check ¶
Check checks the file and returns a *sample.FormatError listing every problem, or nil: its format, version and module format version; each bank named by a relative path in the repository, once, with its digest, its language and its tasks; each task's ID once in the file; and the rules of spec's format for the open view of a task that its Go types do not carry (task.schema.json and common.schema.json), for what the file carries: a statement of paragraphs, a canvas, and items of a slot bound anywhere or sheet, or of a line with boxes.