room_authoring: Build and Register escapeR Rooms

build_escapeR Documentation

Build and Register escapeR Rooms

Description

Helpers for composing custom escape-room sequences and adding contributed rooms or room packs.

Usage

build_escape(rooms = .builtin_room_ids())

list_escapes()

new_room(id, module, title, learning_goal, introduction, challenge,
  hints, correct_result = NULL, checker = NULL, success, failure = NULL)

new_room_pack(id, title, description, rooms, escapes)

register_room_pack(pack, replace = FALSE)

register_rooms(..., replace = FALSE)

Arguments

rooms

Character vector of room IDs for build_escape(), or a list of room objects for new_room_pack(). Use list_rooms() to see bundled and registered rooms.

id

Unique room ID: a word of at most 8 characters.

module, title, learning_goal, introduction, challenge

Character strings describing the room.

description

Character string describing a room pack.

hints

Character vector of hints shown sequentially by hint().

correct_result

Optional expected answer. Numeric and character results get helpful default checking.

checker

Optional function that takes a submitted answer and returns TRUE for success.

success

Message shown when the room is solved.

failure

Optional message shown when the submitted answer is wrong.

escapes

Named list where each element is a character vector of room IDs.

pack

Room pack created by new_room_pack().

...

Room objects created by new_room(), or a list of room objects.

replace

Logical. If TRUE, replace a previously registered room with the same ID.

Value

build_escape() returns an escape sequence object for escape(). list_escapes() returns a data frame of registered sequences. new_room() returns a modular room object. new_room_pack() returns a shareable room pack. Registration helpers return IDs invisibly.

Examples

build_escape(c("console", "vector"))$room_ids
list_escapes()
room <- new_room(
  id = "meanroom", module = "Arithmetic", title = "A field sample",
  learning_goal = "Calculate a mean", introduction = "Three samples await.",
  challenge = "Submit the mean of 1, 2 and 3.", hints = "Use mean().",
  correct_result = 2, success = "The door opens."
)
room$id

escapeR documentation built on Sept. 27, 2026, 5:06 p.m.