Skip to contents

Records the project's current grading state (its template, rubric and marks) as a named, timestamped snapshot inside the project database. The snapshot can be listed (snapshot_list()), inspected (snapshot_info()), compared with another or with the live state (snapshot_diff()), exported to YAML (snapshot_export()) and restored (snapshot_restore()).

Usage

snapshot_create(project = ".", label = NULL, summary = NULL, metadata = list())

Arguments

project

Path to the project directory. Defaults to the working directory.

label

Optional short name, e.g. "Before feedback review". A unique label can be used in place of the snapshot id in the other snapshot_*() functions.

summary

Optional free text: what is about to change, or why the snapshot was taken.

metadata

Optional named list of extra key/value metadata, recorded as keyed notes (e.g. list(review_doc = "notes/review.md")).

Value

The new snapshot's id, invisibly.

Details

Snapshots are also taken automatically before every bulk change to the database: rubric_import(), marks_import(), template_import(), snapshot_restore(), the imports and deletions in mark() and saves in template(), and schema upgrades. Those functions take a summary argument so the reason for a change is recorded with it. An automatic snapshot of a state identical to the latest snapshot's is not created; the operation is recorded as a note on that snapshot instead. A manual snapshot is always created, since its label and summary carry information, and identical parts are stored once.

Examples

if (FALSE) { # \dontrun{
snapshot_create("hw01", label = "Before review",
  summary = "First-pass machine grading reviewed item by item next.")
} # }