RelaxNG/publiquiz.rnc
author Patrick PIERRE
jeu., 19 juin 2014 11:44:25 +0200
changeset 315 1f1e5638ed6d
parent 313 e4f154ea2837
child 336 15beef04b08c
permissions -rw-r--r--
Changement d'adresse
patrick@73
     1
# $Id$
patrick@73
     2
patrick@73
     3
patrick@73
     4
include "publidoc.rnc" {
patrick@73
     5
   start = publiquiz
patrick@73
     6
patrick@73
     7
   document.content =
patrick@73
     8
      top.head?,
patrick@73
     9
      (division | topic | quiz)+
patrick@84
    10
patrick@84
    11
   division.content =
patrick@84
    12
      division.head?,
patrick@84
    13
      (division | topic | quiz)+
patrick@73
    14
}
patrick@73
    15
patrick@75
    16
patrick@73
    17
publiquiz = element publiquiz {
patrick@73
    18
   publiquiz.attributes,
patrick@73
    19
   publiquiz.content
patrick@73
    20
}
patrick@73
    21
patrick@73
    22
publiquiz.attributes =
patrick@73
    23
   version.attribute
patrick@73
    24
patrick@73
    25
publiquiz.content =
patrick@73
    26
   document
patrick@73
    27
 | top.quiz
patrick@73
    28
patrick@73
    29
patrick@73
    30
# =============================================================================
patrick@73
    31
#                                  TOP LEVEL
patrick@73
    32
# =============================================================================
patrick@73
    33
Patrick@310
    34
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ top.quiz ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
    35
patrick@128
    36
top.quiz = element quiz { top.quiz.attributes, top.quiz.content }
patrick@73
    37
patrick@73
    38
top.quiz.attributes =
patrick@73
    39
   quiz.id.attribute
Patrick@158
    40
 & quiz.type.attribute?
patrick@73
    41
 & lang.attribute?
patrick@117
    42
quiz.id.attribute = attribute id { xsd:NMTOKEN }
Patrick@158
    43
quiz.type.attribute = attribute type { xsd:NCName }
patrick@73
    44
patrick@128
    45
top.quiz.content =
patrick@128
    46
   top.head?,
patrick@128
    47
   instructions,
patrick@128
    48
   (engine | composite),
patrick@128
    49
   help?,
patrick@128
    50
   answer?
patrick@73
    51
Patrick@310
    52
patrick@73
    53
# =============================================================================
Patrick@310
    54
#                                COMPONENT LEVEL
patrick@73
    55
# =============================================================================
patrick@73
    56
patrick@73
    57
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ quiz ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
    58
patrick@73
    59
quiz = element quiz { quiz.attributes, quiz.content }
patrick@73
    60
patrick@73
    61
quiz.attributes =
Patrick@310
    62
   (quiz.id.attribute | xmlid.attribute)?
Patrick@158
    63
 & quiz.type.attribute?
patrick@73
    64
 & lang.attribute?
patrick@73
    65
patrick@73
    66
quiz.content =
patrick@73
    67
   component.head?,
patrick@73
    68
   instructions,
patrick@87
    69
   (engine | composite),
patrick@73
    70
   help?,
patrick@87
    71
   answer?
patrick@73
    72
patrick@73
    73
patrick@73
    74
# =============================================================================
patrick@73
    75
#                                 SECTION LEVEL
patrick@73
    76
# =============================================================================
patrick@73
    77
patrick@73
    78
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
    79
patrick@73
    80
blanks.section = element section { section.attributes, blanks.section.content }
patrick@73
    81
point.section = element section { section.attributes, point.section.content }
patrick@73
    82
patrick@73
    83
blanks.section.content =
patrick@73
    84
   section.head?,
patrick@73
    85
   (blanks.section+ | blanks.block+)
patrick@73
    86
point.section.content =
patrick@73
    87
   section.head?,
patrick@73
    88
   (point.section+ | point.block+)
patrick@73
    89
patrick@73
    90
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ instructions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
    91
patrick@73
    92
instructions = element instructions { section.content }
patrick@73
    93
patrick@73
    94
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ engine ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
    95
patrick@73
    96
engine =
patrick@87
    97
   choices-radio
patrick@87
    98
 | choices-check
patrick@87
    99
 | blanks-fill
patrick@87
   100
 | blanks-select
Patrick@216
   101
 | blanks-char
patrick@73
   102
 | point
patrick@73
   103
 | matching
patrick@73
   104
 | sort
patrick@125
   105
 | categories
patrick@194
   106
 | pip
patrick@87
   107
 | production
patrick@73
   108
patrick@73
   109
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ choices ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   110
patrick@87
   111
choices-radio = element choices-radio {
patrick@87
   112
   choices.attributes, choices-radio.content }
patrick@87
   113
choices-check = element choices-check {
patrick@87
   114
   choices.attributes, choices-check.content }
patrick@73
   115
patrick@73
   116
choices.attributes =
patrick@73
   117
   shuffle.attribute?
patrick@73
   118
shuffle.attribute = attribute shuffle { xsd:boolean }
patrick@73
   119
patrick@87
   120
choices-radio.content =
patrick@73
   121
   choices.right
patrick@73
   122
 & choices.wrong+
patrick@87
   123
choices-check.content =
patrick@73
   124
   (choices.right | choices.wrong)+
patrick@73
   125
patrick@73
   126
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blanks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   127
patrick@87
   128
blanks-fill = element blanks-fill {
patrick@87
   129
   blanks-fill.attributes, blanks-fill.content }
patrick@87
   130
blanks-select = element blanks-select {
patrick@87
   131
   blanks-select.attributes, blanks-select.content }
Patrick@216
   132
blanks-char = element blanks-char { blanks-select.content }
patrick@73
   133
patrick@87
   134
blanks-fill.attributes =
patrick@75
   135
   strict.attribute?
patrick@87
   136
blanks-select.attributes =
patrick@73
   137
   multiple.attribute?
patrick@73
   138
strict.attribute = attribute strict { xsd:boolean }
patrick@73
   139
multiple.attribute = attribute multiple { xsd:boolean }
patrick@73
   140
patrick@87
   141
blanks-fill.content =
patrick@73
   142
   (blanks.block+ | blanks.section+)
patrick@87
   143
blanks-select.content =
patrick@73
   144
   blanks.wrongs?,
patrick@73
   145
   (blanks.block+ | blanks.section+)
patrick@73
   146
patrick@73
   147
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ point ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   148
patrick@73
   149
point = element point { point.attributes, point.content }
patrick@75
   150
patrick@73
   151
point.attributes =
patrick@73
   152
   point.type.attribute?
patrick@73
   153
point.type.attribute = attribute type {
patrick@73
   154
   "radio" | "radio_button" | "check" | "check_button" }
patrick@73
   155
patrick@73
   156
point.content =
patrick@73
   157
   (point.section+ | point.block+)
patrick@73
   158
patrick@73
   159
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ matching ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   160
Patrick@161
   161
# ~~~~~~ matching
Patrick@169
   162
matching = element matching { matching.attributes, matching.content }
Patrick@169
   163
Patrick@169
   164
matching.attributes =
Patrick@169
   165
   multiple.attribute?
patrick@75
   166
patrick@73
   167
matching.content =
patrick@73
   168
   match,
patrick@73
   169
   match+
patrick@73
   170
Patrick@161
   171
# ~~~~~~ match
Patrick@161
   172
match = element match { match.content }
Patrick@161
   173
Patrick@161
   174
match.content =
Patrick@161
   175
   match.item,
Patrick@161
   176
   match.item
Patrick@161
   177
patrick@73
   178
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sort ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   179
patrick@73
   180
sort = element sort { sort.attributes, sort.content }
patrick@73
   181
patrick@73
   182
sort.attributes =
patrick@73
   183
   shuffle.attribute?
patrick@75
   184
patrick@73
   185
sort.content =
patrick@73
   186
   comparison?,
patrick@73
   187
   sort.item,
patrick@73
   188
   sort.item+
patrick@73
   189
patrick@125
   190
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ categories ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@125
   191
Patrick@310
   192
# ~~~~~~ category.head
Patrick@310
   193
category.head = element head { category.head.content }
Patrick@310
   194
Patrick@310
   195
category.head.content =
Patrick@310
   196
   title,
Patrick@310
   197
   shorttitle?,
Patrick@310
   198
   subtitle*
Patrick@310
   199
patrick@125
   200
# ~~~~~~ categories
Patrick@168
   201
categories = element categories { categories.attributes, categories.content }
patrick@125
   202
Patrick@168
   203
categories.attributes =
Patrick@168
   204
   multiple.attribute?
Patrick@310
   205
patrick@125
   206
categories.content =
Patrick@174
   207
   category.item*,
patrick@125
   208
   category,
patrick@125
   209
   category+
patrick@125
   210
patrick@125
   211
# ~~~~~~ category
patrick@125
   212
category = element category { category.content }
patrick@125
   213
patrick@125
   214
category.content =
patrick@125
   215
   category.head,
patrick@125
   216
   category.item*
patrick@125
   217
patrick@194
   218
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pip ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@194
   219
patrick@194
   220
pip = element pip { pip.attributes, pip.content }
patrick@194
   221
patrick@194
   222
pip.attributes =
patrick@194
   223
   multiple.attribute?
patrick@194
   224
patrick@194
   225
pip.content =
patrick@194
   226
   pip.image
patrick@194
   227
patrick@87
   228
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ production ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@87
   229
patrick@87
   230
production = element production { empty }
patrick@87
   231
patrick@73
   232
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ composite ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   233
patrick@77
   234
# ~~~~~~ composite
Patrick@161
   235
composite = element composite { composite.attributes, composite.content }
Patrick@161
   236
Patrick@161
   237
composite.attributes =
Patrick@161
   238
   multipage.attribute?
Patrick@310
   239
multipage.attribute = attribute multipage { xsd:boolean }
patrick@75
   240
patrick@73
   241
composite.content =
patrick@85
   242
   subquiz,
Patrick@154
   243
   subquiz+
patrick@77
   244
patrick@85
   245
# ~~~~~~ subquiz
patrick@85
   246
subquiz = element subquiz { subquiz.content }
patrick@77
   247
patrick@85
   248
subquiz.content =
patrick@77
   249
   instructions?,
Patrick@141
   250
   engine,
Patrick@141
   251
   help?,
Patrick@141
   252
   answer?
patrick@73
   253
patrick@73
   254
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ help ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   255
patrick@73
   256
help = element help { help.content }
patrick@73
   257
patrick@73
   258
help.content =
patrick@73
   259
   (section+ | block+)?,
patrick@73
   260
   link*
patrick@73
   261
patrick@87
   262
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ answer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   263
patrick@87
   264
answer = element answer { answer.content }
patrick@73
   265
patrick@87
   266
answer.content =
patrick@81
   267
   (section+ | block+)?,
patrick@80
   268
   link*
patrick@73
   269
patrick@73
   270
patrick@73
   271
# =============================================================================
patrick@73
   272
#                                 BLOCK LEVEL
patrick@73
   273
# =============================================================================
patrick@73
   274
patrick@73
   275
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   276
Patrick@313
   277
blanks.block = (
Patrick@313
   278
   blanks.p | blanks.list | blanks.blockquote | blanks.speech | blanks.table
Patrick@313
   279
 | blanks.media)
Patrick@313
   280
point.block = (
Patrick@313
   281
   point.p | point.list | point.blockquote | point.speech | point.table | media)
patrick@73
   282
patrick@73
   283
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   284
patrick@73
   285
blanks.p = element p { blanks.p.content }
patrick@73
   286
point.p = element p { point.p.content }
patrick@73
   287
patrick@73
   288
blanks.p.content =
patrick@75
   289
   blanks.inlines
patrick@73
   290
point.p.content =
patrick@75
   291
   point.inlines
patrick@73
   292
patrick@73
   293
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   294
patrick@73
   295
# ~~~~~~ list
patrick@75
   296
blanks.list = element list {
patrick@73
   297
   block.head?,
patrick@73
   298
   (  (attribute type {"ordered"}?, blanks.item, blanks.item+)
patrick@73
   299
    | (attribute type {"glossary"}, glossary.item+) )
patrick@75
   300
}
patrick@75
   301
point.list = element list {
patrick@73
   302
   block.head?,
patrick@73
   303
   (  (attribute type {"ordered"}?, point.item, point.item+)
patrick@73
   304
    | (attribute type {"glossary"}, glossary.item+) )
patrick@75
   305
}
patrick@73
   306
patrick@73
   307
# ~~~~~~ item
patrick@73
   308
blanks.item = element item { blanks.item.content }
patrick@73
   309
point.item = element item { point.item.content }
patrick@73
   310
patrick@73
   311
blanks.item.content =
patrick@75
   312
   blanks.inlines
patrick@73
   313
 | blanks.block+
patrick@73
   314
point.item.content =
patrick@75
   315
   point.inlines
patrick@73
   316
 | point.block+
patrick@73
   317
Patrick@313
   318
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blockquote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@313
   319
Patrick@313
   320
blanks.blockquote = element blockquote {
Patrick@313
   321
   blockquote.attributes, blanks.blockquote.content }
Patrick@313
   322
point.blockquote = element blockquote {
Patrick@313
   323
   blockquote.attributes, point.blockquote.content }
Patrick@313
   324
Patrick@313
   325
blanks.blockquote.content =
Patrick@313
   326
   block.head?,
Patrick@313
   327
   (blanks.p | speech | blanks.list)+,
Patrick@313
   328
   attribution?
Patrick@313
   329
point.blockquote.content =
Patrick@313
   330
   block.head?,
Patrick@313
   331
   (point.p | speech | point.list)+,
Patrick@313
   332
   attribution?
Patrick@313
   333
Patrick@313
   334
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@313
   335
Patrick@313
   336
# ~~~~~~ speech
Patrick@313
   337
blanks.speech = element speech { blanks.speech.content }
Patrick@313
   338
point.speech = element speech { point.speech.content }
Patrick@313
   339
Patrick@313
   340
blanks.speech.content =
Patrick@313
   341
   blanks.speaker?,
Patrick@313
   342
   stage?,
Patrick@313
   343
   (blanks.p | blanks.blockquote)+
Patrick@313
   344
point.speech.content =
Patrick@313
   345
   point.speaker?,
Patrick@313
   346
   stage?,
Patrick@313
   347
   (point.p | point.blockquote)+
Patrick@313
   348
Patrick@313
   349
# ~~~~~~ speaker
Patrick@313
   350
blanks.speaker = element speaker { blanks.speaker.content }
Patrick@313
   351
point.speaker = element speaker { point.speaker.content }
Patrick@313
   352
Patrick@313
   353
blanks.speaker.content = blanks.inlines
Patrick@313
   354
point.speaker.content = point.inlines
Patrick@313
   355
patrick@73
   356
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   357
Patrick@313
   358
# ~~~~~~ table
patrick@249
   359
blanks.table = element table { table.attributes, blanks.table.content }
patrick@249
   360
point.table = element table { table.attributes, point.table.content }
patrick@73
   361
patrick@73
   362
blanks.table.content =
patrick@73
   363
   block.head?,
patrick@249
   364
   thead?,
patrick@249
   365
   (blanks.tbody+ | blanks.tr+),
Patrick@313
   366
   blanks.table.caption?
patrick@73
   367
point.table.content =
patrick@73
   368
   block.head?,
patrick@249
   369
   (point.tbody+ | point.tr+),
Patrick@313
   370
   point.table.caption?
patrick@73
   371
patrick@73
   372
# ~~~~~~ tbody
patrick@249
   373
blanks.tbody = element tbody { blanks.tbody.content }
patrick@249
   374
point.tbody = element tbody { point.tbody.content }
patrick@73
   375
patrick@73
   376
blanks.tbody.content =
patrick@249
   377
   blanks.tr+
patrick@73
   378
point.tbody.content =
patrick@249
   379
   point.tr+
patrick@73
   380
patrick@249
   381
# ~~~~~~ tr
patrick@249
   382
blanks.tr = element tr { tr.attributes, blanks.tr.content }
patrick@249
   383
point.tr = element tr { tr.attributes, point.tr.content }
patrick@73
   384
patrick@249
   385
blanks.tr.content =
patrick@249
   386
  (blanks.td | blanks.th)+
patrick@249
   387
point.tr.content =
patrick@249
   388
  (point.td | point.th)+
patrick@73
   389
patrick@249
   390
# ~~~~~~ td, th
patrick@249
   391
blanks.td = element td { td.attributes, blanks.td.content }
patrick@249
   392
blanks.th = element th { td.attributes, blanks.td.content }
patrick@249
   393
point.td = element td { td.attributes, point.td.content }
patrick@249
   394
point.th = element th { td.attributes, point.td.content }
patrick@73
   395
patrick@249
   396
blanks.td.content =
patrick@75
   397
   blanks.inlines
Patrick@313
   398
 | (blanks.p | blanks.media)+
patrick@73
   399
patrick@249
   400
point.td.content =
patrick@75
   401
   point.inlines
Patrick@313
   402
 | (point.p | media)+
Patrick@313
   403
Patrick@313
   404
# ~~~~~~ table.caption
Patrick@313
   405
blanks.table.caption = element caption { blanks.caption.content }
Patrick@313
   406
point.table.caption = element caption { point.caption.content }
Patrick@313
   407
Patrick@313
   408
blanks.caption.content =
Patrick@313
   409
   blanks.inlines
Patrick@313
   410
 | (blanks.p | speech | blanks.list | blockquote)+
Patrick@313
   411
point.caption.content =
Patrick@313
   412
   point.inlines
Patrick@313
   413
 | (point.p | speech | point.list | blockquote)+
patrick@73
   414
Patrick@174
   415
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@174
   416
Patrick@313
   417
# ~~~~~~ media
Patrick@313
   418
blanks.media = element media { media.attributes, blanks.media.content }
Patrick@313
   419
point.media = element media { media.attributes, point.media.content }
Patrick@174
   420
Patrick@313
   421
blanks.media.content =
Patrick@174
   422
   block.head?,
Patrick@174
   423
   (blanks.image | audio | video)+,
Patrick@313
   424
   blanks.media.caption?,
Patrick@313
   425
   link?
Patrick@313
   426
point.media.content =
Patrick@313
   427
   block.head?,
Patrick@313
   428
   (image | audio | video)+,
Patrick@313
   429
   point.media.caption?,
Patrick@174
   430
   link?
Patrick@174
   431
Patrick@174
   432
# ~~~~~~ blanks.image
Patrick@174
   433
blanks.image = element image { image.attributes, blanks.image.content }
patrick@194
   434
pip.image = element image { image.attributes, pip.image.content }
Patrick@174
   435
Patrick@174
   436
blanks.image.content =
Patrick@174
   437
   copyright?,
Patrick@192
   438
   blanks.dropzone*
patrick@194
   439
pip.image.content =
patrick@194
   440
   pip.dropzone+
Patrick@174
   441
Patrick@313
   442
# ~~~~~~ dropzone
Patrick@192
   443
blanks.dropzone = element dropzone {
Patrick@192
   444
   blanks.dropzone.attributes, blanks.dropzone.content }
patrick@194
   445
pip.dropzone = element dropzone {
patrick@194
   446
   pip.dropzone.attributes, pip.dropzone.content }
Patrick@183
   447
Patrick@192
   448
blanks.dropzone.attributes =
Patrick@183
   449
   x.attribute
Patrick@310
   450
 & y.attribute
patrick@194
   451
pip.dropzone.attributes =
patrick@194
   452
   x.attribute
patrick@194
   453
 & y.attribute
patrick@194
   454
 & w.attribute
patrick@194
   455
 & h.attribute
Patrick@174
   456
Patrick@192
   457
blanks.dropzone.content =
Patrick@183
   458
   blank
patrick@194
   459
pip.dropzone.content =
patrick@194
   460
   image?
Patrick@174
   461
Patrick@313
   462
# ~~~~~~ media.caption
Patrick@313
   463
blanks.media.caption = element caption {
Patrick@313
   464
   caption.attributes, blanks.caption.content }
Patrick@313
   465
point.media.caption = element caption {
Patrick@313
   466
   caption.attributes, point.caption.content }
Patrick@313
   467
patrick@73
   468
# ~~~~~~~~~~~~~~~~~~~~~~~~ choices.right, choices.wrong ~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   469
patrick@73
   470
choices.right = element right { choices.right.content }
patrick@73
   471
choices.wrong = element wrong { choices.right.content }
patrick@73
   472
patrick@73
   473
choices.right.content =
patrick@73
   474
   inlines
Patrick@161
   475
 | ((p | image | (audio, image?) | video), help?, answer?)
patrick@73
   476
patrick@73
   477
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blanks.wrongs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   478
patrick@73
   479
# ~~~~~~ blanks.wrongs
patrick@73
   480
blanks.wrongs = element wrongs { blanks.wrongs.content }
patrick@73
   481
patrick@73
   482
blanks.wrongs.content =
patrick@73
   483
   blanks.wrong+
patrick@73
   484
patrick@73
   485
# ~~~~~~ blanks.wrong
patrick@73
   486
blanks.wrong = element wrong { blanks.wrong.content }
patrick@73
   487
patrick@73
   488
blanks.wrong.content = text
patrick@73
   489
Patrick@313
   490
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ match.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   491
Patrick@161
   492
match.item = element item { match.item.content }
patrick@73
   493
Patrick@161
   494
match.item.content =
Patrick@161
   495
   inlines
patrick@166
   496
 | ((p | image | (audio, image?) | video), help?, answer?)
patrick@73
   497
Patrick@313
   498
# ~~~~~~~~~~~~~~~~~~~~~~~~ comparison, sort.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   499
patrick@73
   500
# ~~~~~~ comparison
patrick@73
   501
comparison = element comparison { comparison.content }
patrick@73
   502
patrick@73
   503
comparison.content = inlines
patrick@73
   504
patrick@73
   505
# ~~~~~~ sort.item
patrick@73
   506
sort.item = element item { sort.item.attributes, sort.item.content }
patrick@73
   507
patrick@73
   508
sort.item.attributes =
patrick@73
   509
   item.shuffle.attribute?
patrick@73
   510
item.shuffle.attribute = attribute shuffle { xsd:integer }
patrick@73
   511
Patrick@161
   512
sort.item.content =
Patrick@161
   513
   inlines
patrick@166
   514
 | ((p | image | (audio, image?) | video), help?, answer?)
patrick@73
   515
Patrick@313
   516
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ category.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@125
   517
patrick@125
   518
category.item = element item { category.item.content }
patrick@125
   519
Patrick@161
   520
category.item.content =
Patrick@161
   521
   inlines
patrick@166
   522
 | ((p | image | (audio, image?) | video), help?, answer?)
patrick@125
   523
patrick@73
   524
patrick@73
   525
# =============================================================================
patrick@73
   526
#                                 INLINE LEVEL
patrick@73
   527
# =============================================================================
patrick@73
   528
patrick@75
   529
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@75
   530
Patrick@293
   531
blanks.inlines = mixed {
Patrick@293
   532
   sup*
Patrick@293
   533
 & sub*
Patrick@293
   534
 & var*
Patrick@293
   535
 & number*
Patrick@293
   536
 & math*
Patrick@293
   537
 & date*
Patrick@293
   538
 & name*
Patrick@293
   539
 & acronym*
Patrick@293
   540
 & term*
Patrick@293
   541
 & warning*
Patrick@293
   542
Patrick@291
   543
 & literal*
Patrick@291
   544
 & foreign*
Patrick@291
   545
 & highlight*
Patrick@291
   546
 & emphasis*
Patrick@291
   547
 & mentioned*
Patrick@291
   548
 & stage*
Patrick@291
   549
 & initial*
Patrick@291
   550
 & quote*
Patrick@291
   551
 & image*
Patrick@291
   552
 & audio*
Patrick@291
   553
 & smil*
Patrick@291
   554
 & note*
Patrick@291
   555
 & link*
Patrick@291
   556
 & anchor*
Patrick@291
   557
 & index*
Patrick@293
   558
patrick@75
   559
 & blank*
Patrick@293
   560
}
Patrick@288
   561
Patrick@293
   562
point.inlines = mixed {
Patrick@293
   563
   sup*
Patrick@293
   564
 & sub*
Patrick@293
   565
 & var*
Patrick@293
   566
 & number*
Patrick@293
   567
 & math*
Patrick@293
   568
 & date*
Patrick@293
   569
 & name*
Patrick@293
   570
 & acronym*
Patrick@293
   571
 & term*
Patrick@293
   572
 & warning*
Patrick@293
   573
Patrick@291
   574
 & literal*
Patrick@291
   575
 & foreign*
Patrick@291
   576
 & highlight*
Patrick@291
   577
 & emphasis*
Patrick@291
   578
 & mentioned*
Patrick@291
   579
 & stage*
Patrick@291
   580
 & initial*
Patrick@291
   581
 & quote*
Patrick@291
   582
 & image*
Patrick@291
   583
 & audio*
Patrick@291
   584
 & smil*
Patrick@291
   585
 & note*
Patrick@291
   586
 & link*
Patrick@291
   587
 & anchor*
Patrick@291
   588
 & index*
Patrick@293
   589
patrick@75
   590
 & blank*
patrick@75
   591
 & point.right*
patrick@75
   592
 & point.wrong*
Patrick@293
   593
}
patrick@75
   594
patrick@73
   595
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blank ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   596
patrick@73
   597
# ~~~~~~ blank
Patrick@216
   598
blank = element blank { blank.attributes, blank.content }
Patrick@216
   599
Patrick@216
   600
blank.attributes =
Patrick@216
   601
   function.attribute?
Patrick@216
   602
function.attribute = attribute function { 'lowercase' | 'uppercase' }
patrick@73
   603
patrick@73
   604
blank.content =
patrick@73
   605
   text
patrick@87
   606
 | (s+, help?, answer?)
patrick@73
   607
patrick@73
   608
# ~~~~~~ s
patrick@73
   609
s = element s { s.content }
patrick@73
   610
patrick@73
   611
s.content = text
patrick@73
   612
patrick@73
   613
# ~~~~~~~~~~~~~~~~~~~~~~~~~ point.right, point.wrong ~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   614
patrick@73
   615
point.right = element right { point.right.content }
patrick@73
   616
point.wrong = element wrong { point.right.content }
patrick@73
   617
patrick@73
   618
point.right.content = inlines