RelaxNG/publiquiz.rnc
author iinov
mer., 05 sept. 2018 17:18:31 +0200
changeset 461 58b2704e601a
parent 450 fd645a45932e
child 462 61f23b379b5d
permissions -rw-r--r--
Ajout intrus en tri
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 =
iinov@461
   284
    comparison?,
iinov@461
   285
    sort.intruders?,
iinov@461
   286
    sort.item,
iinov@461
   287
    sort.item+
patrick@73
   288
patrick@125
   289
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ categories ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@125
   290
Patrick@310
   291
# ~~~~~~ category.head
Patrick@310
   292
category.head = element head { category.head.content }
Patrick@310
   293
Patrick@310
   294
category.head.content =
Patrick@384
   295
   title
Patrick@384
   296
 & shorttitle?
Patrick@384
   297
 & subtitle*
Patrick@310
   298
patrick@125
   299
# ~~~~~~ categories
Patrick@168
   300
categories = element categories { categories.attributes, categories.content }
patrick@125
   301
Patrick@168
   302
categories.attributes =
Patrick@376
   303
   success.attribute?
Patrick@376
   304
 & multiple.attribute?
claire@380
   305
 & noshuffle.attribute?
Coraline@409
   306
 & orientation.attribute?
Patrick@310
   307
patrick@125
   308
categories.content =
Patrick@344
   309
   categories.intruders?,
patrick@125
   310
   category,
patrick@125
   311
   category+
patrick@125
   312
patrick@125
   313
# ~~~~~~ category
patrick@125
   314
category = element category { category.content }
patrick@125
   315
patrick@125
   316
category.content =
patrick@125
   317
   category.head,
patrick@125
   318
   category.item*
patrick@125
   319
Coraline@438
   320
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ wordsearch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@448
   321
Coraline@438
   322
wordsearch = element wordsearch {wordsearch.attributes, wordsearch.content }
Coraline@438
   323
Coraline@438
   324
wordsearch.attributes =
Coraline@438
   325
   strict.attribute ?
Coraline@438
   326
 & wordlist.attribute ?
Coraline@438
   327
Coraline@438
   328
wordlist.attribute = attribute wordlist { "hidden" | "right" | "left" }
Coraline@438
   329
Coraline@438
   330
wordsearch.content =
Coraline@438
   331
   words
Coraline@438
   332
 & grid
Coraline@438
   333
Coraline@438
   334
# ~~~~~~ words
Coraline@438
   335
words = element words {words.content}
Coraline@438
   336
words.content = words.item+
Coraline@438
   337
Coraline@438
   338
# ~~~~~~ grid
Coraline@438
   339
grid = element grid {grid.content}
Coraline@438
   340
grid.content = line+
Coraline@438
   341
Coraline@438
   342
line = element line {line.content}
Coraline@438
   343
line.content = cell+
Coraline@438
   344
Coraline@438
   345
cell = element cell {cell.content}
Coraline@438
   346
cell.content = xsd:token {pattern = "."}
Patrick@450
   347
Patrick@448
   348
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ flashcard ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@448
   349
Patrick@448
   350
# ~~~~~~ flashcard
Patrick@448
   351
flashcard = element flashcard { flashcard.content }
Patrick@448
   352
Patrick@448
   353
flashcard.content =
Patrick@448
   354
   side1,
Patrick@448
   355
   side2
Patrick@448
   356
Patrick@448
   357
# ~~~~~~ side1
Patrick@448
   358
side1 = element side1 { side1.content }
Patrick@448
   359
Patrick@448
   360
side1.content =
Patrick@448
   361
    section+ | block+
Patrick@448
   362
Patrick@448
   363
# ~~~~~~ side2
Patrick@448
   364
side2 = element side2 { side2.content }
Patrick@448
   365
Patrick@448
   366
side2.content =
Patrick@448
   367
    instructions?,
Patrick@448
   368
    flashcard.engine,
Patrick@448
   369
    help?,
Patrick@448
   370
    answer?
Patrick@448
   371
Patrick@448
   372
# ~~~~~~ flashcard.engine
Patrick@448
   373
flashcard.engine =
Patrick@448
   374
    choices-radio
Patrick@448
   375
    | choices-check
Patrick@448
   376
    | blanks-fill
Patrick@448
   377
    | blanks-select
Patrick@448
   378
    | sort
Patrick@448
   379
Patrick@450
   380
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ coloring ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@450
   381
Patrick@450
   382
coloring = element coloring { coloring.attributes, coloring.content }
Patrick@450
   383
Patrick@450
   384
coloring.attributes =
Patrick@450
   385
    nomark.attribute?
Patrick@450
   386
nomark.attribute = attribute nomark { xsd:boolean }
Patrick@450
   387
Patrick@450
   388
coloring.content =
Patrick@450
   389
    palette
Patrick@450
   390
  & canvas
Patrick@450
   391
  & areas?
Patrick@450
   392
Patrick@450
   393
# ~~~~~~ palette
Patrick@450
   394
palette = element palette { palette.content }
Patrick@450
   395
Patrick@450
   396
palette.content =
Patrick@450
   397
    color+
Patrick@450
   398
Patrick@450
   399
# ~~~~~~ canvas
Patrick@450
   400
canvas = element canvas { canvas.attributes }
Patrick@450
   401
Patrick@450
   402
canvas.attributes =
Patrick@450
   403
    media.id.attribute
Patrick@450
   404
Patrick@450
   405
# ~~~~~~ areas
Patrick@450
   406
areas = element areas { areas.attributes }
Patrick@450
   407
Patrick@450
   408
areas.attributes =
Patrick@450
   409
    media.id.attribute
Patrick@450
   410
Patrick@450
   411
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ memory ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@450
   412
Patrick@450
   413
# ~~~~~~ memory
Patrick@450
   414
memory = element memory { memory.attributes, memory.content }
Patrick@450
   415
Patrick@450
   416
memory.attributes =
Patrick@450
   417
    display.attribute?
Patrick@450
   418
    & delay.attribute?
Patrick@450
   419
display.attribute = attribute display { xsd:positiveInteger }
Patrick@450
   420
delay.attribute = attribute delay { xsd:positiveInteger }
Patrick@450
   421
Patrick@450
   422
memory.content =
Patrick@450
   423
   memory.match,
Patrick@450
   424
   memory.match+
Patrick@450
   425
Patrick@450
   426
# ~~~~~~ memory.match
Patrick@450
   427
memory.match = element match { memory-m.content }
Patrick@450
   428
Patrick@450
   429
memory-m.content =
Patrick@450
   430
    memory-m.item,
Patrick@450
   431
    memory-m.item,
Patrick@450
   432
    audio?
Patrick@450
   433
patrick@87
   434
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ production ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@87
   435
Coraline@407
   436
production = element production { production.content }
Coraline@407
   437
Coraline@407
   438
production.content = text
patrick@87
   439
patrick@73
   440
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ composite ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   441
patrick@77
   442
# ~~~~~~ composite
Patrick@161
   443
composite = element composite { composite.attributes, composite.content }
Patrick@161
   444
Patrick@161
   445
composite.attributes =
Patrick@376
   446
   success.attribute?
Patrick@376
   447
 & multipage.attribute?
Patrick@310
   448
multipage.attribute = attribute multipage { xsd:boolean }
patrick@75
   449
patrick@73
   450
composite.content =
patrick@85
   451
   subquiz,
Patrick@154
   452
   subquiz+
patrick@77
   453
patrick@85
   454
# ~~~~~~ subquiz
patrick@85
   455
subquiz = element subquiz { subquiz.content }
patrick@77
   456
patrick@85
   457
subquiz.content =
patrick@77
   458
   instructions?,
Patrick@141
   459
   engine,
Patrick@141
   460
   help?,
Patrick@141
   461
   answer?
patrick@73
   462
patrick@73
   463
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ help ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   464
patrick@73
   465
help = element help { help.content }
patrick@73
   466
patrick@73
   467
help.content =
patrick@73
   468
   (section+ | block+)?,
patrick@73
   469
   link*
patrick@73
   470
patrick@87
   471
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ answer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   472
patrick@87
   473
answer = element answer { answer.content }
patrick@73
   474
patrick@87
   475
answer.content =
patrick@81
   476
   (section+ | block+)?,
patrick@80
   477
   link*
patrick@73
   478
patrick@73
   479
patrick@73
   480
# =============================================================================
patrick@73
   481
#                                 BLOCK LEVEL
patrick@73
   482
# =============================================================================
patrick@73
   483
patrick@73
   484
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   485
Patrick@313
   486
blanks.block = (
Patrick@313
   487
   blanks.p | blanks.list | blanks.blockquote | blanks.speech | blanks.table
Patrick@313
   488
 | blanks.media)
Coraline@409
   489
blanks-m.block = (
Coraline@409
   490
   blanks-m.p | blanks-m.list | blanks-m.blockquote | blanks-m.speech
Coraline@409
   491
 | blanks-m.table | blanks-m.media)
Coraline@441
   492
blanks-c.block = (
Coraline@441
   493
   blanks-c.p | blanks-c.list | blanks-c.blockquote | blanks-c.speech
Coraline@441
   494
 | blanks-c.table | blanks-c.media)
Coraline@442
   495
correct.block = (
Coraline@442
   496
   correct.p | correct.list | correct.blockquote | correct.speech
Coraline@442
   497
 | correct.table | media)
Patrick@336
   498
pointing.block = (
Patrick@336
   499
   pointing.p | pointing.list | pointing.blockquote | pointing.speech
Patrick@336
   500
 | pointing.table | media)
patrick@73
   501
patrick@73
   502
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   503
patrick@73
   504
blanks.p = element p { blanks.p.content }
Coraline@409
   505
blanks-m.p = element p { blanks-m.p.content }
Coraline@441
   506
blanks-c.p = element p { blanks-c.p.content }
Coraline@442
   507
correct.p = element p { correct.p.content }
Patrick@336
   508
pointing.p = element p { pointing.p.content }
patrick@73
   509
patrick@73
   510
blanks.p.content =
patrick@75
   511
   blanks.inlines
Coraline@409
   512
blanks-m.p.content =
Coraline@409
   513
   blanks-m.inlines
Coraline@441
   514
blanks-c.p.content =
Coraline@441
   515
   blanks-c.inlines
Coraline@442
   516
correct.p.content =
Coraline@442
   517
   correct.inlines
Patrick@336
   518
pointing.p.content =
Patrick@336
   519
   pointing.inlines
patrick@73
   520
patrick@73
   521
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   522
patrick@73
   523
# ~~~~~~ list
patrick@75
   524
blanks.list = element list {
patrick@73
   525
   block.head?,
patrick@73
   526
   (  (attribute type {"ordered"}?, blanks.item, blanks.item+)
Coraline@422
   527
    | (attribute type {"glossary"}, item.glossary+) )
patrick@75
   528
}
Coraline@409
   529
blanks-m.list = element list {
Coraline@409
   530
   block.head?,
Coraline@441
   531
   (  (attribute type {"ordered"}?, blanks-m.item, blanks-m.item+)
Coraline@441
   532
    | (attribute type {"glossary"}, item.glossary+) )
Coraline@441
   533
}
Coraline@441
   534
blanks-c.list = element list {
Coraline@441
   535
   block.head?,
Coraline@409
   536
   (  (attribute type {"ordered"}?, blanks.item, blanks.item+)
Coraline@422
   537
    | (attribute type {"glossary"}, item.glossary+) )
Coraline@409
   538
}
Coraline@442
   539
correct.list = element list {
Coraline@442
   540
   block.head?,
Coraline@442
   541
   (  (attribute type {"ordered"}?, correct.item, correct.item+)
Coraline@442
   542
    | (attribute type {"glossary"}, item.glossary+) )
Coraline@442
   543
}
Patrick@336
   544
pointing.list = element list {
patrick@73
   545
   block.head?,
Patrick@336
   546
   (  (attribute type {"ordered"}?, pointing.item, pointing.item+)
Coraline@422
   547
    | (attribute type {"glossary"}, item.glossary+) )
patrick@75
   548
}
patrick@73
   549
patrick@73
   550
# ~~~~~~ item
patrick@73
   551
blanks.item = element item { blanks.item.content }
Coraline@441
   552
blanks-m.item = element item { blanks-m.item.content }
Coraline@441
   553
blanks-c.item = element item { blanks-c.item.content }
Coraline@442
   554
correct.item = element item { correct.item.content }
Patrick@336
   555
pointing.item = element item { pointing.item.content }
Patrick@450
   556
patrick@73
   557
Coraline@442
   558
blanks.item.content = blanks.inlines | blanks.block+
Coraline@442
   559
blanks-m.item.content = blanks-m.inlines | blanks-m.block+
Coraline@442
   560
blanks-c.item.content = blanks-c.inlines | blanks-c.block+
Coraline@442
   561
correct.item.content = correct.inlines | correct.block+
Coraline@442
   562
pointing.item.content = pointing.inlines | pointing.block+
patrick@73
   563
Patrick@313
   564
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blockquote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@313
   565
Patrick@313
   566
blanks.blockquote = element blockquote {
Patrick@313
   567
   blockquote.attributes, blanks.blockquote.content }
Coraline@409
   568
blanks-m.blockquote = element blockquote {
Coraline@409
   569
   blockquote.attributes, blanks-m.blockquote.content }
Coraline@441
   570
blanks-c.blockquote = element blockquote {
Coraline@441
   571
   blockquote.attributes, blanks-c.blockquote.content }
Coraline@442
   572
correct.blockquote = element blockquote {
Coraline@442
   573
   blockquote.attributes, correct.blockquote.content }
Patrick@336
   574
pointing.blockquote = element blockquote {
Patrick@336
   575
   blockquote.attributes, pointing.blockquote.content }
Patrick@313
   576
Patrick@313
   577
blanks.blockquote.content =
Patrick@313
   578
   block.head?,
Patrick@313
   579
   (blanks.p | speech | blanks.list)+,
Patrick@313
   580
   attribution?
Coraline@409
   581
blanks-m.blockquote.content =
Coraline@409
   582
   block.head?,
Coraline@409
   583
   (blanks-m.p | speech | blanks-m.list)+,
Coraline@409
   584
   attribution?
Coraline@441
   585
blanks-c.blockquote.content =
Coraline@441
   586
   block.head?,
Coraline@441
   587
   (blanks-c.p | speech | blanks-c.list)+,
Coraline@441
   588
   attribution?
Coraline@442
   589
correct.blockquote.content =
Coraline@442
   590
   block.head?,
Coraline@442
   591
   (correct.p | speech | correct.list)+,
Coraline@442
   592
   attribution?
Patrick@336
   593
pointing.blockquote.content =
Patrick@313
   594
   block.head?,
Patrick@336
   595
   (pointing.p | speech | pointing.list)+,
Patrick@313
   596
   attribution?
Patrick@313
   597
Patrick@313
   598
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@313
   599
Patrick@313
   600
# ~~~~~~ speech
Patrick@313
   601
blanks.speech = element speech { blanks.speech.content }
Coraline@409
   602
blanks-m.speech = element speech { blanks-m.speech.content }
Coraline@441
   603
blanks-c.speech = element speech { blanks-c.speech.content }
Coraline@442
   604
correct.speech = element speech { correct.speech.content }
Patrick@336
   605
pointing.speech = element speech { pointing.speech.content }
Patrick@313
   606
Patrick@313
   607
blanks.speech.content =
Patrick@313
   608
   blanks.speaker?,
Patrick@313
   609
   stage?,
Patrick@313
   610
   (blanks.p | blanks.blockquote)+
Coraline@409
   611
blanks-m.speech.content =
Coraline@409
   612
   blanks-m.speaker?,
Coraline@409
   613
   stage?,
Coraline@409
   614
   (blanks-m.p | blanks-m.blockquote)+
Coraline@441
   615
blanks-c.speech.content =
Coraline@441
   616
   blanks-c.speaker?,
Coraline@441
   617
   stage?,
Coraline@441
   618
   (blanks-c.p | blanks-c.blockquote)+
Coraline@442
   619
correct.speech.content =
Coraline@442
   620
   correct.speaker?,
Coraline@442
   621
   stage?,
Coraline@442
   622
   (correct.p | correct.blockquote)+
Patrick@336
   623
pointing.speech.content =
Patrick@336
   624
   pointing.speaker?,
Patrick@313
   625
   stage?,
Patrick@336
   626
   (pointing.p | pointing.blockquote)+
Patrick@313
   627
Patrick@313
   628
# ~~~~~~ speaker
Patrick@313
   629
blanks.speaker = element speaker { blanks.speaker.content }
Coraline@409
   630
blanks-m.speaker = element speaker { blanks-m.speaker.content }
Coraline@441
   631
blanks-c.speaker = element speaker { blanks-c.speaker.content }
Coraline@442
   632
correct.speaker = element speaker { correct.speaker.content }
Patrick@336
   633
pointing.speaker = element speaker { pointing.speaker.content }
Patrick@313
   634
Patrick@313
   635
blanks.speaker.content = blanks.inlines
Coraline@409
   636
blanks-m.speaker.content = blanks-m.inlines
Coraline@441
   637
blanks-c.speaker.content = blanks-c.inlines
Coraline@442
   638
correct.speaker.content = correct.inlines
Patrick@336
   639
pointing.speaker.content = pointing.inlines
Patrick@313
   640
patrick@73
   641
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   642
Patrick@313
   643
# ~~~~~~ table
patrick@249
   644
blanks.table = element table { table.attributes, blanks.table.content }
Coraline@409
   645
blanks-m.table = element table { table.attributes, blanks-m.table.content }
Coraline@441
   646
blanks-c.table = element table { table.attributes, blanks-m.table.content }
Coraline@442
   647
correct.table = element table { table.attributes, correct.table.content }
Patrick@336
   648
pointing.table = element table { table.attributes, pointing.table.content }
patrick@73
   649
patrick@73
   650
blanks.table.content =
patrick@73
   651
   block.head?,
Patrick@358
   652
   ((thead?, blanks.tbody+) | blanks.tr+),
Patrick@313
   653
   blanks.table.caption?
Coraline@409
   654
blanks-m.table.content =
Coraline@409
   655
   block.head?,
Coraline@409
   656
   ((thead?, blanks-m.tbody+) | blanks-m.tr+),
Coraline@409
   657
   blanks-m.table.caption?
Coraline@441
   658
blanks-c.table.content =
Coraline@441
   659
   block.head?,
Coraline@441
   660
   ((thead?, blanks-c.tbody+) | blanks-c.tr+),
Coraline@441
   661
   blanks-c.table.caption?
Coraline@442
   662
correct.table.content =
Coraline@442
   663
   block.head?,
Coraline@442
   664
   ((thead?, correct.tbody+) | correct.tr+),
Coraline@442
   665
   correct.table.caption?
Patrick@336
   666
pointing.table.content =
patrick@73
   667
   block.head?,
Patrick@358
   668
   ((thead?, pointing.tbody+) | pointing.tr+),
Patrick@336
   669
   pointing.table.caption?
patrick@73
   670
patrick@73
   671
# ~~~~~~ tbody
patrick@249
   672
blanks.tbody = element tbody { blanks.tbody.content }
Coraline@409
   673
blanks-m.tbody = element tbody { blanks-m.tbody.content }
Coraline@441
   674
blanks-c.tbody = element tbody { blanks-m.tbody.content }
Coraline@442
   675
correct.tbody = element tbody { correct.tbody.content }
Patrick@336
   676
pointing.tbody = element tbody { pointing.tbody.content }
patrick@73
   677
patrick@73
   678
blanks.tbody.content =
patrick@249
   679
   blanks.tr+
Coraline@409
   680
blanks-m.tbody.content =
Coraline@409
   681
   blanks-m.tr+
Coraline@441
   682
blanks-c.tbody.content =
Coraline@441
   683
   blanks-c.tr+
Coraline@442
   684
correct.tbody.content =
Coraline@442
   685
   correct.tr+
Patrick@336
   686
pointing.tbody.content =
Patrick@336
   687
   pointing.tr+
patrick@73
   688
patrick@249
   689
# ~~~~~~ tr
patrick@249
   690
blanks.tr = element tr { tr.attributes, blanks.tr.content }
Coraline@409
   691
blanks-m.tr = element tr { tr.attributes, blanks-m.tr.content }
Coraline@441
   692
blanks-c.tr = element tr { tr.attributes, blanks-c.tr.content }
Coraline@442
   693
correct.tr = element tr { tr.attributes, correct.tr.content }
Patrick@336
   694
pointing.tr = element tr { tr.attributes, pointing.tr.content }
patrick@73
   695
patrick@249
   696
blanks.tr.content =
patrick@249
   697
  (blanks.td | blanks.th)+
Coraline@409
   698
blanks-m.tr.content =
Coraline@409
   699
  (blanks-m.td | blanks-m.th)+
Coraline@441
   700
blanks-c.tr.content =
Coraline@441
   701
  (blanks-c.td | blanks-c.th)+
Coraline@442
   702
correct.tr.content =
Coraline@442
   703
  (correct.td | correct.th)+
Patrick@336
   704
pointing.tr.content =
Patrick@336
   705
  (pointing.td | pointing.th)+
patrick@73
   706
patrick@249
   707
# ~~~~~~ td, th
patrick@249
   708
blanks.td = element td { td.attributes, blanks.td.content }
patrick@249
   709
blanks.th = element th { td.attributes, blanks.td.content }
Coraline@409
   710
blanks-m.td = element td { td.attributes, blanks-m.td.content }
Coraline@409
   711
blanks-m.th = element th { td.attributes, blanks-m.td.content }
Coraline@441
   712
blanks-c.td = element td { td.attributes, blanks-c.td.content }
Coraline@441
   713
blanks-c.th = element th { td.attributes, blanks-c.td.content }
Coraline@442
   714
correct.td = element td { td.attributes, correct.td.content }
Coraline@442
   715
correct.th = element th { td.attributes, correct.td.content }
Patrick@336
   716
pointing.td = element td { td.attributes, pointing.td.content }
Patrick@336
   717
pointing.th = element th { td.attributes, pointing.td.content }
patrick@73
   718
patrick@249
   719
blanks.td.content =
patrick@75
   720
   blanks.inlines
Patrick@313
   721
 | (blanks.p | blanks.media)+
Coraline@409
   722
blanks-m.td.content =
Coraline@409
   723
   blanks-m.inlines
Coraline@409
   724
 | (blanks-m.p | blanks-m.media)+
Coraline@441
   725
blanks-c.td.content =
Coraline@441
   726
   blanks-c.inlines
Coraline@441
   727
 | (blanks-c.p | blanks-c.media)+
Coraline@442
   728
correct.td.content =
Coraline@442
   729
   correct.inlines
Coraline@442
   730
 | (correct.p | media)+
Patrick@336
   731
pointing.td.content =
Patrick@336
   732
   pointing.inlines
Patrick@336
   733
 | (pointing.p | media)+
Patrick@313
   734
Patrick@313
   735
# ~~~~~~ table.caption
Patrick@313
   736
blanks.table.caption = element caption { blanks.caption.content }
Coraline@409
   737
blanks-m.table.caption = element caption { blanks-m.caption.content }
Coraline@441
   738
blanks-c.table.caption = element caption { blanks-c.caption.content }
Coraline@442
   739
correct.table.caption = element caption { correct.caption.content }
Patrick@336
   740
pointing.table.caption = element caption { pointing.caption.content }
Patrick@313
   741
Patrick@313
   742
blanks.caption.content =
Patrick@313
   743
   blanks.inlines
Patrick@313
   744
 | (blanks.p | speech | blanks.list | blockquote)+
Coraline@409
   745
blanks-m.caption.content =
Coraline@409
   746
   blanks-m.inlines
Coraline@409
   747
 | (blanks-m.p | speech | blanks-m.list | blockquote)+
Coraline@441
   748
blanks-c.caption.content =
Coraline@441
   749
   blanks-c.inlines
Coraline@441
   750
 | (blanks-c.p | speech | blanks-c.list | blockquote)+
Coraline@442
   751
correct.caption.content =
Coraline@442
   752
   correct.inlines
Coraline@442
   753
 | (correct.p | speech | correct.list | blockquote)+
Patrick@336
   754
pointing.caption.content =
Patrick@336
   755
   pointing.inlines
Patrick@336
   756
 | (pointing.p | speech | pointing.list | blockquote)+
patrick@73
   757
Patrick@174
   758
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@174
   759
Patrick@313
   760
# ~~~~~~ media
Patrick@313
   761
blanks.media = element media { media.attributes, blanks.media.content }
Coraline@409
   762
blanks-m.media = element media { media.attributes, blanks-m.media.content }
Coraline@441
   763
blanks-c.media = element media { media.attributes, blanks-c.media.content }
Coraline@442
   764
correct.media = element media { media.attributes, correct.media.content }
Patrick@336
   765
pointing.media = element media { media.attributes, pointing.media.content }
Patrick@174
   766
Patrick@313
   767
blanks.media.content =
Patrick@174
   768
   block.head?,
Patrick@174
   769
   (blanks.image | audio | video)+,
Patrick@313
   770
   blanks.media.caption?,
Patrick@313
   771
   link?
Coraline@409
   772
blanks-m.media.content =
Coraline@409
   773
   block.head?,
Coraline@409
   774
   (blanks-m.image | audio | video)+,
Coraline@409
   775
   blanks-m.media.caption?,
Coraline@409
   776
   link?
Coraline@441
   777
blanks-c.media.content =
Coraline@441
   778
   block.head?,
Coraline@441
   779
   (image | audio | video)+,
Coraline@441
   780
   blanks-c.media.caption?,
Coraline@441
   781
   link?
Coraline@442
   782
correct.media.content =
Coraline@442
   783
   block.head?,
Coraline@442
   784
   (image | audio | video)+,
Coraline@442
   785
   correct.media.caption?,
Coraline@442
   786
   link?
Patrick@336
   787
pointing.media.content =
Patrick@313
   788
   block.head?,
Patrick@313
   789
   (image | audio | video)+,
Patrick@336
   790
   pointing.media.caption?,
Patrick@174
   791
   link?
Patrick@174
   792
Patrick@174
   793
# ~~~~~~ blanks.image
Patrick@174
   794
blanks.image = element image { image.attributes, blanks.image.content }
Coraline@409
   795
blanks-m.image = element image { image.attributes, blanks-m.image.content }
Patrick@174
   796
Patrick@174
   797
blanks.image.content =
Patrick@174
   798
   copyright?,
Patrick@192
   799
   blanks.dropzone*
Coraline@409
   800
blanks-m.image.content =
Coraline@409
   801
   copyright?,
Coraline@409
   802
   blanks-m.dropzone*
Patrick@174
   803
Patrick@313
   804
# ~~~~~~ dropzone
Patrick@192
   805
blanks.dropzone = element dropzone {
Patrick@192
   806
   blanks.dropzone.attributes, blanks.dropzone.content }
Coraline@409
   807
blanks-m.dropzone = element dropzone {
Patrick@411
   808
   blanks-m.dropzone.attributes, blanks-m.dropzone.content }
Patrick@183
   809
Patrick@192
   810
blanks.dropzone.attributes =
Patrick@183
   811
   x.attribute
Patrick@310
   812
 & y.attribute
Patrick@411
   813
blanks-m.dropzone.attributes =
patrick@194
   814
   x.attribute
patrick@194
   815
 & y.attribute
Coraline@412
   816
 & h.attribute
patrick@194
   817
 & w.attribute
Patrick@174
   818
Patrick@192
   819
blanks.dropzone.content =
Patrick@183
   820
   blank
Coraline@409
   821
blanks-m.dropzone.content =
Coraline@409
   822
   blank-m
Patrick@174
   823
Patrick@313
   824
# ~~~~~~ media.caption
Patrick@313
   825
blanks.media.caption = element caption {
Patrick@313
   826
   caption.attributes, blanks.caption.content }
Coraline@409
   827
blanks-m.media.caption = element caption {
Coraline@409
   828
   caption.attributes, blanks-m.caption.content }
Coraline@441
   829
blanks-c.media.caption = element caption {
Coraline@441
   830
   caption.attributes, blanks-c.caption.content }
Coraline@442
   831
correct.media.caption = element caption {
Coraline@442
   832
   caption.attributes, correct.caption.content }
Patrick@336
   833
pointing.media.caption = element caption {
Patrick@336
   834
   caption.attributes, pointing.caption.content }
Patrick@313
   835
patrick@73
   836
# ~~~~~~~~~~~~~~~~~~~~~~~~ choices.right, choices.wrong ~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   837
patrick@73
   838
choices.right = element right { choices.right.content }
patrick@73
   839
choices.wrong = element wrong { choices.right.content }
patrick@73
   840
patrick@73
   841
choices.right.content =
patrick@73
   842
   inlines
Patrick@161
   843
 | ((p | image | (audio, image?) | video), help?, answer?)
patrick@73
   844
Coraline@409
   845
# ~~~~~~~~~~~~~~~~~~~~ blanks.intruders, blanks-m.intruders  ~~~~~~~~~~~~~~~~~~
patrick@73
   846
Patrick@342
   847
blanks.intruders = element intruders { blanks.intruders.content }
Coraline@409
   848
blanks-m.intruders = element intruders { blanks-m.intruders.content }
patrick@73
   849
Coraline@409
   850
blanks.intruders.content = blank+
Coraline@409
   851
blanks-m.intruders.content = blank-m+
patrick@73
   852
Coraline@442
   853
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ correct.intruders ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Coraline@442
   854
Coraline@442
   855
correct.intruders = element intruders { correct.intruders.content }
Coraline@442
   856
Coraline@442
   857
correct.intruders.content = char+
Coraline@442
   858
Patrick@359
   859
# ~~~~~~~~~~~~~~~~~~~~~~~ matching.intruders, match.item ~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   860
Patrick@359
   861
# ~~~~~~~ matching.intruders
Patrick@359
   862
matching.intruders = element intruders { matching.intruders.content }
Patrick@359
   863
Patrick@359
   864
matching.intruders.content =
Patrick@359
   865
   match.item+
Patrick@359
   866
Patrick@359
   867
# ~~~~~~~ match.item
Patrick@161
   868
match.item = element item { match.item.content }
patrick@73
   869
Patrick@161
   870
match.item.content =
Patrick@161
   871
   inlines
Patrick@341
   872
 | (p, help?, answer?)
patrick@73
   873
Patrick@313
   874
# ~~~~~~~~~~~~~~~~~~~~~~~~ comparison, sort.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   875
patrick@73
   876
# ~~~~~~ comparison
patrick@73
   877
comparison = element comparison { comparison.content }
patrick@73
   878
patrick@73
   879
comparison.content = inlines
patrick@73
   880
iinov@461
   881
# ~~~~~~~ sort.intruders
iinov@461
   882
sort.intruders = element intruders { sort.intruders.content }
iinov@461
   883
iinov@461
   884
sort.intruders.content =
iinov@461
   885
   sort.item+
iinov@461
   886
patrick@73
   887
# ~~~~~~ sort.item
patrick@73
   888
sort.item = element item { sort.item.attributes, sort.item.content }
patrick@73
   889
patrick@73
   890
sort.item.attributes =
patrick@73
   891
   item.shuffle.attribute?
patrick@73
   892
item.shuffle.attribute = attribute shuffle { xsd:integer }
patrick@73
   893
Patrick@161
   894
sort.item.content =
Patrick@161
   895
   inlines
Patrick@341
   896
 | (p, help?, answer?)
patrick@73
   897
Patrick@344
   898
# ~~~~~~~~~~~~~~~~~~~~~ categories.intruders, category.item ~~~~~~~~~~~~~~~~~~~
patrick@125
   899
Patrick@344
   900
# ~~~~~~ categories.intruders
Patrick@344
   901
categories.intruders = element intruders { categories.intruders.content }
Patrick@342
   902
Patrick@344
   903
categories.intruders.content =
Patrick@342
   904
   category.item+
Patrick@342
   905
Patrick@342
   906
# ~~~~~~ category.item
patrick@125
   907
category.item = element item { category.item.content }
patrick@125
   908
Patrick@161
   909
category.item.content =
Patrick@161
   910
   inlines
Patrick@341
   911
 | (p, help?, answer?)
patrick@125
   912
Coraline@438
   913
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ words.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Coraline@438
   914
words.item = element item {words.item.content, words.item.attributes }
Patrick@450
   915
Coraline@438
   916
words.item.content = inlines
Coraline@438
   917
Coraline@438
   918
words.item.attributes =
Coraline@438
   919
   startx
Coraline@438
   920
 & starty
Coraline@438
   921
 & endx
Coraline@438
   922
 & endy
Coraline@438
   923
Coraline@438
   924
startx = attribute startx {xsd:token {pattern = "[a-zA-Z]+"}}
Coraline@438
   925
starty = attribute starty {xsd:token {pattern = "\d+"}}
Coraline@438
   926
endx = attribute endx {xsd:token {pattern = "[a-zA-Z]+"}}
Coraline@438
   927
endy = attribute endy {xsd:token {pattern = "\d+"}}
Coraline@438
   928
Patrick@450
   929
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ color ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@450
   930
Patrick@450
   931
color = element color { color.attributes }
Patrick@450
   932
Patrick@450
   933
color.attributes =
Patrick@450
   934
    color.code
Patrick@450
   935
    & color.coderef?
Patrick@450
   936
color.code = attribute code {xsd:token { pattern = "#(\d|\w){6}"}}
Patrick@450
   937
color.coderef = attribute coderef { list{xsd:token { pattern = "#(\d|\w){6}"}+}}
Patrick@450
   938
Patrick@450
   939
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ memory-m.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@450
   940
Patrick@450
   941
memory-m.item = element item { memory-m.item.content }
Patrick@450
   942
Patrick@450
   943
memory-m.item.content = image
Patrick@450
   944
patrick@73
   945
patrick@73
   946
# =============================================================================
patrick@73
   947
#                                 INLINE LEVEL
patrick@73
   948
# =============================================================================
patrick@73
   949
patrick@75
   950
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@75
   951
Patrick@293
   952
blanks.inlines = mixed {
Patrick@293
   953
   sup*
Patrick@293
   954
 & sub*
Patrick@293
   955
 & var*
Patrick@293
   956
 & number*
Patrick@293
   957
 & acronym*
Patrick@293
   958
 & warning*
Patrick@293
   959
Patrick@291
   960
 & highlight*
Patrick@291
   961
 & emphasis*
Patrick@291
   962
 & mentioned*
Patrick@350
   963
 & literal*
Patrick@350
   964
 & term*
Patrick@291
   965
 & stage*
Patrick@350
   966
 & name*
Patrick@350
   967
 & foreign*
Patrick@350
   968
 & date*
Patrick@350
   969
 & math*
Patrick@351
   970
 & quote*
Patrick@291
   971
 & initial*
Patrick@291
   972
 & note*
Patrick@291
   973
 & link*
Patrick@291
   974
 & anchor*
Patrick@291
   975
 & index*
Patrick@351
   976
 & image*
Patrick@351
   977
 & audio*
Patrick@351
   978
 & smil*
Coraline@436
   979
 & nowrap*
Patrick@293
   980
patrick@75
   981
 & blank*
Patrick@293
   982
}
Patrick@288
   983
Coraline@409
   984
blanks-m.inlines = mixed {
Coraline@409
   985
   sup*
Coraline@409
   986
 & sub*
Coraline@409
   987
 & var*
Coraline@409
   988
 & number*
Coraline@409
   989
 & acronym*
Coraline@409
   990
 & warning*
Coraline@409
   991
Coraline@409
   992
 & highlight*
Coraline@409
   993
 & emphasis*
Coraline@409
   994
 & mentioned*
Coraline@409
   995
 & literal*
Coraline@409
   996
 & term*
Coraline@409
   997
 & stage*
Coraline@409
   998
 & name*
Coraline@409
   999
 & foreign*
Coraline@409
  1000
 & date*
Coraline@409
  1001
 & math*
Coraline@409
  1002
 & quote*
Coraline@409
  1003
 & initial*
Coraline@409
  1004
 & note*
Coraline@409
  1005
 & link*
Coraline@409
  1006
 & anchor*
Coraline@409
  1007
 & index*
Coraline@409
  1008
 & image*
Coraline@409
  1009
 & audio*
Coraline@409
  1010
 & smil*
Coraline@436
  1011
 & nowrap*
Coraline@409
  1012
Coraline@409
  1013
 & blank-m*
Coraline@409
  1014
}
Coraline@409
  1015
Coraline@441
  1016
blanks-c.inlines = mixed {
Coraline@441
  1017
   sup*
Coraline@441
  1018
 & sub*
Coraline@441
  1019
 & var*
Coraline@441
  1020
 & number*
Coraline@441
  1021
 & acronym*
Coraline@441
  1022
 & warning*
Coraline@441
  1023
Coraline@441
  1024
 & highlight*
Coraline@441
  1025
 & emphasis*
Coraline@441
  1026
 & mentioned*
Coraline@441
  1027
 & literal*
Coraline@441
  1028
 & term*
Coraline@441
  1029
 & stage*
Coraline@441
  1030
 & name*
Coraline@441
  1031
 & foreign*
Coraline@441
  1032
 & date*
Coraline@441
  1033
 & math*
Coraline@441
  1034
 & quote*
Coraline@441
  1035
 & initial*
Coraline@441
  1036
 & note*
Coraline@441
  1037
 & link*
Coraline@441
  1038
 & anchor*
Coraline@441
  1039
 & index*
Coraline@441
  1040
 & image*
Coraline@441
  1041
 & audio*
Coraline@441
  1042
 & smil*
Coraline@441
  1043
 & nowrap*
Coraline@441
  1044
Coraline@441
  1045
 & blank-c*
Coraline@441
  1046
}
Coraline@441
  1047
Coraline@442
  1048
correct.inlines = mixed {
Coraline@442
  1049
   sup*
Coraline@442
  1050
 & sub*
Coraline@442
  1051
 & var*
Coraline@442
  1052
 & number*
Coraline@442
  1053
 & acronym*
Coraline@442
  1054
 & warning*
Coraline@442
  1055
Coraline@442
  1056
 & highlight*
Coraline@442
  1057
 & emphasis*
Coraline@442
  1058
 & mentioned*
Coraline@442
  1059
 & literal*
Coraline@442
  1060
 & term*
Coraline@442
  1061
 & stage*
Coraline@442
  1062
 & name*
Coraline@442
  1063
 & foreign*
Coraline@442
  1064
 & date*
Coraline@442
  1065
 & math*
Coraline@442
  1066
 & quote*
Coraline@442
  1067
 & initial*
Coraline@442
  1068
 & note*
Coraline@442
  1069
 & link*
Coraline@442
  1070
 & anchor*
Coraline@442
  1071
 & index*
Coraline@442
  1072
 & image*
Coraline@442
  1073
 & audio*
Coraline@442
  1074
 & smil*
Coraline@442
  1075
 & nowrap*
Coraline@442
  1076
Coraline@442
  1077
 & char*
Coraline@442
  1078
}
Coraline@442
  1079
Patrick@336
  1080
pointing.inlines = mixed {
Patrick@293
  1081
   sup*
Patrick@293
  1082
 & sub*
Patrick@293
  1083
 & var*
Patrick@293
  1084
 & number*
Patrick@293
  1085
 & acronym*
Patrick@293
  1086
 & warning*
Patrick@293
  1087
Patrick@291
  1088
 & highlight*
Patrick@291
  1089
 & emphasis*
Patrick@291
  1090
 & mentioned*
Patrick@350
  1091
 & literal*
Patrick@350
  1092
 & term*
Patrick@291
  1093
 & stage*
Patrick@350
  1094
 & name*
Patrick@350
  1095
 & foreign*
Patrick@350
  1096
 & date*
Patrick@350
  1097
 & math*
Patrick@351
  1098
 & quote*
Patrick@291
  1099
 & initial*
Patrick@291
  1100
 & note*
Patrick@291
  1101
 & link*
Patrick@291
  1102
 & anchor*
Patrick@291
  1103
 & index*
Patrick@351
  1104
 & image*
Patrick@351
  1105
 & audio*
Patrick@351
  1106
 & smil*
Coraline@436
  1107
 & nowrap*
Patrick@293
  1108
Patrick@336
  1109
 & point*
Patrick@293
  1110
}
patrick@75
  1111
Coraline@441
  1112
# ~~~~~~~~~~~~~~~~~~~~~~~~~~ blank, blank-m, blank-c ~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
  1113
patrick@73
  1114
# ~~~~~~ blank
Patrick@216
  1115
blank = element blank { blank.attributes, blank.content }
Patrick@216
  1116
Patrick@216
  1117
blank.attributes =
claire@381
  1118
   area.attribute?
claire@381
  1119
 & long.attribute?
claire@381
  1120
area.attribute = attribute area { xsd:boolean }
patrick@73
  1121
patrick@73
  1122
blank.content =
patrick@73
  1123
   text
patrick@87
  1124
 | (s+, help?, answer?)
patrick@73
  1125
Coraline@409
  1126
# ~~~~~~ blank-m
Coraline@409
  1127
blank-m = element blank { blank-m.content }
Patrick@411
  1128
blank-m.content =
Patrick@411
  1129
   p
Patrick@411
  1130
 | math
Patrick@411
  1131
 | image
Patrick@411
  1132
 | audio
Patrick@411
  1133
 | (s-m+, help?, answer?)
Patrick@450
  1134
Coraline@441
  1135
# ~~~~~~ blank-c
Coraline@441
  1136
blank-c = element blank { blank-c.attributes, blank-c.content }
Patrick@450
  1137
Coraline@441
  1138
blank-c.attributes = form.attribute?
Coraline@441
  1139
form.attribute = attribute form { 'radio' | 'check' }
Patrick@450
  1140
Coraline@441
  1141
blank-c.content = (blank-c.right | blank-c.wrong)+, help?, answer?
Coraline@441
  1142
blank-c.right = element right { inlines }
Patrick@450
  1143
blank-c.wrong = element wrong { inlines }
Coraline@409
  1144
patrick@73
  1145
# ~~~~~~ s
patrick@73
  1146
s = element s { s.content }
Coraline@409
  1147
s.content = text
patrick@73
  1148
Coraline@409
  1149
# ~~~~~~ s-m
Coraline@409
  1150
s-m = element s { s-m.content }
Patrick@411
  1151
s-m.content =
Patrick@411
  1152
   p
Patrick@411
  1153
 | math
Patrick@411
  1154
 | image
Patrick@411
  1155
 | audio
Patrick@450
  1156
Coraline@442
  1157
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ char ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Coraline@442
  1158
Coraline@442
  1159
char = element char { char.attributes, char.content }
Coraline@442
  1160
Coraline@442
  1161
char.attributes = function.attribute?
Coraline@442
  1162
function.attribute = attribute function { "accent" | "uppercase" }
Coraline@442
  1163
Coraline@442
  1164
char.content = text
patrick@73
  1165
Patrick@336
  1166
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ point ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
  1167
Patrick@336
  1168
point = element point { point.attributes, point.content }
patrick@73
  1169
Patrick@336
  1170
point.attributes =
Patrick@336
  1171
   point.ref.attribute?
Coraline@409
  1172
Patrick@340
  1173
point.ref.attribute = attribute ref {
Patrick@340
  1174
   "right" | "cat1" | "cat2" | "cat3" | "cat4" | "cat5" }
Patrick@336
  1175
Patrick@356
  1176
point.content = inlines