AI Escape Room
| AI Escape Room | |
|---|---|
| Type | Activity module |
| Set | N/A |
| Downloads | https://moodle.org/plugins/mod_aiescape |
| Issues | https://github.com/adamjenkins/moodle-mod_aiescape/issues |
| Discussion | https://moodle.org/plugins/mod_aiescape |
| Maintainer(s) | Adam Jenkins (WiseCat) |
AI Escape Room is an activity in which students play through a story or a conversation written by an AI. The teacher sets the scene and the goal. Each turn, the AI describes what happens and students choose what to do next, from buttons or by typing. Good moves bring them closer to the goal; when they reach it, they finish the scenario and get their grade.
The activity uses the AI provider that the site administrator has set up in Moodle's AI subsystem.
Installation
Install the plugin from the Moodle plugins directory, or download the ZIP file and follow Installing plugins. The files go in the folder mod/aiescape. The plugin supports Moodle 5.0 to 5.3.
The site needs an AI provider with the Generate text action enabled, in Site administration > AI > AI providers (see AI providers). Any provider that Moodle supports works, for example OpenAI or a local Ollama server.
How it works
The teacher writes a Premise (the scene or the character the AI plays) and a Goal (what ends the scenario), and chooses how many Steps to complete there are.
Each turn, the AI continues the story and offers choices. Some choices are good, some neutral and some bad, but students are not told which is which:
- a good choice adds one step towards the goal,
- a neutral choice does not change the step count,
- a bad choice takes one step away.
When the student reaches the number of steps, the AI ends the story and the attempt is complete. The teacher decides exactly how many good, neutral and bad choices the AI offers each turn. Students can also type their own answer instead of choosing (depending on the game mode); the AI then judges whether it moves them forward.
There are two interaction styles:
- Narrative: the AI narrates a story, and the choices are actions the student takes.
- Persona: the AI plays a named character, and the choices are things the student says to that character. For example, the student has to convince a shopkeeper, or interview a historical figure.
Settings
Site settings

In Site administration > Plugins > Activity modules > AI Escape Room:
- AI configuration: a read-only table of the AI provider that the activity uses (name, provider, model and endpoint).
- Show AI configuration to teachers: if ticked, teachers see the active AI provider and model on the activity page.
- Choice format retry limit (0 to 5, default 2): when the AI does not return the choices it was asked for, Moodle asks it again this many times. If it still fails, students get a single Free turn: Roll the dice... option instead of made-up choices. Picking it continues the story and never costs the student a step.
- Default additional buttons: up to five preset buttons, each with a label, a prompt and a default usage limit. Teachers can turn them on in each activity. Leave the label blank to leave a slot unused.
Activity settings

Timing
- Open the escape room and Close the escape room: optional dates. They are shown on the course page and in the calendar. Any attempt still in progress at the close date is ended automatically, as if the student had quit.
Scenario
- Premise: the story or character that the AI plays, for example "You wake up in a dark cave..." or "You are Luigi, who hates pineapple on pizza...".
- Display premise on module page: shows the premise to students on the activity page.
- Goal: what completes the scenario, for example "Escape the cave and reach sunlight". The AI uses it to decide when the student has finished.
- Display goal on module page: shows the goal to students on the activity page.
Game settings
- Interaction style: Narrative or Persona.
- Persona name: the name of the character the AI plays (Persona style only).
- Game mode: Multiple choice (choice buttons), Free text (students type) or Combo (buttons + text) (both).
- Good choices per turn (1 to 5), Neutral choices per turn (0 to 5), Bad choices per turn (0 to 5): how many choices of each kind the AI offers each turn, in Multiple choice and Combo modes.
- Steps to complete (1 to 100): how many good moves the student needs.
- Progress images: optional pictures shown next to the conversation. With several images, the first one shows at the start and the next one appears each time the student completes an equal share of the steps. They are shown in file name order.
Attempt settings
- Maximum attempts: how many times a student may play, or Unlimited.
- Show progress bar: shows students how many steps they have and how many they need.
- Allow students to review their own attempts: students can read their finished attempts again.
- Award partial score on quit: students who quit before the end get a grade in proportion to their progress (steps reached ÷ steps needed × maximum grade). Otherwise quitting earns no grade.
- Show choice counts to students: shows how many good, neutral and bad choices each turn has, on the activity page.
- Show choice type on hover (preview only): while a teacher previews the activity, each choice button shows whether it is good, neutral or bad when the mouse is over it. Students never see this.
Moderation
- Flag keywords: one word or phrase per line. Any typed student answer that contains one (in Free text and Combo modes, not case-sensitive) is flagged for the teacher.
Additional buttons
- Extra buttons, such as Hint, that send a prompt of your own to the AI, for example "Give the student one small hint about what to try next". They do not change the step count. Each button has a Button label, a Button prompt and an optional Usage limit per attempt. Buttons set up by the administrator appear under Preset buttons, each with an Include checkbox.
The activity also has the standard grade and completion settings. Only point grades are supported, not scales.
Using AI Escape Room
Setting up an escape room
- In a course, turn on edit mode, click Add content in a section, then Activity or resource.
- Choose AI Escape Room and click Add.
- Enter a name, a Premise and a Goal.
- Choose the Interaction style, the Game mode and the number of choices and steps.
- Click Save and display.
Write the premise as you would set the scene for a role-play: who the student is, where they are, and what is around them. Keep the goal concrete, so that the AI can tell when it has been reached.
Playing

Students open the activity and click Start Game. The AI describes the opening scene and offers the choices. Students click a choice, type their own answer and click Send, or use one of the additional buttons. A progress bar shows how far they are, if the teacher turned it on.

Students can leave and come back later: Continue resumes the attempt where they left it. Quit attempt ends it early. When they reach the goal, they see Scenario complete! and the grade goes to the gradebook.
The game can be shown in full screen with the button at its top right corner. If the teacher allows it, students find their finished attempts under View my past attempts.
Previewing as a teacher

Teachers and managers can click Start Game and play the activity like a student, even outside the open and close dates. Their attempts are kept apart from the students': they do not count towards attempt limits, grades, completion or the reports.
With Show choice type on hover (preview only) on, the choice under the mouse turns green (good), grey (neutral) or red (bad), and its tooltip says which kind it is. Use this to check that the premise and goal produce sensible choices.
Reviewing attempts

On the activity page, teachers open the Attempts report. It lists each student with their number of attempts, abandoned and completed attempts, grade and last attempt. View attempt shows the whole conversation of an attempt.

If the activity uses Flag keywords, View flagged attempts lists every typed answer that matched, with the keyword, the message and a link to the full attempt. Flagged messages are also highlighted in the attempt view.
Grades and completion
A completed attempt gets the full grade. A quit or expired attempt gets a partial grade only if Award partial score on quit is on. The usual grade-based completion conditions work, and with automatic completion the activity has its own condition, Complete the scenario.
Course reset
The course reset page has an AI Escape Rooms section with Delete all AI Escape Room attempts (ticked by default). It deletes every attempt in the course's escape rooms and resets their grades.
About typed answers
In Multiple choice mode, Moodle checks every move itself: it records which choices it offered and which kind each one is, and it never sends the kind to the student's browser. A student cannot find the good choice by looking at the page's code.
In Free text and Combo modes, the AI judges each typed answer, and a determined student may try to talk the AI into giving progress. The effect is limited: one turn can move at most one step, and only the student's own grade can change. These modes are best used for practice and other low-stakes work. Use Multiple choice mode when the grade matters.
Capabilities
- mod/aiescape:addinstance (Add an AI Escape Room): add the activity to a course.
- mod/aiescape:view (View an AI Escape Room): open the activity page.
- mod/aiescape:play (Play an AI Escape Room): start and play attempts.
- mod/aiescape:viewreports (View attempt reports): see the attempts report and the flagged attempts, and preview the activity.
- mod/aiescape:viewownattempts (View own past attempts): read one's own finished attempts, when the activity allows it.
Privacy
The plugin stores:
- each student's attempts (start and end times, status, progress and grade),
- the conversation of each attempt (who sent each message, the text and the time),
- keyword flags raised on a student's messages (the keyword and the time).
Students' messages, together with the premise, the goal and the conversation so far, are sent to the AI provider that the site administrator set up, so that it can write the next turn. The plugin declares this in its privacy metadata.
The plugin implements the Privacy API, so this data is included in data exports and deletion requests. See Data privacy.