[alicebot-style] Multiple choice quiz in AIML
Dr. Rich Wallace
alicebot-style@list.alicebot.org
Tue, 26 Jul 2005 16:58:15 -0400 (EDT)
I am grappling with the issue of how to integrate Kim's code into the AAA
set.
Choice (1) which I have done before, is to "flatten" all his files into one
"Multiple.aiml" file.
Choice (2) would be to add all the files separately, but that would break
them up logically in the alphabetical listing.
Choice (3) is to modify the AAA "Wiki" into a hierarchical file system
with folders and put all Kim's files under a "Multiple/" directory. This
will take some time to modify the javascript that counts categories etc.
I have to admit, I'm running up against the limits of the flat directory
structure for the AAA set.
>
>> I know you are thinking, why use AIML for this task? BASIC would be
>> better. Let's just say it's a challenge. My code works alright in
>> isolation, but loaded together with the rest of the AAA set it runs
>> into problems if the client answers something like "B. Virginia" and
>> there is another pattern somewhere "B *".
>
> The code is escaped by a topic. Are you using the interface/function
> code also? The "main event handler" assures that there is always the
> correct topic set (using an underscore), so if your interpreter is
> working correctly, there is no way another pattern that begins with B
> can be triggered.
>
> For clarity, I've attached all files that are needed for the multiple
> choice question code to work. The only thing that needs customizing is
> the CLOZE INIT category in cloze.aiml, and of course the questions in
> the Qx.aiml files. Of course, the pattern "RESPONSE B" is already
> escaped, you MUST leave the word "RESPONSE" intact. If you want to
> capture things like "B Virginia", the pattern has to look like this:
> "RESPONSE B *".
>
> The presented AIML is almost watertight (i.e. due to the fact that a
> "function" is used, it's near impossible to "break out" of the test
> loop), and it presents the questions in a random order (each time, the
> order is different!).
>
> Kim
--
Dr. Rich
W A L L A C E
ALICE A.I. Foundation
drwallace@www.alicebot.org
Winner, Loebner Prize 2000, 2001, 2004