patrick@73
|
1 |
# $Id$
|
patrick@73
|
2 |
|
patrick@73
|
3 |
|
patrick@73
|
4 |
include "publidoc.rnc" {
|
patrick@73
|
5 |
start = publiquiz
|
patrick@73
|
6 |
|
patrick@73
|
7 |
document.content =
|
patrick@73
|
8 |
top.head?,
|
patrick@73
|
9 |
(division | topic | quiz)+
|
patrick@73
|
10 |
}
|
patrick@73
|
11 |
|
patrick@75
|
12 |
|
patrick@73
|
13 |
publiquiz = element publiquiz {
|
patrick@73
|
14 |
publiquiz.attributes,
|
patrick@73
|
15 |
publiquiz.content
|
patrick@73
|
16 |
}
|
patrick@73
|
17 |
|
patrick@73
|
18 |
publiquiz.attributes =
|
patrick@73
|
19 |
version.attribute
|
patrick@73
|
20 |
|
patrick@73
|
21 |
publiquiz.content =
|
patrick@73
|
22 |
document
|
patrick@73
|
23 |
| top.quiz
|
patrick@73
|
24 |
|
patrick@73
|
25 |
|
patrick@73
|
26 |
# =============================================================================
|
patrick@73
|
27 |
# TOP LEVEL
|
patrick@73
|
28 |
# =============================================================================
|
patrick@73
|
29 |
|
patrick@73
|
30 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ quiz ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
31 |
|
patrick@73
|
32 |
top.quiz = element quiz { top.quiz.attributes, quiz.content }
|
patrick@73
|
33 |
|
patrick@73
|
34 |
top.quiz.attributes =
|
patrick@73
|
35 |
quiz.id.attribute
|
patrick@73
|
36 |
& lang.attribute?
|
patrick@73
|
37 |
|
patrick@73
|
38 |
|
patrick@73
|
39 |
# =============================================================================
|
patrick@73
|
40 |
# COMPONENT LEVEL
|
patrick@73
|
41 |
# =============================================================================
|
patrick@73
|
42 |
|
patrick@73
|
43 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ quiz ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
44 |
|
patrick@73
|
45 |
quiz = element quiz { quiz.attributes, quiz.content }
|
patrick@73
|
46 |
|
patrick@73
|
47 |
quiz.attributes =
|
patrick@73
|
48 |
quiz.id.attribute?
|
patrick@73
|
49 |
& lang.attribute?
|
patrick@73
|
50 |
quiz.id.attribute = attribute xml:id { xsd:ID }
|
patrick@73
|
51 |
|
patrick@73
|
52 |
quiz.content =
|
patrick@73
|
53 |
component.head?,
|
patrick@73
|
54 |
instructions,
|
patrick@73
|
55 |
(engine | composite)?,
|
patrick@73
|
56 |
help?,
|
patrick@73
|
57 |
commentary?
|
patrick@73
|
58 |
|
patrick@73
|
59 |
|
patrick@73
|
60 |
# =============================================================================
|
patrick@73
|
61 |
# SECTION LEVEL
|
patrick@73
|
62 |
# =============================================================================
|
patrick@73
|
63 |
|
patrick@73
|
64 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
65 |
|
patrick@73
|
66 |
blanks.section = element section { section.attributes, blanks.section.content }
|
patrick@73
|
67 |
point.section = element section { section.attributes, point.section.content }
|
patrick@73
|
68 |
|
patrick@73
|
69 |
blanks.section.content =
|
patrick@73
|
70 |
section.head?,
|
patrick@73
|
71 |
(blanks.section+ | blanks.block+)
|
patrick@73
|
72 |
point.section.content =
|
patrick@73
|
73 |
section.head?,
|
patrick@73
|
74 |
(point.section+ | point.block+)
|
patrick@73
|
75 |
|
patrick@73
|
76 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ instructions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
77 |
|
patrick@73
|
78 |
instructions = element instructions { section.content }
|
patrick@73
|
79 |
|
patrick@73
|
80 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ engine ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
81 |
|
patrick@73
|
82 |
engine =
|
patrick@75
|
83 |
choices
|
patrick@75
|
84 |
| blanks
|
patrick@73
|
85 |
| point
|
patrick@73
|
86 |
| matching
|
patrick@73
|
87 |
| sort
|
patrick@73
|
88 |
|
patrick@73
|
89 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ choices ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
90 |
|
patrick@75
|
91 |
choices = element choices {
|
patrick@75
|
92 |
(attribute type {"radio"}, choices.attributes, choices.radio.content)
|
patrick@75
|
93 |
| (attribute type {"check"}, choices.attributes, choices.check.content)
|
patrick@75
|
94 |
}
|
patrick@73
|
95 |
|
patrick@73
|
96 |
choices.attributes =
|
patrick@73
|
97 |
shuffle.attribute?
|
patrick@73
|
98 |
shuffle.attribute = attribute shuffle { xsd:boolean }
|
patrick@73
|
99 |
|
patrick@73
|
100 |
choices.radio.content =
|
patrick@73
|
101 |
choices.right
|
patrick@73
|
102 |
& choices.wrong+
|
patrick@73
|
103 |
choices.check.content =
|
patrick@73
|
104 |
(choices.right | choices.wrong)+
|
patrick@73
|
105 |
|
patrick@73
|
106 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blanks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
107 |
|
patrick@75
|
108 |
blanks = element blanks {
|
patrick@75
|
109 |
(attribute type {"fill"}, blanks.fill.attributes, blanks.fill.content)
|
patrick@75
|
110 |
| (attribute type {"select"}, blanks.select.attributes, blanks.select.content)
|
patrick@75
|
111 |
}
|
patrick@73
|
112 |
|
patrick@73
|
113 |
blanks.fill.attributes =
|
patrick@75
|
114 |
strict.attribute?
|
patrick@73
|
115 |
blanks.select.attributes =
|
patrick@73
|
116 |
multiple.attribute?
|
patrick@73
|
117 |
strict.attribute = attribute strict { xsd:boolean }
|
patrick@73
|
118 |
multiple.attribute = attribute multiple { xsd:boolean }
|
patrick@73
|
119 |
|
patrick@73
|
120 |
blanks.fill.content =
|
patrick@73
|
121 |
(blanks.block+ | blanks.section+)
|
patrick@73
|
122 |
blanks.select.content =
|
patrick@73
|
123 |
blanks.wrongs?,
|
patrick@73
|
124 |
(blanks.block+ | blanks.section+)
|
patrick@73
|
125 |
|
patrick@73
|
126 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ point ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
127 |
|
patrick@73
|
128 |
point = element point { point.attributes, point.content }
|
patrick@75
|
129 |
|
patrick@73
|
130 |
point.attributes =
|
patrick@73
|
131 |
point.type.attribute?
|
patrick@73
|
132 |
point.type.attribute = attribute type {
|
patrick@73
|
133 |
"radio" | "radio_button" | "check" | "check_button" }
|
patrick@73
|
134 |
|
patrick@73
|
135 |
point.content =
|
patrick@73
|
136 |
(point.section+ | point.block+)
|
patrick@73
|
137 |
|
patrick@73
|
138 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ matching ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
139 |
|
patrick@73
|
140 |
matching = element matching { matching.content }
|
patrick@75
|
141 |
|
patrick@73
|
142 |
matching.content =
|
patrick@73
|
143 |
match,
|
patrick@73
|
144 |
match+
|
patrick@73
|
145 |
|
patrick@73
|
146 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sort ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
147 |
|
patrick@73
|
148 |
sort = element sort { sort.attributes, sort.content }
|
patrick@73
|
149 |
|
patrick@73
|
150 |
sort.attributes =
|
patrick@73
|
151 |
shuffle.attribute?
|
patrick@75
|
152 |
|
patrick@73
|
153 |
sort.content =
|
patrick@73
|
154 |
comparison?,
|
patrick@73
|
155 |
sort.item,
|
patrick@73
|
156 |
sort.item+
|
patrick@73
|
157 |
|
patrick@73
|
158 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ composite ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
159 |
|
patrick@73
|
160 |
composite = element composite { composite.content }
|
patrick@75
|
161 |
|
patrick@73
|
162 |
composite.content =
|
patrick@73
|
163 |
(instructions?, engine),
|
patrick@73
|
164 |
(instructions?, engine)+
|
patrick@73
|
165 |
|
patrick@73
|
166 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ help ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
167 |
|
patrick@73
|
168 |
help = element help { help.content }
|
patrick@73
|
169 |
|
patrick@73
|
170 |
help.content =
|
patrick@73
|
171 |
(section+ | block+)?,
|
patrick@73
|
172 |
link*
|
patrick@73
|
173 |
|
patrick@73
|
174 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ commentary ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
175 |
|
patrick@73
|
176 |
commentary = element commentary { commentary.content }
|
patrick@73
|
177 |
|
patrick@73
|
178 |
commentary.content =
|
patrick@73
|
179 |
(section+ | block+)
|
patrick@73
|
180 |
|
patrick@73
|
181 |
|
patrick@73
|
182 |
# =============================================================================
|
patrick@73
|
183 |
# BLOCK LEVEL
|
patrick@73
|
184 |
# =============================================================================
|
patrick@73
|
185 |
|
patrick@73
|
186 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
187 |
|
patrick@73
|
188 |
blanks.block =
|
patrick@73
|
189 |
(blanks.p | speech | blanks.list | blockquote | blanks.table | media)
|
patrick@73
|
190 |
point.block =
|
patrick@73
|
191 |
(point.p | speech | point.list | blockquote | point.table | media)
|
patrick@73
|
192 |
|
patrick@73
|
193 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
194 |
|
patrick@73
|
195 |
blanks.p = element p { blanks.p.content }
|
patrick@73
|
196 |
point.p = element p { point.p.content }
|
patrick@73
|
197 |
|
patrick@73
|
198 |
blanks.p.content =
|
patrick@75
|
199 |
blanks.inlines
|
patrick@73
|
200 |
point.p.content =
|
patrick@75
|
201 |
point.inlines
|
patrick@73
|
202 |
|
patrick@73
|
203 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
204 |
|
patrick@73
|
205 |
# ~~~~~~ list
|
patrick@75
|
206 |
blanks.list = element list {
|
patrick@73
|
207 |
block.head?,
|
patrick@73
|
208 |
( (attribute type {"ordered"}?, blanks.item, blanks.item+)
|
patrick@73
|
209 |
| (attribute type {"glossary"}, glossary.item+) )
|
patrick@75
|
210 |
}
|
patrick@75
|
211 |
point.list = element list {
|
patrick@73
|
212 |
block.head?,
|
patrick@73
|
213 |
( (attribute type {"ordered"}?, point.item, point.item+)
|
patrick@73
|
214 |
| (attribute type {"glossary"}, glossary.item+) )
|
patrick@75
|
215 |
}
|
patrick@73
|
216 |
|
patrick@73
|
217 |
# ~~~~~~ item
|
patrick@73
|
218 |
blanks.item = element item { blanks.item.content }
|
patrick@73
|
219 |
point.item = element item { point.item.content }
|
patrick@73
|
220 |
|
patrick@73
|
221 |
blanks.item.content =
|
patrick@75
|
222 |
blanks.inlines
|
patrick@73
|
223 |
| blanks.block+
|
patrick@73
|
224 |
point.item.content =
|
patrick@75
|
225 |
point.inlines
|
patrick@73
|
226 |
| point.block+
|
patrick@73
|
227 |
|
patrick@73
|
228 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
229 |
|
patrick@73
|
230 |
blanks.table = element table { blanks.table.content }
|
patrick@73
|
231 |
point.table = element table { point.table.content }
|
patrick@73
|
232 |
|
patrick@73
|
233 |
blanks.table.content =
|
patrick@73
|
234 |
block.head?,
|
patrick@73
|
235 |
blanks.tgroup+,
|
patrick@73
|
236 |
caption?
|
patrick@73
|
237 |
point.table.content =
|
patrick@73
|
238 |
block.head?,
|
patrick@73
|
239 |
point.tgroup+,
|
patrick@73
|
240 |
caption?
|
patrick@73
|
241 |
|
patrick@73
|
242 |
# ~~~~~~ tgroup
|
patrick@73
|
243 |
blanks.tgroup = element tgroup { tgroup.attributes, blanks.tgroup.content }
|
patrick@73
|
244 |
point.tgroup = element tgroup { tgroup.attributes, point.tgroup.content }
|
patrick@73
|
245 |
|
patrick@73
|
246 |
blanks.tgroup.content =
|
patrick@73
|
247 |
thead?,
|
patrick@73
|
248 |
blanks.tbody
|
patrick@73
|
249 |
point.tgroup.content =
|
patrick@73
|
250 |
thead?,
|
patrick@73
|
251 |
point.tbody
|
patrick@73
|
252 |
|
patrick@73
|
253 |
# ~~~~~~ tbody
|
patrick@73
|
254 |
blanks.tbody = element tbody { tbody.attributes, blanks.tbody.content }
|
patrick@73
|
255 |
point.tbody = element tbody { tbody.attributes, point.tbody.content }
|
patrick@73
|
256 |
|
patrick@73
|
257 |
blanks.tbody.content =
|
patrick@73
|
258 |
blanks.row+
|
patrick@73
|
259 |
point.tbody.content =
|
patrick@73
|
260 |
point.row+
|
patrick@73
|
261 |
|
patrick@73
|
262 |
# ~~~~~~ row
|
patrick@73
|
263 |
blanks.row = element row { row.attribute, blanks.row.content }
|
patrick@73
|
264 |
point.row = element row { row.attribute, point.row.content }
|
patrick@73
|
265 |
|
patrick@73
|
266 |
blanks.row.content =
|
patrick@73
|
267 |
blanks.entry+
|
patrick@73
|
268 |
point.row.content =
|
patrick@73
|
269 |
point.entry+
|
patrick@73
|
270 |
|
patrick@73
|
271 |
# ~~~~~~ entry
|
patrick@73
|
272 |
blanks.entry = element entry { blanks.entry.content }
|
patrick@73
|
273 |
point.entry = element entry { point.entry.content }
|
patrick@73
|
274 |
|
patrick@73
|
275 |
blanks.entry.content =
|
patrick@75
|
276 |
blanks.inlines
|
patrick@73
|
277 |
| (p | media)+
|
patrick@73
|
278 |
|
patrick@73
|
279 |
point.entry.content =
|
patrick@75
|
280 |
point.inlines
|
patrick@73
|
281 |
| (p | media)+
|
patrick@73
|
282 |
|
patrick@73
|
283 |
|
patrick@73
|
284 |
# ~~~~~~~~~~~~~~~~~~~~~~~~ choices.right, choices.wrong ~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
285 |
|
patrick@73
|
286 |
choices.right = element right { choices.right.content }
|
patrick@73
|
287 |
choices.wrong = element wrong { choices.right.content }
|
patrick@73
|
288 |
|
patrick@73
|
289 |
choices.right.content =
|
patrick@73
|
290 |
inlines
|
patrick@73
|
291 |
| p+
|
patrick@73
|
292 |
|
patrick@73
|
293 |
|
patrick@73
|
294 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blanks.wrongs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
295 |
|
patrick@73
|
296 |
# ~~~~~~ blanks.wrongs
|
patrick@73
|
297 |
blanks.wrongs = element wrongs { blanks.wrongs.content }
|
patrick@73
|
298 |
|
patrick@73
|
299 |
blanks.wrongs.content =
|
patrick@73
|
300 |
blanks.wrong+
|
patrick@73
|
301 |
|
patrick@73
|
302 |
# ~~~~~~ blanks.wrong
|
patrick@73
|
303 |
blanks.wrong = element wrong { blanks.wrong.content }
|
patrick@73
|
304 |
|
patrick@73
|
305 |
blanks.wrong.content = text
|
patrick@73
|
306 |
|
patrick@73
|
307 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ match ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
308 |
|
patrick@73
|
309 |
match = element match { match.content }
|
patrick@73
|
310 |
|
patrick@73
|
311 |
match.content =
|
patrick@73
|
312 |
(p | section),
|
patrick@73
|
313 |
(p | section)
|
patrick@73
|
314 |
|
patrick@75
|
315 |
# ~~~~~~~~~~~~~~~~~~~~~~~~ (sort) comparison, item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
316 |
|
patrick@73
|
317 |
# ~~~~~~ comparison
|
patrick@73
|
318 |
comparison = element comparison { comparison.content }
|
patrick@73
|
319 |
|
patrick@73
|
320 |
comparison.content = inlines
|
patrick@73
|
321 |
|
patrick@73
|
322 |
# ~~~~~~ sort.item
|
patrick@73
|
323 |
sort.item = element item { sort.item.attributes, sort.item.content }
|
patrick@73
|
324 |
|
patrick@73
|
325 |
sort.item.attributes =
|
patrick@73
|
326 |
item.shuffle.attribute?
|
patrick@73
|
327 |
item.shuffle.attribute = attribute shuffle { xsd:integer }
|
patrick@73
|
328 |
|
patrick@73
|
329 |
sort.item.content = inlines
|
patrick@73
|
330 |
|
patrick@73
|
331 |
|
patrick@73
|
332 |
# =============================================================================
|
patrick@73
|
333 |
# INLINE LEVEL
|
patrick@73
|
334 |
# =============================================================================
|
patrick@73
|
335 |
|
patrick@75
|
336 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@75
|
337 |
|
patrick@75
|
338 |
blanks.inlines = mixed {
|
patrick@75
|
339 |
sup*
|
patrick@75
|
340 |
& sub*
|
patrick@75
|
341 |
& var*
|
patrick@75
|
342 |
& number*
|
patrick@75
|
343 |
& math*
|
patrick@75
|
344 |
& date*
|
patrick@75
|
345 |
& name*
|
patrick@75
|
346 |
& note*
|
patrick@75
|
347 |
& foreign*
|
patrick@75
|
348 |
& highlight*
|
patrick@75
|
349 |
& mentioned*
|
patrick@75
|
350 |
& quote*
|
patrick@75
|
351 |
& acronym*
|
patrick@75
|
352 |
& term*
|
patrick@75
|
353 |
& link*
|
patrick@75
|
354 |
& anchor*
|
patrick@75
|
355 |
& blank*
|
patrick@75
|
356 |
}
|
patrick@75
|
357 |
point.inlines = mixed {
|
patrick@75
|
358 |
sup*
|
patrick@75
|
359 |
& sub*
|
patrick@75
|
360 |
& var*
|
patrick@75
|
361 |
& number*
|
patrick@75
|
362 |
& math*
|
patrick@75
|
363 |
& date*
|
patrick@75
|
364 |
& name*
|
patrick@75
|
365 |
& note*
|
patrick@75
|
366 |
& foreign*
|
patrick@75
|
367 |
& highlight*
|
patrick@75
|
368 |
& mentioned*
|
patrick@75
|
369 |
& quote*
|
patrick@75
|
370 |
& acronym*
|
patrick@75
|
371 |
& term*
|
patrick@75
|
372 |
& link*
|
patrick@75
|
373 |
& anchor*
|
patrick@75
|
374 |
& blank*
|
patrick@75
|
375 |
& point.right*
|
patrick@75
|
376 |
& point.wrong*
|
patrick@75
|
377 |
}
|
patrick@75
|
378 |
|
patrick@73
|
379 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blank ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
380 |
|
patrick@73
|
381 |
# ~~~~~~ blank
|
patrick@73
|
382 |
blank = element blank { blank.content }
|
patrick@73
|
383 |
|
patrick@73
|
384 |
blank.content =
|
patrick@73
|
385 |
text
|
patrick@73
|
386 |
| (s+, help?, commentary?)
|
patrick@73
|
387 |
|
patrick@73
|
388 |
# ~~~~~~ s
|
patrick@73
|
389 |
s = element s { s.content }
|
patrick@73
|
390 |
|
patrick@73
|
391 |
s.content = text
|
patrick@73
|
392 |
|
patrick@73
|
393 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~ point.right, point.wrong ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
394 |
|
patrick@73
|
395 |
point.right = element right { point.right.content }
|
patrick@73
|
396 |
point.wrong = element wrong { point.right.content }
|
patrick@73
|
397 |
|
patrick@73
|
398 |
point.right.content = inlines
|