In this example by Mike Tarbert, the player can occasionally be quizzed on random data from a table; the potential answers will only be understood if a question has just been asked.

"Quiz Show" by Mike Tarbert
Use scoring.
Answer mode is a truth state that varies.
Current state is a text that varies.
Guessing is an action applying to one topic.
Understand "[text]" as guessing when answer mode is true.

Because of the "…when" part of this line, random text is only treated as an answer when a question is being asked.

Check guessing (this is the default wrong answer rule):
   if the topic understood is not a topic listed in the Table of Dates of Statehood:
      say "Wrong!";
   now answer mode is false.
Carry out guessing a topic listed in the Table of Dates of Statehood:
   if state entry is the current state:
      say "Correct! ([comment entry], to be exact!)";
      increase the score by one;
   otherwise:
      say "Wrong!";
   now answer mode is false.

This next rule allows a player to do something other than answer the question, but then makes him wait for another question before answering.

Before doing anything other than guessing:
   if answer mode is true:
      say "(ignoring the question)[line break]";
   now answer mode is false.
Section 2 - Scenario
The Lab is a room. Sam is a man in the lab.
Every turn when the player is in the lab:
   if a random chance of 3 in 5 succeeds:
      choose a random row in the Table of Dates of Statehood;
      say "Sam asks you, 'In what year was [state entry] admitted into the Union?'";
      now current state is state entry;
      now answer mode is true.
Table of Dates of Statehood
StateTopicComment
"Florida""1845""March 3rd"
"Delaware""1787""December 7th"
"Hawaii""1960""July 4th"
Test me with "1845 / z / z / 1787 / 1792 / z / 1845 / g".
Test me with "1845 / z / z / 1787 / 1792 / z / 1845 / g".
Lab
You can see Sam here.

>(Testing.)

>[1] 1845
I didn't understand that sentence.

>[2] z
Time passes.

Sam asks you, "In what year was Hawaii admitted into the Union?"

>[3] z
(ignoring the question)

Time passes.

>[4] 1787
I didn't understand that sentence.

>[5] 1792
I didn't understand that sentence.

>[6] z
Time passes.

>[7] 1845
I didn't understand that sentence.

>[8] g
I didn't understand that sentence.

Note that the situation will become a little more complicated if we have two or more identical topics in our trivia list; in that case, we would need to loop through the Table of Dates of Statehood explicitly, and only mark the player wrong if none of the lines were found to match. (See the chapter on Tables for many more ways to manipulate table behavior.)