Check the solved state and the reward
Figure 23. The correct answer updates the feedback and objective. One earlier test point plus the five-point reward gives a score of 6.0.
| Test | Expected result |
|---|---|
| WRONG | No reward; feedback asks for the correct word. |
| clock with outside spaces | Accepted after trimming and uppercasing. |
| Correct answer once | register_open becomes true and five points are added. |
| Call check_answer again | The existing true flag prevents another reward. |
| Start a fresh game | Starting variables return to the authored defaults. |
For an actual room puzzle, replace or extend the successful actions with the change you need: show a clue GUI, change a room object, play a sound or start a conversation. Keep the flag check before the reward.
When loading a saved game, restore presentation from the saved flag as part of opening the panel. A Boolean saved in game state is more dependable than treating the last control's enabled/disabled appearance as the only record of a solved puzzle.
Use the same condition in a visual action list when its data is already in variables. Reading free text into that state is the small script bridge demonstrated here.
