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