Welcome, guest | Sign In | My Account | Store | Cart

Before discovering http://quizlet.com/, the following program was developed for running custom quizzes to help with studying for college courses. The program is not very advanced, but it works reasonably well for what it was designed to do. If the program were developed further, it would need greater capabilities than it currently has and would require a secondary system for actually creating the quizzes (currently, they are hand-typed). Quiz Me could be a starting point for anyone who wishes to actually write a program such as this and inspire others to write much better programs than what this recipe currently offers.

This is an example testbank file for Quiz Me. The questions and answers were created from a book used in a "HI 101" college class. What is presented here is a small sample of what would more likely be a much larger bank of question and answers used for automated quizzing or testing purposes. The XML shown here is formatted correctly dictated by an unwritten specification that the testbank (parsing) module requires. It is the quizcore module that takes the data through its final transformation and also builds questions and answers based on the material available. Once the .build() method has been called on classes inheriting from the _Category class, public attributes (QnA) become available on the _Category objects containing enough information for asking questions with provided answers. Fact objects also have .build() methods; once called, public Q2A and A2Q attributes can be used to find valid mappings of questions to answers and answers to questions.

Python, 294 lines
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
<testbank name="HI 101">
    <chapter name="1">
        <section name="1">
            <category type="multiple_choice">
                <fact type="date">
                    <question>When was the world created?</question>
                    <answer>4000 BC</answer>
                </fact>
                <fact type="date">
                    <question>In what year was the flood?</question>
                    <answer>2300 BC</answer>
                </fact>
                <fact type="date">
                    <answer>3000 BC</answer>
                    <answer>3500 BC</answer>
                </fact>
                <fact type="concept">
                    <question>What is putting man in place of or above God?</question>
                    <answer>Humanism</answer>
                </fact>
                <fact type="concept">
                    <question>What is the way of life of a group of people?</question>
                    <answer>Culture</answer>
                </fact>
                <fact type="concept">
                    <answer>Evolution</answer>
                    <answer>Civilization</answer>
                </fact>
                <fact type="person">
                    <question>Who bragged openly of killing a man?</question>
                    <answer>Lamech</answer>
                </fact>
                <fact type="person">
                    <answer>Adam</answer>
                    <answer>Seth</answer>
                    <answer>Noah</answer>
                </fact>
            </category>
        </section>
        <section name="2">
            <category type="multiple_choice">
                <fact type="region">
                    <question>Shem's descendents migrated where?</question>
                    <answer>Asia</answer>
                </fact>
                <fact type="region">
                    <question>Ham's descendents migrated where?</question>
                    <answer>Africa</answer>
                </fact>
                <fact type="region">
                    <question>Japheth's descendents migrated where?</question>
                    <answer>Europe</answer>
                </fact>
                <fact type="region">
                    <answer>Madagascar</answer>
                </fact>
                <fact type="person">
                    <question>Who was the first great empire builder?</question>
                    <question>Who was known as the mighty hunter?</question>
                    <answer>Nimrod</answer>
                </fact>
                <fact type="person">
                    <answer>Adam</answer>
                    <answer>Seth</answer>
                    <answer>Lamech</answer>
                </fact>
                <fact type="concept">
                    <question>What is a large group of people who think of themselves as one and act in history as a unit?</question>
                    <answer>Nation</answer>
                </fact>
                <fact type="concept">
                    <answer>Civilization</answer>
                    <answer>Country</answer>
                    <answer>Tribe</answer>
                </fact>
            </category>
        </section>
    </chapter>
    <chapter name="2">
        <section name="1">
            <category type="multiple_choice">
                <fact type="definition">
                    <question>What does AD stand for?</question>
                    <answer>Anno Domini</answer>
                </fact>
                <fact type="number">
                    <question>In what year did the Sumerian civilization begin?</question>
                    <answer>2300 BC</answer>
                </fact>
                <fact type="group">
                    <question>What resembles the shape of a crecent moon?</question>
                    <answer>Fertile Crecent</answer>
                </fact>
                <fact type="river">
                    <question>What does Tigris mean?</question>
                    <answer>Arrow</answer>
                </fact>
                <fact type="river">
                    <question>What does Euphrates mean?</question>
                    <answer>That Makes Fruitful</answer>
                </fact>
                <fact type="river">
                    <question>What does Mesopotamia mean?</question>
                    <answer>Land Between Rivers</answer>
                </fact>
                <fact type="range">
                    <question>What are the years between 4000-500 BC called?</question>
                    <answer>Ancient Kingdom</answer>
                </fact>
                <fact type="range">
                    <question>What are the years between AD 500-1500 called?</question>
                    <answer>Medieval</answer>
                </fact>
                <fact type="range">
                    <question>What are the years between 1500-Today called?</question>
                    <answer>Modern</answer>
                </fact>
                <fact type="group">
                    <question>What does the Bible call Sumer?</question>
                    <answer>Shinar</answer>
                </fact>
                <fact type="number">
                    <question>When was the early dynastic age?</question>
                    <answer>2300 BC</answer>
                </fact>
                <fact type="number">
                    <question>When was the old Akkadian period?</question>
                    <answer>2200 BC</answer>
                </fact>
                <fact type="number">
                    <question>When was the 3rd dynasty of Ur?</question>
                    <answer>2100 BC</answer>
                </fact>
                <fact type="person">
                    <question>Who came up with BC and AD?</question>
                    <answer>Bede</answer>
                </fact>
                <fact type="group">
                    <question>Who were the first people to use the wheel?</question>
                    <answer>Sumerians</answer>
                </fact>
                <fact type="person">
                    <question>Who was the second great empire builder?</question>
                    <question>Who conquered the Sumerians in 2200 BC?</question>
                    <answer>Sargon</answer>
                </fact>
                <fact type="definition">
                    <question>What was the Sumerians greatest accomplishment?</question>
                    <answer>Writing</answer>
                </fact>
                <fact type="definition">
                    <question>What was the wedge shaped writings called?</question>
                    <answer>Cuneiform</answer>
                </fact>
                <fact type="person">
                    <question>Who was the god of the sky for the Sumerians?</question>
                    <answer>Anu</answer>
                </fact>
                <fact type="definition">
                    <question>What are the towers that were built in tiers or stages that were used for sacrifices?</question>
                    <answer>Ziggurats</answer>
                </fact>
                <fact type="person">
                    <question>Who was the moon god of the Sumerians?</question>
                    <answer>Nanna</answer>
                </fact>
                <fact type="number">
                    <question>In what year was the third dynasty of Ur?</question>
                    <answer>2100 BC</answer>
                </fact>
                <fact type="person">
                    <question>Who was the third great empire builder?</question>
                    <question>What King was the first to use law codes?</question>
                    <answer>Ur-Nammu</answer>
                </fact>
                <fact type="number">
                    <question>What number did the Sumerians like?</question>
                    <answer>60</answer>
                </fact>
            </category>
        </section>
        <section name="2">
            <category type="multiple_choice">
                <fact type="date">
                    <question>In what year did Hammurabi come to power?</question>
                    <answer>1800 BC</answer>
                </fact>
                <fact type="definition">
                    <question>What is an organized group of people appointed by a ruler to help him govern?</question>
                    <answer>Bureaucracy</answer>
                </fact>
                <fact type="date">
                    <question>In what year did the Amorites and the Elamites invade Sumer?</question>
                    <answer>1900 BC</answer>
                </fact>
                <fact type="god">
                    <question>Who was the sun god that Hammurabi thought gave him the right to make laws?</question>
                    <answer>Shamash</answer>
                </fact>
                <fact type="definition">
                    <question>What is know as making the laws known?</question>
                    <answer>Promulgation</answer>
                </fact>
                <fact type="god">
                    <question>Who was the Sumerian goddess of love?</question>
                    <answer>Inanna</answer>
                    <answer>Ishtar</answer>
                </fact>
                <fact type="god">
                    <question>Who was the chief god of the Babylonians?</question>
                    <answer>Marduk</answer>
                </fact>
                <fact type="number">
                    <question>How many laws did Hammurabi create?</question>
                    <answer>300</answer>
                </fact>
                <fact type="date">
                    <question>In what year did Babylon fall?</question>
                    <answer>1500 BC</answer>
                </fact>
                <fact type="definition">
                    <question>Abraham Isaac and Jacob were know as what?</question>
                    <answer>Patriarchs</answer>
                </fact>
                <fact type="god">
                    <question>Who was the chief god of the Canaanites?</question>
                    <answer>Baal</answer>
                </fact>
                <fact type="definition">
                    <question>A nation or a people living in its own land with its own government is called what?</question>
                    <answer>Nation State</answer>
                </fact>
                <fact type="definition">
                    <question>What are wandering herdsmen called?</question>
                    <answer>Nomads</answer>
                </fact>
                <fact type="number">
                    <question>How many years did the Patriarchs live in Canaan?</question>
                    <answer>230</answer>
                </fact>
                <fact type="date">
                    <question>When was the call of Abraham?</question>
                    <answer>2000 BC</answer>
                </fact>
            </category>
            <category type="true_or_false">
                <fact>
                    <answer>False</answer>
                    <question>Hammurabi's laws were fair for all crimes committed.</question>
                    <question>The wheel was invented after the Sumerian civilization was destroyed.</question>
                </fact>
                <fact>
                    <answer>True</answer>
                    <question>The most important part of a Sumerian city was the ziggurats.</question>
                    <question>Sumerians were humanists.</question>
                </fact>
            </category>
        </section>
        <section name="3">
            <category type="matching">
                <fact>
                    <question>Sun god</question>
                    <answer>Shamash</answer>
                </fact>
                <fact>
                    <question>Sumerian goddess of love</question>
                    <answer>Inanna</answer>
                </fact>
                <fact>
                    <question>Babylonian goddess of love</question>
                    <answer>Ishtar</answer>
                </fact>
                <fact>
                    <question>Chief god of Babylon</question>
                    <answer>Marduk</answer>
                </fact>
                <fact>
                    <question>Chief god of Canaanites</question>
                    <answer>Baal</answer>
                </fact>
                <fact>
                    <question>God of the Patriarchs</question>
                    <answer>Jehovah</answer>
                </fact>
                <fact>
                    <answer>Zeus</answer>
                    <answer>Neptune</answer>
                    <answer>Jupiter</answer>
                    <answer>Thor</answer>
                </fact>
            </category>
        </section>
    </chapter>
</testbank>