openview

package
v0.1.74 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const (
	Format  = "tutor-open-tasks"
	Version = 0
)

Format is the name the file declares in its "format" field, and Version its version.

View Source
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

func Marshal

func Marshal(f *File) ([]byte, error)

Marshal writes the file as indented JSON, ending with a newline, as tutor's other files are.

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

func Build(inputs []Input) (*File, error)

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

func Read(data []byte) (*File, error)

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

func (f *File) Check() error

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.

type Input

type Input struct {
	Path string
	Data []byte
}

Input is a file of the measurement's tasks: its path in the repository, from its root, and its bytes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL