RelaxNG/publiquiz.rnc
author Patrick PIERRE
mar., 27 févr. 2018 05:42:22 +0100
changeset 451 1b5caa00aaa8
parent 450 fd645a45932e
child 461 58b2704e601a
permissions -rw-r--r--
Ajout de coloring + memory
patrick@73
     1
include "publidoc.rnc" {
patrick@73
     2
   start = publiquiz
patrick@73
     3
patrick@73
     4
   document.content =
patrick@73
     5
      top.head?,
patrick@73
     6
      (division | topic | quiz)+
patrick@84
     7
patrick@84
     8
   division.content =
patrick@84
     9
      division.head?,
Patrick@353
    10
      front?,
patrick@84
    11
      (division | topic | quiz)+
Coraline@436
    12
Coraline@436
    13
   nowrap.content =
Coraline@441
    14
       inlines | blanks.inlines | blanks-m.inlines | blanks-c.inlines
Coraline@441
    15
       | pointing.inlines
patrick@73
    16
}
patrick@73
    17
patrick@75
    18
patrick@73
    19
publiquiz = element publiquiz {
patrick@73
    20
   publiquiz.attributes,
patrick@73
    21
   publiquiz.content
patrick@73
    22
}
patrick@73
    23
patrick@73
    24
publiquiz.attributes =
patrick@73
    25
   version.attribute
patrick@73
    26
patrick@73
    27
publiquiz.content =
patrick@73
    28
   document
patrick@73
    29
 | top.quiz
patrick@73
    30
patrick@73
    31
patrick@73
    32
# =============================================================================
patrick@73
    33
#                                  TOP LEVEL
patrick@73
    34
# =============================================================================
patrick@73
    35
Patrick@310
    36
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ top.quiz ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
    37
patrick@128
    38
top.quiz = element quiz { top.quiz.attributes, top.quiz.content }
patrick@73
    39
patrick@73
    40
top.quiz.attributes =
Patrick@388
    41
   quiz.id.attribute?
Patrick@158
    42
 & quiz.type.attribute?
patrick@73
    43
 & lang.attribute?
patrick@117
    44
quiz.id.attribute = attribute id { xsd:NMTOKEN }
Patrick@158
    45
quiz.type.attribute = attribute type { xsd:NCName }
patrick@73
    46
patrick@128
    47
top.quiz.content =
patrick@128
    48
   top.head?,
claire@345
    49
   instructions?,
patrick@128
    50
   (engine | composite),
patrick@128
    51
   help?,
patrick@128
    52
   answer?
patrick@73
    53
Patrick@310
    54
patrick@73
    55
# =============================================================================
Patrick@310
    56
#                                COMPONENT LEVEL
patrick@73
    57
# =============================================================================
patrick@73
    58
patrick@73
    59
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ quiz ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
    60
patrick@73
    61
quiz = element quiz { quiz.attributes, quiz.content }
patrick@73
    62
patrick@73
    63
quiz.attributes =
Patrick@310
    64
   (quiz.id.attribute | xmlid.attribute)?
Patrick@158
    65
 & quiz.type.attribute?
patrick@73
    66
 & lang.attribute?
patrick@73
    67
patrick@73
    68
quiz.content =
patrick@73
    69
   component.head?,
Patrick@417
    70
   instructions?,
patrick@87
    71
   (engine | composite),
patrick@73
    72
   help?,
patrick@87
    73
   answer?
patrick@73
    74
patrick@73
    75
patrick@73
    76
# =============================================================================
patrick@73
    77
#                                 SECTION LEVEL
patrick@73
    78
# =============================================================================
patrick@73
    79
patrick@73
    80
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
    81
patrick@73
    82
blanks.section = element section { section.attributes, blanks.section.content }
Coraline@409
    83
blanks-m.section = element section {
Coraline@409
    84
   section.attributes, blanks-m.section.content }
Coraline@441
    85
blanks-c.section = element section {
Coraline@441
    86
   section.attributes, blanks-c.section.content }
Coraline@442
    87
correct.section = element section {
Coraline@442
    88
   section.attributes, correct.section.content }
Patrick@336
    89
pointing.section = element section {
Patrick@336
    90
   section.attributes, pointing.section.content }
patrick@73
    91
patrick@73
    92
blanks.section.content =
patrick@73
    93
   section.head?,
patrick@73
    94
   (blanks.section+ | blanks.block+)
Coraline@409
    95
blanks-m.section.content =
Coraline@409
    96
   section.head?,
Coraline@409
    97
   (blanks-m.section+ | blanks-m.block+)
Coraline@441
    98
blanks-c.section.content =
Coraline@441
    99
   section.head?,
Coraline@441
   100
   (blanks-c.section+ | blanks-c.block+)
Coraline@442
   101
correct.section.content =
Coraline@442
   102
   section.head?,
Coraline@442
   103
   (correct.section+ | correct.block+)
Patrick@336
   104
pointing.section.content =
patrick@73
   105
   section.head?,
Patrick@336
   106
   (pointing.section+ | pointing.block+)
patrick@73
   107
patrick@73
   108
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ instructions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   109
patrick@73
   110
instructions = element instructions { section.content }
patrick@73
   111
patrick@73
   112
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ engine ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   113
patrick@73
   114
engine =
patrick@87
   115
   choices-radio
patrick@87
   116
 | choices-check
patrick@87
   117
 | blanks-fill
patrick@87
   118
 | blanks-select
Coraline@409
   119
 | blanks-media
Coraline@441
   120
 | blanks-choices
Coraline@442
   121
 | correct-line
Patrick@336
   122
 | pointing
Patrick@336
   123
 | pointing-categories
patrick@73
   124
 | matching
patrick@73
   125
 | sort
patrick@125
   126
 | categories
Coraline@438
   127
 | wordsearch
Patrick@448
   128
 | flashcard
Patrick@450
   129
 | coloring
Patrick@450
   130
 | memory
patrick@87
   131
 | production
patrick@73
   132
patrick@73
   133
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ choices ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   134
patrick@87
   135
choices-radio = element choices-radio {
Patrick@376
   136
   choices-radio.attributes, choices-radio.content }
patrick@87
   137
choices-check = element choices-check {
Patrick@376
   138
   choices-check.attributes, choices-check.content }
patrick@73
   139
Patrick@376
   140
choices-radio.attributes =
patrick@73
   141
   shuffle.attribute?
Patrick@376
   142
choices-check.attributes =
Patrick@376
   143
   success.attribute?
Patrick@376
   144
 & shuffle.attribute?
Patrick@376
   145
success.attribute = attribute success { xsd:decimal {maxInclusive="1"} }
patrick@73
   146
shuffle.attribute = attribute shuffle { xsd:boolean }
patrick@73
   147
patrick@87
   148
choices-radio.content =
patrick@73
   149
   choices.right
patrick@73
   150
 & choices.wrong+
patrick@87
   151
choices-check.content =
patrick@73
   152
   (choices.right | choices.wrong)+
patrick@73
   153
patrick@73
   154
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blanks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   155
patrick@87
   156
blanks-fill = element blanks-fill {
patrick@87
   157
   blanks-fill.attributes, blanks-fill.content }
patrick@87
   158
blanks-select = element blanks-select {
patrick@87
   159
   blanks-select.attributes, blanks-select.content }
Coraline@409
   160
blanks-media = element blanks-media {
Coraline@409
   161
   blanks-select.attributes, blanks-media.content }
Coraline@441
   162
blanks-choices = element blanks-choices {
Coraline@441
   163
   blanks-choices.content }
patrick@73
   164
patrick@87
   165
blanks-fill.attributes =
Patrick@376
   166
   success.attribute?
Patrick@376
   167
 & strict.attribute?
claire@381
   168
 & long.attribute?
patrick@87
   169
blanks-select.attributes =
Patrick@376
   170
   success.attribute?
Patrick@376
   171
 & multiple.attribute?
claire@380
   172
 & noshuffle.attribute?
Coraline@409
   173
 & orientation.attribute?
patrick@73
   174
strict.attribute = attribute strict { xsd:boolean }
patrick@73
   175
multiple.attribute = attribute multiple { xsd:boolean }
Coraline@437
   176
noshuffle.attribute = attribute no-shuffle { "true" | "false" | "alpha" }
claire@381
   177
long.attribute = attribute long { xsd:positiveInteger }
Coraline@409
   178
orientation.attribute = attribute orientation {"north"|"east"|"west"|"south"}
patrick@73
   179
patrick@87
   180
blanks-fill.content =
patrick@73
   181
   (blanks.block+ | blanks.section+)
patrick@87
   182
blanks-select.content =
Patrick@342
   183
   blanks.intruders?,
patrick@73
   184
   (blanks.block+ | blanks.section+)
Coraline@409
   185
blanks-media.content =
Coraline@409
   186
   blanks-m.intruders?,
Coraline@409
   187
   (blanks-m.block+ | blanks-m.section+)
Coraline@441
   188
blanks-choices.content =
Coraline@441
   189
   (blanks-c.block+ | blanks-c.section+)
patrick@73
   190
Coraline@442
   191
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ correct-line ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@448
   192
Patrick@448
   193
correct-line = element correct-line { correct.attributes, correct.content }
Coraline@442
   194
Patrick@450
   195
correct.attributes =
Coraline@402
   196
   remove-space.attribute?
Coraline@402
   197
remove-space.attribute = attribute remove-space { xsd:boolean }
Coraline@402
   198
Coraline@442
   199
correct.content =
Coraline@442
   200
   correct.intruders?,
Coraline@442
   201
   (correct.block+ | correct.section+)
Coraline@442
   202
Patrick@336
   203
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pointing ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   204
Patrick@336
   205
pointing = element pointing { pointing.attributes, pointing.content }
patrick@75
   206
Patrick@336
   207
pointing.attributes =
Patrick@376
   208
   success.attribute?
Patrick@376
   209
 & pointing.type.attribute?
Patrick@336
   210
pointing.type.attribute = attribute type { "radio" | "check" }
patrick@73
   211
Patrick@336
   212
pointing.content =
Patrick@336
   213
   (pointing.section+ | pointing.block+)
Patrick@336
   214
Patrick@336
   215
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pointing-categories ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@336
   216
Patrick@336
   217
# ~~~~~~ pointing-categories
Patrick@376
   218
pointing-categories = element pointing-categories {
Patrick@376
   219
   pointing-c.attributes, pointing-c.content }
Patrick@376
   220
Patrick@376
   221
pointing-c.attributes =
Patrick@376
   222
   success.attribute?
Patrick@336
   223
Patrick@336
   224
pointing-c.content =
Patrick@336
   225
   pointing-c.categories,
Patrick@336
   226
   pointing.section
Patrick@336
   227
Patrick@336
   228
# ~~~~~~ pointing-c.categories
Patrick@336
   229
pointing-c.categories = element categories { pointing-c.categories.content }
Patrick@336
   230
Patrick@336
   231
pointing-c.categories.content =
Patrick@336
   232
   pointing-c.category1,
Patrick@336
   233
   pointing-c.category2,
Patrick@336
   234
   (pointing-c.category3,
Patrick@336
   235
      (pointing-c.category4, pointing-c.category5?)?)?
Patrick@336
   236
Patrick@336
   237
# ~~~~~~ pointing-c.categoryN
Patrick@336
   238
pointing-c.category1 = element category {
Patrick@336
   239
   attribute id { "1" }, pointing-c.category.content }
Patrick@336
   240
pointing-c.category2 = element category {
Patrick@336
   241
   attribute id { "2" }, pointing-c.category.content }
Patrick@336
   242
pointing-c.category3 = element category {
Patrick@336
   243
   attribute id { "3" }, pointing-c.category.content }
Patrick@336
   244
pointing-c.category4 = element category {
Patrick@336
   245
   attribute id { "4" }, pointing-c.category.content }
Patrick@336
   246
pointing-c.category5 = element category {
Patrick@336
   247
   attribute id { "5" }, pointing-c.category.content }
Patrick@336
   248
Patrick@336
   249
pointing-c.category.content = inlines
Patrick@336
   250
patrick@73
   251
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ matching ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   252
Patrick@161
   253
# ~~~~~~ matching
Patrick@169
   254
matching = element matching { matching.attributes, matching.content }
Patrick@169
   255
Patrick@169
   256
matching.attributes =
Patrick@376
   257
   success.attribute?
Patrick@376
   258
 & multiple.attribute?
Coraline@438
   259
 & noshuffle.attribute?
Coraline@409
   260
 & orientation.attribute?
patrick@75
   261
patrick@73
   262
matching.content =
Patrick@359
   263
   matching.intruders?,
patrick@73
   264
   match,
patrick@73
   265
   match+
patrick@73
   266
Patrick@161
   267
# ~~~~~~ match
Patrick@161
   268
match = element match { match.content }
Patrick@161
   269
Patrick@161
   270
match.content =
Patrick@161
   271
   match.item,
Patrick@161
   272
   match.item
Patrick@161
   273
patrick@73
   274
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sort ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   275
patrick@73
   276
sort = element sort { sort.attributes, sort.content }
patrick@73
   277
patrick@73
   278
sort.attributes =
Patrick@376
   279
   success.attribute?
Patrick@376
   280
 & shuffle.attribute?
Coraline@409
   281
 & orientation.attribute?
patrick@75
   282
patrick@73
   283
sort.content =
patrick@73
   284
   comparison?,
patrick@73
   285
   sort.item,
patrick@73
   286
   sort.item+
patrick@73
   287
patrick@125
   288
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ categories ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@125
   289
Patrick@310
   290
# ~~~~~~ category.head
Patrick@310
   291
category.head = element head { category.head.content }
Patrick@310
   292
Patrick@310
   293
category.head.content =
Patrick@384
   294
   title
Patrick@384
   295
 & shorttitle?
Patrick@384
   296
 & subtitle*
Patrick@310
   297
patrick@125
   298
# ~~~~~~ categories
Patrick@168
   299
categories = element categories { categories.attributes, categories.content }
patrick@125
   300
Patrick@168
   301
categories.attributes =
Patrick@376
   302
   success.attribute?
Patrick@376
   303
 & multiple.attribute?
claire@380
   304
 & noshuffle.attribute?
Coraline@409
   305
 & orientation.attribute?
Patrick@310
   306
patrick@125
   307
categories.content =
Patrick@344
   308
   categories.intruders?,
patrick@125
   309
   category,
patrick@125
   310
   category+
patrick@125
   311
patrick@125
   312
# ~~~~~~ category
patrick@125
   313
category = element category { category.content }
patrick@125
   314
patrick@125
   315
category.content =
patrick@125
   316
   category.head,
patrick@125
   317
   category.item*
patrick@125
   318
Coraline@438
   319
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ wordsearch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@448
   320
Coraline@438
   321
wordsearch = element wordsearch {wordsearch.attributes, wordsearch.content }
Coraline@438
   322
Coraline@438
   323
wordsearch.attributes =
Coraline@438
   324
   strict.attribute ?
Coraline@438
   325
 & wordlist.attribute ?
Coraline@438
   326
Coraline@438
   327
wordlist.attribute = attribute wordlist { "hidden" | "right" | "left" }
Coraline@438
   328
Coraline@438
   329
wordsearch.content =
Coraline@438
   330
   words
Coraline@438
   331
 & grid
Coraline@438
   332
Coraline@438
   333
# ~~~~~~ words
Coraline@438
   334
words = element words {words.content}
Coraline@438
   335
words.content = words.item+
Coraline@438
   336
Coraline@438
   337
# ~~~~~~ grid
Coraline@438
   338
grid = element grid {grid.content}
Coraline@438
   339
grid.content = line+
Coraline@438
   340
Coraline@438
   341
line = element line {line.content}
Coraline@438
   342
line.content = cell+
Coraline@438
   343
Coraline@438
   344
cell = element cell {cell.content}
Coraline@438
   345
cell.content = xsd:token {pattern = "."}
Patrick@450
   346
Patrick@448
   347
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ flashcard ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@448
   348
Patrick@448
   349
# ~~~~~~ flashcard
Patrick@448
   350
flashcard = element flashcard { flashcard.content }
Patrick@448
   351
Patrick@448
   352
flashcard.content =
Patrick@448
   353
   side1,
Patrick@448
   354
   side2
Patrick@448
   355
Patrick@448
   356
# ~~~~~~ side1
Patrick@448
   357
side1 = element side1 { side1.content }
Patrick@448
   358
Patrick@448
   359
side1.content =
Patrick@448
   360
    section+ | block+
Patrick@448
   361
Patrick@448
   362
# ~~~~~~ side2
Patrick@448
   363
side2 = element side2 { side2.content }
Patrick@448
   364
Patrick@448
   365
side2.content =
Patrick@448
   366
    instructions?,
Patrick@448
   367
    flashcard.engine,
Patrick@448
   368
    help?,
Patrick@448
   369
    answer?
Patrick@448
   370
Patrick@448
   371
# ~~~~~~ flashcard.engine
Patrick@448
   372
flashcard.engine =
Patrick@448
   373
    choices-radio
Patrick@448
   374
    | choices-check
Patrick@448
   375
    | blanks-fill
Patrick@448
   376
    | blanks-select
Patrick@448
   377
    | sort
Patrick@448
   378
Patrick@450
   379
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ coloring ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@450
   380
Patrick@450
   381
coloring = element coloring { coloring.attributes, coloring.content }
Patrick@450
   382
Patrick@450
   383
coloring.attributes =
Patrick@450
   384
    nomark.attribute?
Patrick@450
   385
nomark.attribute = attribute nomark { xsd:boolean }
Patrick@450
   386
Patrick@450
   387
coloring.content =
Patrick@450
   388
    palette
Patrick@450
   389
  & canvas
Patrick@450
   390
  & areas?
Patrick@450
   391
Patrick@450
   392
# ~~~~~~ palette
Patrick@450
   393
palette = element palette { palette.content }
Patrick@450
   394
Patrick@450
   395
palette.content =
Patrick@450
   396
    color+
Patrick@450
   397
Patrick@450
   398
# ~~~~~~ canvas
Patrick@450
   399
canvas = element canvas { canvas.attributes }
Patrick@450
   400
Patrick@450
   401
canvas.attributes =
Patrick@450
   402
    media.id.attribute
Patrick@450
   403
Patrick@450
   404
# ~~~~~~ areas
Patrick@450
   405
areas = element areas { areas.attributes }
Patrick@450
   406
Patrick@450
   407
areas.attributes =
Patrick@450
   408
    media.id.attribute
Patrick@450
   409
Patrick@450
   410
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ memory ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@450
   411
Patrick@450
   412
# ~~~~~~ memory
Patrick@450
   413
memory = element memory { memory.attributes, memory.content }
Patrick@450
   414
Patrick@450
   415
memory.attributes =
Patrick@450
   416
    display.attribute?
Patrick@450
   417
    & delay.attribute?
Patrick@450
   418
display.attribute = attribute display { xsd:positiveInteger }
Patrick@450
   419
delay.attribute = attribute delay { xsd:positiveInteger }
Patrick@450
   420
Patrick@450
   421
memory.content =
Patrick@450
   422
   memory.match,
Patrick@450
   423
   memory.match+
Patrick@450
   424
Patrick@450
   425
# ~~~~~~ memory.match
Patrick@450
   426
memory.match = element match { memory-m.content }
Patrick@450
   427
Patrick@450
   428
memory-m.content =
Patrick@450
   429
    memory-m.item,
Patrick@450
   430
    memory-m.item,
Patrick@450
   431
    audio?
Patrick@450
   432
patrick@87
   433
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ production ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@87
   434
Coraline@407
   435
production = element production { production.content }
Coraline@407
   436
Coraline@407
   437
production.content = text
patrick@87
   438
patrick@73
   439
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ composite ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   440
patrick@77
   441
# ~~~~~~ composite
Patrick@161
   442
composite = element composite { composite.attributes, composite.content }
Patrick@161
   443
Patrick@161
   444
composite.attributes =
Patrick@376
   445
   success.attribute?
Patrick@376
   446
 & multipage.attribute?
Patrick@310
   447
multipage.attribute = attribute multipage { xsd:boolean }
patrick@75
   448
patrick@73
   449
composite.content =
patrick@85
   450
   subquiz,
Patrick@154
   451
   subquiz+
patrick@77
   452
patrick@85
   453
# ~~~~~~ subquiz
patrick@85
   454
subquiz = element subquiz { subquiz.content }
patrick@77
   455
patrick@85
   456
subquiz.content =
patrick@77
   457
   instructions?,
Patrick@141
   458
   engine,
Patrick@141
   459
   help?,
Patrick@141
   460
   answer?
patrick@73
   461
patrick@73
   462
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ help ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   463
patrick@73
   464
help = element help { help.content }
patrick@73
   465
patrick@73
   466
help.content =
patrick@73
   467
   (section+ | block+)?,
patrick@73
   468
   link*
patrick@73
   469
patrick@87
   470
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ answer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   471
patrick@87
   472
answer = element answer { answer.content }
patrick@73
   473
patrick@87
   474
answer.content =
patrick@81
   475
   (section+ | block+)?,
patrick@80
   476
   link*
patrick@73
   477
patrick@73
   478
patrick@73
   479
# =============================================================================
patrick@73
   480
#                                 BLOCK LEVEL
patrick@73
   481
# =============================================================================
patrick@73
   482
patrick@73
   483
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   484
Patrick@313
   485
blanks.block = (
Patrick@313
   486
   blanks.p | blanks.list | blanks.blockquote | blanks.speech | blanks.table
Patrick@313
   487
 | blanks.media)
Coraline@409
   488
blanks-m.block = (
Coraline@409
   489
   blanks-m.p | blanks-m.list | blanks-m.blockquote | blanks-m.speech
Coraline@409
   490
 | blanks-m.table | blanks-m.media)
Coraline@441
   491
blanks-c.block = (
Coraline@441
   492
   blanks-c.p | blanks-c.list | blanks-c.blockquote | blanks-c.speech
Coraline@441
   493
 | blanks-c.table | blanks-c.media)
Coraline@442
   494
correct.block = (
Coraline@442
   495
   correct.p | correct.list | correct.blockquote | correct.speech
Coraline@442
   496
 | correct.table | media)
Patrick@336
   497
pointing.block = (
Patrick@336
   498
   pointing.p | pointing.list | pointing.blockquote | pointing.speech
Patrick@336
   499
 | pointing.table | media)
patrick@73
   500
patrick@73
   501
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   502
patrick@73
   503
blanks.p = element p { blanks.p.content }
Coraline@409
   504
blanks-m.p = element p { blanks-m.p.content }
Coraline@441
   505
blanks-c.p = element p { blanks-c.p.content }
Coraline@442
   506
correct.p = element p { correct.p.content }
Patrick@336
   507
pointing.p = element p { pointing.p.content }
patrick@73
   508
patrick@73
   509
blanks.p.content =
patrick@75
   510
   blanks.inlines
Coraline@409
   511
blanks-m.p.content =
Coraline@409
   512
   blanks-m.inlines
Coraline@441
   513
blanks-c.p.content =
Coraline@441
   514
   blanks-c.inlines
Coraline@442
   515
correct.p.content =
Coraline@442
   516
   correct.inlines
Patrick@336
   517
pointing.p.content =
Patrick@336
   518
   pointing.inlines
patrick@73
   519
patrick@73
   520
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   521
patrick@73
   522
# ~~~~~~ list
patrick@75
   523
blanks.list = element list {
patrick@73
   524
   block.head?,
patrick@73
   525
   (  (attribute type {"ordered"}?, blanks.item, blanks.item+)
Coraline@422
   526
    | (attribute type {"glossary"}, item.glossary+) )
patrick@75
   527
}
Coraline@409
   528
blanks-m.list = element list {
Coraline@409
   529
   block.head?,
Coraline@441
   530
   (  (attribute type {"ordered"}?, blanks-m.item, blanks-m.item+)
Coraline@441
   531
    | (attribute type {"glossary"}, item.glossary+) )
Coraline@441
   532
}
Coraline@441
   533
blanks-c.list = element list {
Coraline@441
   534
   block.head?,
Coraline@409
   535
   (  (attribute type {"ordered"}?, blanks.item, blanks.item+)
Coraline@422
   536
    | (attribute type {"glossary"}, item.glossary+) )
Coraline@409
   537
}
Coraline@442
   538
correct.list = element list {
Coraline@442
   539
   block.head?,
Coraline@442
   540
   (  (attribute type {"ordered"}?, correct.item, correct.item+)
Coraline@442
   541
    | (attribute type {"glossary"}, item.glossary+) )
Coraline@442
   542
}
Patrick@336
   543
pointing.list = element list {
patrick@73
   544
   block.head?,
Patrick@336
   545
   (  (attribute type {"ordered"}?, pointing.item, pointing.item+)
Coraline@422
   546
    | (attribute type {"glossary"}, item.glossary+) )
patrick@75
   547
}
patrick@73
   548
patrick@73
   549
# ~~~~~~ item
patrick@73
   550
blanks.item = element item { blanks.item.content }
Coraline@441
   551
blanks-m.item = element item { blanks-m.item.content }
Coraline@441
   552
blanks-c.item = element item { blanks-c.item.content }
Coraline@442
   553
correct.item = element item { correct.item.content }
Patrick@336
   554
pointing.item = element item { pointing.item.content }
Patrick@450
   555
patrick@73
   556
Coraline@442
   557
blanks.item.content = blanks.inlines | blanks.block+
Coraline@442
   558
blanks-m.item.content = blanks-m.inlines | blanks-m.block+
Coraline@442
   559
blanks-c.item.content = blanks-c.inlines | blanks-c.block+
Coraline@442
   560
correct.item.content = correct.inlines | correct.block+
Coraline@442
   561
pointing.item.content = pointing.inlines | pointing.block+
patrick@73
   562
Patrick@313
   563
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blockquote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@313
   564
Patrick@313
   565
blanks.blockquote = element blockquote {
Patrick@313
   566
   blockquote.attributes, blanks.blockquote.content }
Coraline@409
   567
blanks-m.blockquote = element blockquote {
Coraline@409
   568
   blockquote.attributes, blanks-m.blockquote.content }
Coraline@441
   569
blanks-c.blockquote = element blockquote {
Coraline@441
   570
   blockquote.attributes, blanks-c.blockquote.content }
Coraline@442
   571
correct.blockquote = element blockquote {
Coraline@442
   572
   blockquote.attributes, correct.blockquote.content }
Patrick@336
   573
pointing.blockquote = element blockquote {
Patrick@336
   574
   blockquote.attributes, pointing.blockquote.content }
Patrick@313
   575
Patrick@313
   576
blanks.blockquote.content =
Patrick@313
   577
   block.head?,
Patrick@313
   578
   (blanks.p | speech | blanks.list)+,
Patrick@313
   579
   attribution?
Coraline@409
   580
blanks-m.blockquote.content =
Coraline@409
   581
   block.head?,
Coraline@409
   582
   (blanks-m.p | speech | blanks-m.list)+,
Coraline@409
   583
   attribution?
Coraline@441
   584
blanks-c.blockquote.content =
Coraline@441
   585
   block.head?,
Coraline@441
   586
   (blanks-c.p | speech | blanks-c.list)+,
Coraline@441
   587
   attribution?
Coraline@442
   588
correct.blockquote.content =
Coraline@442
   589
   block.head?,
Coraline@442
   590
   (correct.p | speech | correct.list)+,
Coraline@442
   591
   attribution?
Patrick@336
   592
pointing.blockquote.content =
Patrick@313
   593
   block.head?,
Patrick@336
   594
   (pointing.p | speech | pointing.list)+,
Patrick@313
   595
   attribution?
Patrick@313
   596
Patrick@313
   597
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@313
   598
Patrick@313
   599
# ~~~~~~ speech
Patrick@313
   600
blanks.speech = element speech { blanks.speech.content }
Coraline@409
   601
blanks-m.speech = element speech { blanks-m.speech.content }
Coraline@441
   602
blanks-c.speech = element speech { blanks-c.speech.content }
Coraline@442
   603
correct.speech = element speech { correct.speech.content }
Patrick@336
   604
pointing.speech = element speech { pointing.speech.content }
Patrick@313
   605
Patrick@313
   606
blanks.speech.content =
Patrick@313
   607
   blanks.speaker?,
Patrick@313
   608
   stage?,
Patrick@313
   609
   (blanks.p | blanks.blockquote)+
Coraline@409
   610
blanks-m.speech.content =
Coraline@409
   611
   blanks-m.speaker?,
Coraline@409
   612
   stage?,
Coraline@409
   613
   (blanks-m.p | blanks-m.blockquote)+
Coraline@441
   614
blanks-c.speech.content =
Coraline@441
   615
   blanks-c.speaker?,
Coraline@441
   616
   stage?,
Coraline@441
   617
   (blanks-c.p | blanks-c.blockquote)+
Coraline@442
   618
correct.speech.content =
Coraline@442
   619
   correct.speaker?,
Coraline@442
   620
   stage?,
Coraline@442
   621
   (correct.p | correct.blockquote)+
Patrick@336
   622
pointing.speech.content =
Patrick@336
   623
   pointing.speaker?,
Patrick@313
   624
   stage?,
Patrick@336
   625
   (pointing.p | pointing.blockquote)+
Patrick@313
   626
Patrick@313
   627
# ~~~~~~ speaker
Patrick@313
   628
blanks.speaker = element speaker { blanks.speaker.content }
Coraline@409
   629
blanks-m.speaker = element speaker { blanks-m.speaker.content }
Coraline@441
   630
blanks-c.speaker = element speaker { blanks-c.speaker.content }
Coraline@442
   631
correct.speaker = element speaker { correct.speaker.content }
Patrick@336
   632
pointing.speaker = element speaker { pointing.speaker.content }
Patrick@313
   633
Patrick@313
   634
blanks.speaker.content = blanks.inlines
Coraline@409
   635
blanks-m.speaker.content = blanks-m.inlines
Coraline@441
   636
blanks-c.speaker.content = blanks-c.inlines
Coraline@442
   637
correct.speaker.content = correct.inlines
Patrick@336
   638
pointing.speaker.content = pointing.inlines
Patrick@313
   639
patrick@73
   640
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   641
Patrick@313
   642
# ~~~~~~ table
patrick@249
   643
blanks.table = element table { table.attributes, blanks.table.content }
Coraline@409
   644
blanks-m.table = element table { table.attributes, blanks-m.table.content }
Coraline@441
   645
blanks-c.table = element table { table.attributes, blanks-m.table.content }
Coraline@442
   646
correct.table = element table { table.attributes, correct.table.content }
Patrick@336
   647
pointing.table = element table { table.attributes, pointing.table.content }
patrick@73
   648
patrick@73
   649
blanks.table.content =
patrick@73
   650
   block.head?,
Patrick@358
   651
   ((thead?, blanks.tbody+) | blanks.tr+),
Patrick@313
   652
   blanks.table.caption?
Coraline@409
   653
blanks-m.table.content =
Coraline@409
   654
   block.head?,
Coraline@409
   655
   ((thead?, blanks-m.tbody+) | blanks-m.tr+),
Coraline@409
   656
   blanks-m.table.caption?
Coraline@441
   657
blanks-c.table.content =
Coraline@441
   658
   block.head?,
Coraline@441
   659
   ((thead?, blanks-c.tbody+) | blanks-c.tr+),
Coraline@441
   660
   blanks-c.table.caption?
Coraline@442
   661
correct.table.content =
Coraline@442
   662
   block.head?,
Coraline@442
   663
   ((thead?, correct.tbody+) | correct.tr+),
Coraline@442
   664
   correct.table.caption?
Patrick@336
   665
pointing.table.content =
patrick@73
   666
   block.head?,
Patrick@358
   667
   ((thead?, pointing.tbody+) | pointing.tr+),
Patrick@336
   668
   pointing.table.caption?
patrick@73
   669
patrick@73
   670
# ~~~~~~ tbody
patrick@249
   671
blanks.tbody = element tbody { blanks.tbody.content }
Coraline@409
   672
blanks-m.tbody = element tbody { blanks-m.tbody.content }
Coraline@441
   673
blanks-c.tbody = element tbody { blanks-m.tbody.content }
Coraline@442
   674
correct.tbody = element tbody { correct.tbody.content }
Patrick@336
   675
pointing.tbody = element tbody { pointing.tbody.content }
patrick@73
   676
patrick@73
   677
blanks.tbody.content =
patrick@249
   678
   blanks.tr+
Coraline@409
   679
blanks-m.tbody.content =
Coraline@409
   680
   blanks-m.tr+
Coraline@441
   681
blanks-c.tbody.content =
Coraline@441
   682
   blanks-c.tr+
Coraline@442
   683
correct.tbody.content =
Coraline@442
   684
   correct.tr+
Patrick@336
   685
pointing.tbody.content =
Patrick@336
   686
   pointing.tr+
patrick@73
   687
patrick@249
   688
# ~~~~~~ tr
patrick@249
   689
blanks.tr = element tr { tr.attributes, blanks.tr.content }
Coraline@409
   690
blanks-m.tr = element tr { tr.attributes, blanks-m.tr.content }
Coraline@441
   691
blanks-c.tr = element tr { tr.attributes, blanks-c.tr.content }
Coraline@442
   692
correct.tr = element tr { tr.attributes, correct.tr.content }
Patrick@336
   693
pointing.tr = element tr { tr.attributes, pointing.tr.content }
patrick@73
   694
patrick@249
   695
blanks.tr.content =
patrick@249
   696
  (blanks.td | blanks.th)+
Coraline@409
   697
blanks-m.tr.content =
Coraline@409
   698
  (blanks-m.td | blanks-m.th)+
Coraline@441
   699
blanks-c.tr.content =
Coraline@441
   700
  (blanks-c.td | blanks-c.th)+
Coraline@442
   701
correct.tr.content =
Coraline@442
   702
  (correct.td | correct.th)+
Patrick@336
   703
pointing.tr.content =
Patrick@336
   704
  (pointing.td | pointing.th)+
patrick@73
   705
patrick@249
   706
# ~~~~~~ td, th
patrick@249
   707
blanks.td = element td { td.attributes, blanks.td.content }
patrick@249
   708
blanks.th = element th { td.attributes, blanks.td.content }
Coraline@409
   709
blanks-m.td = element td { td.attributes, blanks-m.td.content }
Coraline@409
   710
blanks-m.th = element th { td.attributes, blanks-m.td.content }
Coraline@441
   711
blanks-c.td = element td { td.attributes, blanks-c.td.content }
Coraline@441
   712
blanks-c.th = element th { td.attributes, blanks-c.td.content }
Coraline@442
   713
correct.td = element td { td.attributes, correct.td.content }
Coraline@442
   714
correct.th = element th { td.attributes, correct.td.content }
Patrick@336
   715
pointing.td = element td { td.attributes, pointing.td.content }
Patrick@336
   716
pointing.th = element th { td.attributes, pointing.td.content }
patrick@73
   717
patrick@249
   718
blanks.td.content =
patrick@75
   719
   blanks.inlines
Patrick@313
   720
 | (blanks.p | blanks.media)+
Coraline@409
   721
blanks-m.td.content =
Coraline@409
   722
   blanks-m.inlines
Coraline@409
   723
 | (blanks-m.p | blanks-m.media)+
Coraline@441
   724
blanks-c.td.content =
Coraline@441
   725
   blanks-c.inlines
Coraline@441
   726
 | (blanks-c.p | blanks-c.media)+
Coraline@442
   727
correct.td.content =
Coraline@442
   728
   correct.inlines
Coraline@442
   729
 | (correct.p | media)+
Patrick@336
   730
pointing.td.content =
Patrick@336
   731
   pointing.inlines
Patrick@336
   732
 | (pointing.p | media)+
Patrick@313
   733
Patrick@313
   734
# ~~~~~~ table.caption
Patrick@313
   735
blanks.table.caption = element caption { blanks.caption.content }
Coraline@409
   736
blanks-m.table.caption = element caption { blanks-m.caption.content }
Coraline@441
   737
blanks-c.table.caption = element caption { blanks-c.caption.content }
Coraline@442
   738
correct.table.caption = element caption { correct.caption.content }
Patrick@336
   739
pointing.table.caption = element caption { pointing.caption.content }
Patrick@313
   740
Patrick@313
   741
blanks.caption.content =
Patrick@313
   742
   blanks.inlines
Patrick@313
   743
 | (blanks.p | speech | blanks.list | blockquote)+
Coraline@409
   744
blanks-m.caption.content =
Coraline@409
   745
   blanks-m.inlines
Coraline@409
   746
 | (blanks-m.p | speech | blanks-m.list | blockquote)+
Coraline@441
   747
blanks-c.caption.content =
Coraline@441
   748
   blanks-c.inlines
Coraline@441
   749
 | (blanks-c.p | speech | blanks-c.list | blockquote)+
Coraline@442
   750
correct.caption.content =
Coraline@442
   751
   correct.inlines
Coraline@442
   752
 | (correct.p | speech | correct.list | blockquote)+
Patrick@336
   753
pointing.caption.content =
Patrick@336
   754
   pointing.inlines
Patrick@336
   755
 | (pointing.p | speech | pointing.list | blockquote)+
patrick@73
   756
Patrick@174
   757
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@174
   758
Patrick@313
   759
# ~~~~~~ media
Patrick@313
   760
blanks.media = element media { media.attributes, blanks.media.content }
Coraline@409
   761
blanks-m.media = element media { media.attributes, blanks-m.media.content }
Coraline@441
   762
blanks-c.media = element media { media.attributes, blanks-c.media.content }
Coraline@442
   763
correct.media = element media { media.attributes, correct.media.content }
Patrick@336
   764
pointing.media = element media { media.attributes, pointing.media.content }
Patrick@174
   765
Patrick@313
   766
blanks.media.content =
Patrick@174
   767
   block.head?,
Patrick@174
   768
   (blanks.image | audio | video)+,
Patrick@313
   769
   blanks.media.caption?,
Patrick@313
   770
   link?
Coraline@409
   771
blanks-m.media.content =
Coraline@409
   772
   block.head?,
Coraline@409
   773
   (blanks-m.image | audio | video)+,
Coraline@409
   774
   blanks-m.media.caption?,
Coraline@409
   775
   link?
Coraline@441
   776
blanks-c.media.content =
Coraline@441
   777
   block.head?,
Coraline@441
   778
   (image | audio | video)+,
Coraline@441
   779
   blanks-c.media.caption?,
Coraline@441
   780
   link?
Coraline@442
   781
correct.media.content =
Coraline@442
   782
   block.head?,
Coraline@442
   783
   (image | audio | video)+,
Coraline@442
   784
   correct.media.caption?,
Coraline@442
   785
   link?
Patrick@336
   786
pointing.media.content =
Patrick@313
   787
   block.head?,
Patrick@313
   788
   (image | audio | video)+,
Patrick@336
   789
   pointing.media.caption?,
Patrick@174
   790
   link?
Patrick@174
   791
Patrick@174
   792
# ~~~~~~ blanks.image
Patrick@174
   793
blanks.image = element image { image.attributes, blanks.image.content }
Coraline@409
   794
blanks-m.image = element image { image.attributes, blanks-m.image.content }
Patrick@174
   795
Patrick@174
   796
blanks.image.content =
Patrick@174
   797
   copyright?,
Patrick@192
   798
   blanks.dropzone*
Coraline@409
   799
blanks-m.image.content =
Coraline@409
   800
   copyright?,
Coraline@409
   801
   blanks-m.dropzone*
Patrick@174
   802
Patrick@313
   803
# ~~~~~~ dropzone
Patrick@192
   804
blanks.dropzone = element dropzone {
Patrick@192
   805
   blanks.dropzone.attributes, blanks.dropzone.content }
Coraline@409
   806
blanks-m.dropzone = element dropzone {
Patrick@411
   807
   blanks-m.dropzone.attributes, blanks-m.dropzone.content }
Patrick@183
   808
Patrick@192
   809
blanks.dropzone.attributes =
Patrick@183
   810
   x.attribute
Patrick@310
   811
 & y.attribute
Patrick@411
   812
blanks-m.dropzone.attributes =
patrick@194
   813
   x.attribute
patrick@194
   814
 & y.attribute
Coraline@412
   815
 & h.attribute
patrick@194
   816
 & w.attribute
Patrick@174
   817
Patrick@192
   818
blanks.dropzone.content =
Patrick@183
   819
   blank
Coraline@409
   820
blanks-m.dropzone.content =
Coraline@409
   821
   blank-m
Patrick@174
   822
Patrick@313
   823
# ~~~~~~ media.caption
Patrick@313
   824
blanks.media.caption = element caption {
Patrick@313
   825
   caption.attributes, blanks.caption.content }
Coraline@409
   826
blanks-m.media.caption = element caption {
Coraline@409
   827
   caption.attributes, blanks-m.caption.content }
Coraline@441
   828
blanks-c.media.caption = element caption {
Coraline@441
   829
   caption.attributes, blanks-c.caption.content }
Coraline@442
   830
correct.media.caption = element caption {
Coraline@442
   831
   caption.attributes, correct.caption.content }
Patrick@336
   832
pointing.media.caption = element caption {
Patrick@336
   833
   caption.attributes, pointing.caption.content }
Patrick@313
   834
patrick@73
   835
# ~~~~~~~~~~~~~~~~~~~~~~~~ choices.right, choices.wrong ~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   836
patrick@73
   837
choices.right = element right { choices.right.content }
patrick@73
   838
choices.wrong = element wrong { choices.right.content }
patrick@73
   839
patrick@73
   840
choices.right.content =
patrick@73
   841
   inlines
Patrick@161
   842
 | ((p | image | (audio, image?) | video), help?, answer?)
patrick@73
   843
Coraline@409
   844
# ~~~~~~~~~~~~~~~~~~~~ blanks.intruders, blanks-m.intruders  ~~~~~~~~~~~~~~~~~~
patrick@73
   845
Patrick@342
   846
blanks.intruders = element intruders { blanks.intruders.content }
Coraline@409
   847
blanks-m.intruders = element intruders { blanks-m.intruders.content }
patrick@73
   848
Coraline@409
   849
blanks.intruders.content = blank+
Coraline@409
   850
blanks-m.intruders.content = blank-m+
patrick@73
   851
Coraline@442
   852
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ correct.intruders ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Coraline@442
   853
Coraline@442
   854
correct.intruders = element intruders { correct.intruders.content }
Coraline@442
   855
Coraline@442
   856
correct.intruders.content = char+
Coraline@442
   857
Patrick@359
   858
# ~~~~~~~~~~~~~~~~~~~~~~~ matching.intruders, match.item ~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   859
Patrick@359
   860
# ~~~~~~~ matching.intruders
Patrick@359
   861
matching.intruders = element intruders { matching.intruders.content }
Patrick@359
   862
Patrick@359
   863
matching.intruders.content =
Patrick@359
   864
   match.item+
Patrick@359
   865
Patrick@359
   866
# ~~~~~~~ match.item
Patrick@161
   867
match.item = element item { match.item.content }
patrick@73
   868
Patrick@161
   869
match.item.content =
Patrick@161
   870
   inlines
Patrick@341
   871
 | (p, help?, answer?)
patrick@73
   872
Patrick@313
   873
# ~~~~~~~~~~~~~~~~~~~~~~~~ comparison, sort.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   874
patrick@73
   875
# ~~~~~~ comparison
patrick@73
   876
comparison = element comparison { comparison.content }
patrick@73
   877
patrick@73
   878
comparison.content = inlines
patrick@73
   879
patrick@73
   880
# ~~~~~~ sort.item
patrick@73
   881
sort.item = element item { sort.item.attributes, sort.item.content }
patrick@73
   882
patrick@73
   883
sort.item.attributes =
patrick@73
   884
   item.shuffle.attribute?
patrick@73
   885
item.shuffle.attribute = attribute shuffle { xsd:integer }
patrick@73
   886
Patrick@161
   887
sort.item.content =
Patrick@161
   888
   inlines
Patrick@341
   889
 | (p, help?, answer?)
patrick@73
   890
Patrick@344
   891
# ~~~~~~~~~~~~~~~~~~~~~ categories.intruders, category.item ~~~~~~~~~~~~~~~~~~~
patrick@125
   892
Patrick@344
   893
# ~~~~~~ categories.intruders
Patrick@344
   894
categories.intruders = element intruders { categories.intruders.content }
Patrick@342
   895
Patrick@344
   896
categories.intruders.content =
Patrick@342
   897
   category.item+
Patrick@342
   898
Patrick@342
   899
# ~~~~~~ category.item
patrick@125
   900
category.item = element item { category.item.content }
patrick@125
   901
Patrick@161
   902
category.item.content =
Patrick@161
   903
   inlines
Patrick@341
   904
 | (p, help?, answer?)
patrick@125
   905
Coraline@438
   906
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ words.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Coraline@438
   907
words.item = element item {words.item.content, words.item.attributes }
Patrick@450
   908
Coraline@438
   909
words.item.content = inlines
Coraline@438
   910
Coraline@438
   911
words.item.attributes =
Coraline@438
   912
   startx
Coraline@438
   913
 & starty
Coraline@438
   914
 & endx
Coraline@438
   915
 & endy
Coraline@438
   916
Coraline@438
   917
startx = attribute startx {xsd:token {pattern = "[a-zA-Z]+"}}
Coraline@438
   918
starty = attribute starty {xsd:token {pattern = "\d+"}}
Coraline@438
   919
endx = attribute endx {xsd:token {pattern = "[a-zA-Z]+"}}
Coraline@438
   920
endy = attribute endy {xsd:token {pattern = "\d+"}}
Coraline@438
   921
Patrick@450
   922
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ color ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@450
   923
Patrick@450
   924
color = element color { color.attributes }
Patrick@450
   925
Patrick@450
   926
color.attributes =
Patrick@450
   927
    color.code
Patrick@450
   928
    & color.coderef?
Patrick@450
   929
color.code = attribute code {xsd:token { pattern = "#(\d|\w){6}"}}
Patrick@450
   930
color.coderef = attribute coderef { list{xsd:token { pattern = "#(\d|\w){6}"}+}}
Patrick@450
   931
Patrick@450
   932
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ memory-m.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@450
   933
Patrick@450
   934
memory-m.item = element item { memory-m.item.content }
Patrick@450
   935
Patrick@450
   936
memory-m.item.content = image
Patrick@450
   937
patrick@73
   938
patrick@73
   939
# =============================================================================
patrick@73
   940
#                                 INLINE LEVEL
patrick@73
   941
# =============================================================================
patrick@73
   942
patrick@75
   943
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@75
   944
Patrick@293
   945
blanks.inlines = mixed {
Patrick@293
   946
   sup*
Patrick@293
   947
 & sub*
Patrick@293
   948
 & var*
Patrick@293
   949
 & number*
Patrick@293
   950
 & acronym*
Patrick@293
   951
 & warning*
Patrick@293
   952
Patrick@291
   953
 & highlight*
Patrick@291
   954
 & emphasis*
Patrick@291
   955
 & mentioned*
Patrick@350
   956
 & literal*
Patrick@350
   957
 & term*
Patrick@291
   958
 & stage*
Patrick@350
   959
 & name*
Patrick@350
   960
 & foreign*
Patrick@350
   961
 & date*
Patrick@350
   962
 & math*
Patrick@351
   963
 & quote*
Patrick@291
   964
 & initial*
Patrick@291
   965
 & note*
Patrick@291
   966
 & link*
Patrick@291
   967
 & anchor*
Patrick@291
   968
 & index*
Patrick@351
   969
 & image*
Patrick@351
   970
 & audio*
Patrick@351
   971
 & smil*
Coraline@436
   972
 & nowrap*
Patrick@293
   973
patrick@75
   974
 & blank*
Patrick@293
   975
}
Patrick@288
   976
Coraline@409
   977
blanks-m.inlines = mixed {
Coraline@409
   978
   sup*
Coraline@409
   979
 & sub*
Coraline@409
   980
 & var*
Coraline@409
   981
 & number*
Coraline@409
   982
 & acronym*
Coraline@409
   983
 & warning*
Coraline@409
   984
Coraline@409
   985
 & highlight*
Coraline@409
   986
 & emphasis*
Coraline@409
   987
 & mentioned*
Coraline@409
   988
 & literal*
Coraline@409
   989
 & term*
Coraline@409
   990
 & stage*
Coraline@409
   991
 & name*
Coraline@409
   992
 & foreign*
Coraline@409
   993
 & date*
Coraline@409
   994
 & math*
Coraline@409
   995
 & quote*
Coraline@409
   996
 & initial*
Coraline@409
   997
 & note*
Coraline@409
   998
 & link*
Coraline@409
   999
 & anchor*
Coraline@409
  1000
 & index*
Coraline@409
  1001
 & image*
Coraline@409
  1002
 & audio*
Coraline@409
  1003
 & smil*
Coraline@436
  1004
 & nowrap*
Coraline@409
  1005
Coraline@409
  1006
 & blank-m*
Coraline@409
  1007
}
Coraline@409
  1008
Coraline@441
  1009
blanks-c.inlines = mixed {
Coraline@441
  1010
   sup*
Coraline@441
  1011
 & sub*
Coraline@441
  1012
 & var*
Coraline@441
  1013
 & number*
Coraline@441
  1014
 & acronym*
Coraline@441
  1015
 & warning*
Coraline@441
  1016
Coraline@441
  1017
 & highlight*
Coraline@441
  1018
 & emphasis*
Coraline@441
  1019
 & mentioned*
Coraline@441
  1020
 & literal*
Coraline@441
  1021
 & term*
Coraline@441
  1022
 & stage*
Coraline@441
  1023
 & name*
Coraline@441
  1024
 & foreign*
Coraline@441
  1025
 & date*
Coraline@441
  1026
 & math*
Coraline@441
  1027
 & quote*
Coraline@441
  1028
 & initial*
Coraline@441
  1029
 & note*
Coraline@441
  1030
 & link*
Coraline@441
  1031
 & anchor*
Coraline@441
  1032
 & index*
Coraline@441
  1033
 & image*
Coraline@441
  1034
 & audio*
Coraline@441
  1035
 & smil*
Coraline@441
  1036
 & nowrap*
Coraline@441
  1037
Coraline@441
  1038
 & blank-c*
Coraline@441
  1039
}
Coraline@441
  1040
Coraline@442
  1041
correct.inlines = mixed {
Coraline@442
  1042
   sup*
Coraline@442
  1043
 & sub*
Coraline@442
  1044
 & var*
Coraline@442
  1045
 & number*
Coraline@442
  1046
 & acronym*
Coraline@442
  1047
 & warning*
Coraline@442
  1048
Coraline@442
  1049
 & highlight*
Coraline@442
  1050
 & emphasis*
Coraline@442
  1051
 & mentioned*
Coraline@442
  1052
 & literal*
Coraline@442
  1053
 & term*
Coraline@442
  1054
 & stage*
Coraline@442
  1055
 & name*
Coraline@442
  1056
 & foreign*
Coraline@442
  1057
 & date*
Coraline@442
  1058
 & math*
Coraline@442
  1059
 & quote*
Coraline@442
  1060
 & initial*
Coraline@442
  1061
 & note*
Coraline@442
  1062
 & link*
Coraline@442
  1063
 & anchor*
Coraline@442
  1064
 & index*
Coraline@442
  1065
 & image*
Coraline@442
  1066
 & audio*
Coraline@442
  1067
 & smil*
Coraline@442
  1068
 & nowrap*
Coraline@442
  1069
Coraline@442
  1070
 & char*
Coraline@442
  1071
}
Coraline@442
  1072
Patrick@336
  1073
pointing.inlines = mixed {
Patrick@293
  1074
   sup*
Patrick@293
  1075
 & sub*
Patrick@293
  1076
 & var*
Patrick@293
  1077
 & number*
Patrick@293
  1078
 & acronym*
Patrick@293
  1079
 & warning*
Patrick@293
  1080
Patrick@291
  1081
 & highlight*
Patrick@291
  1082
 & emphasis*
Patrick@291
  1083
 & mentioned*
Patrick@350
  1084
 & literal*
Patrick@350
  1085
 & term*
Patrick@291
  1086
 & stage*
Patrick@350
  1087
 & name*
Patrick@350
  1088
 & foreign*
Patrick@350
  1089
 & date*
Patrick@350
  1090
 & math*
Patrick@351
  1091
 & quote*
Patrick@291
  1092
 & initial*
Patrick@291
  1093
 & note*
Patrick@291
  1094
 & link*
Patrick@291
  1095
 & anchor*
Patrick@291
  1096
 & index*
Patrick@351
  1097
 & image*
Patrick@351
  1098
 & audio*
Patrick@351
  1099
 & smil*
Coraline@436
  1100
 & nowrap*
Patrick@293
  1101
Patrick@336
  1102
 & point*
Patrick@293
  1103
}
patrick@75
  1104
Coraline@441
  1105
# ~~~~~~~~~~~~~~~~~~~~~~~~~~ blank, blank-m, blank-c ~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
  1106
patrick@73
  1107
# ~~~~~~ blank
Patrick@216
  1108
blank = element blank { blank.attributes, blank.content }
Patrick@216
  1109
Patrick@216
  1110
blank.attributes =
claire@381
  1111
   area.attribute?
claire@381
  1112
 & long.attribute?
claire@381
  1113
area.attribute = attribute area { xsd:boolean }
patrick@73
  1114
patrick@73
  1115
blank.content =
patrick@73
  1116
   text
patrick@87
  1117
 | (s+, help?, answer?)
patrick@73
  1118
Coraline@409
  1119
# ~~~~~~ blank-m
Coraline@409
  1120
blank-m = element blank { blank-m.content }
Patrick@411
  1121
blank-m.content =
Patrick@411
  1122
   p
Patrick@411
  1123
 | math
Patrick@411
  1124
 | image
Patrick@411
  1125
 | audio
Patrick@411
  1126
 | (s-m+, help?, answer?)
Patrick@450
  1127
Coraline@441
  1128
# ~~~~~~ blank-c
Coraline@441
  1129
blank-c = element blank { blank-c.attributes, blank-c.content }
Patrick@450
  1130
Coraline@441
  1131
blank-c.attributes = form.attribute?
Coraline@441
  1132
form.attribute = attribute form { 'radio' | 'check' }
Patrick@450
  1133
Coraline@441
  1134
blank-c.content = (blank-c.right | blank-c.wrong)+, help?, answer?
Coraline@441
  1135
blank-c.right = element right { inlines }
Patrick@450
  1136
blank-c.wrong = element wrong { inlines }
Coraline@409
  1137
patrick@73
  1138
# ~~~~~~ s
patrick@73
  1139
s = element s { s.content }
Coraline@409
  1140
s.content = text
patrick@73
  1141
Coraline@409
  1142
# ~~~~~~ s-m
Coraline@409
  1143
s-m = element s { s-m.content }
Patrick@411
  1144
s-m.content =
Patrick@411
  1145
   p
Patrick@411
  1146
 | math
Patrick@411
  1147
 | image
Patrick@411
  1148
 | audio
Patrick@450
  1149
Coraline@442
  1150
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ char ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Coraline@442
  1151
Coraline@442
  1152
char = element char { char.attributes, char.content }
Coraline@442
  1153
Coraline@442
  1154
char.attributes = function.attribute?
Coraline@442
  1155
function.attribute = attribute function { "accent" | "uppercase" }
Coraline@442
  1156
Coraline@442
  1157
char.content = text
patrick@73
  1158
Patrick@336
  1159
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ point ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
  1160
Patrick@336
  1161
point = element point { point.attributes, point.content }
patrick@73
  1162
Patrick@336
  1163
point.attributes =
Patrick@336
  1164
   point.ref.attribute?
Coraline@409
  1165
Patrick@340
  1166
point.ref.attribute = attribute ref {
Patrick@340
  1167
   "right" | "cat1" | "cat2" | "cat3" | "cat4" | "cat5" }
Patrick@336
  1168
Patrick@356
  1169
point.content = inlines