Handbook
Glossary
multiple-choice-question
Vocabulary
quiz
Definition
IN:
quiz
TUPLE:
multiple-choice-question
<
question
n choices
;
Methods
USING:
accessors
io
kernel
prettyprint
quiz
sequences
;
M:
multiple-choice-question
ask-question
[
generated>>
.
]
[
choices>>
[
first2
swap
" ("
") "
surround
write
...
]
each
flush
]
bi
;
USING:
accessors
kernel
quiz
sequences
;
M:
multiple-choice-question
check-response
[
parsed-response>>
]
[
answer>>
]
bi
member?
;
USING:
accessors
assocs
combinators
kernel
quiz
random
sequences
sequences.extras
;
M:
multiple-choice-question
generate-question
dup
generate-question*
[
random
>>generated
]
[
[
( -- answer )
call-effect
]
map
alphabet-zip
>>choices
]
bi
dup
[
choices>>
]
[
generated>>
( -- answer )
call-effect
]
bi
[
[
second
]
]
dip
[
=
]
curry
compose
find-all
values
keys
>>answer
drop
;
USING:
accessors
kernel
quiz
sequences
;
M:
multiple-choice-question
generate-question*
[
n>>
]
[
generator>>
]
bi
[
generate-question*
]
curry
replicate
;