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