Kuku/Question format: Difference between revisions
(from main page Kuku) |
(removed old question api stuff) |
||
Line 11: | Line 11: | ||
* The equivalence class could also consist of a key (for the class), a primary element in the equivalence class (a canonical 'question' for many answers, if one exists), and a set of equivalent entries. |
* The equivalence class could also consist of a key (for the class), a primary element in the equivalence class (a canonical 'question' for many answers, if one exists), and a set of equivalent entries. |
||
*: For instance: "one" [the key], an image string for an image of the numeral 1, and images of 1 piece of various fruits and other objects. the images would all be thumbnailed to the same small size. This could work with the current [[Memonumber|memory number game]], for instance. |
*: For instance: "one" [the key], an image string for an image of the numeral 1, and images of 1 piece of various fruits and other objects. the images would all be thumbnailed to the same small size. This could work with the current [[Memonumber|memory number game]], for instance. |
||
==Question/Answer Library== |
|||
We have started to sketch some API designs. So far I have outlined a basic QA class that is responsible for managing the question and answers (both correct and incorrect) for a single question. |
|||
<pre> |
|||
from QA import QA |
|||
#Basic question/answer |
|||
q = QA() |
|||
#Load question/correct answer/false answers |
|||
q.set_question('5 + 5') |
|||
q.set_correct_answer(10) |
|||
q.set_false_answer(9) |
|||
q.set_false_answer([9,11]) |
|||
import random |
|||
false_function = lambda x: random.randint(*random.choice([(0,x-1),(x+1,50)])) |
|||
q.set_false_function(false_function) |
|||
#Get question and answers |
|||
q.get_question() |
|||
'5 + 5' |
|||
q.get_correct_answer() |
|||
10 |
|||
q.get_false_answer() |
|||
9 |
|||
11 |
|||
21 |
|||
3 |
|||
</pre> |
|||
I have written some unit tests for the above functionality that I will put into the git repo once it is set up. |
|||
The next step is to define a syntax for a textfile that can be parsed and questions loaded from. With a set of questions loaded, it should be very simple to create a command-line quiz activity. |
|||
Something light weight like this will be all that Kuku needs, and will be simple for children to work from. We would love feedback on this though, especially if you have other activities that would benefit from such a general question/answer library. |
Revision as of 16:17, 27 July 2007
This page describes the format that quiz questions are in, default quiz question files included in the kuku bundle, and instructions for editing these files to put in your own quiz questions.
Question format
Questions and answers are effectively equivalence classes. In the most abstract rendition, a question/answer pair could be any two elements drawn from an equivalence class; the player would have to figure out the equivalence (or have a hint from the context of that level) and choose the best match. Making a board for these equivalences would require having a sufficiently large pool of possible answers, a way of randomly selecting entries from the available pool, including at least one equivalent item, and a way to determine equivalence.
Example: numbers and equations
- The equivalence class could consist of the equation, and the set of all numbers which on evaluation satisfy it. One could simply store equations and, when generating the board, be sure to generate at least one number by plugging an integer into the equation.
- In question: when is equivalence tested? When the board is seeded or when an answer is selected? Right now this happens when the answer is selected.
Example: numbers and images
- The equivalence class could also consist of a key (for the class), a primary element in the equivalence class (a canonical 'question' for many answers, if one exists), and a set of equivalent entries.
- For instance: "one" [the key], an image string for an image of the numeral 1, and images of 1 piece of various fruits and other objects. the images would all be thumbnailed to the same small size. This could work with the current memory number game, for instance.