| build_escape | R Documentation |
Helpers for composing custom escape-room sequences and adding contributed rooms or room packs.
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)
rooms |
Character vector of room IDs for |
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 |
correct_result |
Optional expected answer. Numeric and character results get helpful default checking. |
checker |
Optional function that takes a submitted answer and returns |
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 |
... |
Room objects created by |
replace |
Logical. If |
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.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.