Kuku/Question format: Difference between revisions
(from main page Kuku) |
(stub) |
||
(One intermediate revision by the same user not shown) | |||
Line 12: | Line 12: | ||
*: 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. |
||
=== Current Format === |
|||
==Question/Answer Library== |
|||
Questions and answer pairs are listed each on a line with an = sign separating the question and answer. For example: |
|||
5 + 5 = 10 |
|||
Right now, questions must be just text which is rendered to the screen. A question with a % sign in front of it indicates that the question is a 'multiples' type of question. |
|||
'''stub''' - describe current format |
|||
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. |
|||
=== Files === |
|||
⚫ | |||
from QA import QA |
|||
'''describe file layout''' |
|||
#Basic question/answer |
|||
q = QA() |
|||
== Changing the Game Levels == |
|||
#Load question/correct answer/false answers |
|||
You can change the types of questions that Kuku uses. You should can see a list of the files that kuku uses by looking in the folder |
|||
q.set_question('5 + 5') |
|||
Kuku.activity/data/question_files/arithmetic/ |
|||
q.set_correct_answer(10) |
|||
There is a special file called |
|||
q.set_false_answer(9) |
|||
Kuku.activity/data/question_files/arithmetic/my_questions.dat |
|||
q.set_false_answer([9,11]) |
|||
Open that file in a text editor, and you should see lines of question like |
|||
import random |
|||
⚫ | |||
false_function = lambda x: random.randint(*random.choice([(0,x-1),(x+1,50)])) |
|||
3 + 4 = 7 |
|||
q.set_false_function(false_function) |
|||
41 + 94 = 135 |
|||
-5 + -10 = -15 |
|||
#Get question and answers |
|||
-765 - -269 = -496 |
|||
q.get_question() |
|||
4 + 9 = 13 |
|||
92 - 78 = 14 |
|||
q.get_correct_answer() |
|||
10 |
40 / 10 = 4 |
||
7802 / 83 = 94 |
|||
q.get_false_answer() |
|||
#make sure you leave this line! |
|||
9 |
|||
11 |
|||
21 |
|||
3 |
|||
</pre> |
</pre> |
||
Anything to the left side of the = sign is the question, and the answer is to the right. Feel free to edit this file - the only thing you have to make sure is |
|||
* your answers is an integer |
|||
I have written some unit tests for the above functionality that I will put into the git repo once it is set up. |
|||
* your answers are correct! |
|||
* you leave the line that says "#make sure you leave this line!" |
|||
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. |
|||
Be sure to save the file. You are now one step away from making Kuku ask the questions you want. Open up the file |
|||
Kuku.activity/kuku_config.py |
|||
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. |
|||
At the very bottom, you will find a line that looks like |
|||
#QUESTION_FILES = ["question_files/arithmetic/my_questions.dat"] |
|||
Change this to (i.e. remove the # sign) |
|||
QUESTION_FILES = ["question_files/arithmetic/my_questions.dat"] |
|||
then save the file and restart the game. You should now be playing Kuku with your questions. You can add as many questions as you want! |
Latest revision as of 16:27, 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.
Current Format
Questions and answer pairs are listed each on a line with an = sign separating the question and answer. For example:
5 + 5 = 10
Right now, questions must be just text which is rendered to the screen. A question with a % sign in front of it indicates that the question is a 'multiples' type of question.
stub - describe current format
Files
describe file layout
Changing the Game Levels
You can change the types of questions that Kuku uses. You should can see a list of the files that kuku uses by looking in the folder
Kuku.activity/data/question_files/arithmetic/
There is a special file called
Kuku.activity/data/question_files/arithmetic/my_questions.dat
Open that file in a text editor, and you should see lines of question like
3 + 4 = 7 41 + 94 = 135 -5 + -10 = -15 -765 - -269 = -496 4 + 9 = 13 92 - 78 = 14 40 / 10 = 4 7802 / 83 = 94 #make sure you leave this line!
Anything to the left side of the = sign is the question, and the answer is to the right. Feel free to edit this file - the only thing you have to make sure is
- your answers is an integer
- your answers are correct!
- you leave the line that says "#make sure you leave this line!"
Be sure to save the file. You are now one step away from making Kuku ask the questions you want. Open up the file
Kuku.activity/kuku_config.py
At the very bottom, you will find a line that looks like
#QUESTION_FILES = ["question_files/arithmetic/my_questions.dat"]
Change this to (i.e. remove the # sign)
QUESTION_FILES = ["question_files/arithmetic/my_questions.dat"]
then save the file and restart the game. You should now be playing Kuku with your questions. You can add as many questions as you want!