RelaxNG/publiquiz.rnc
author Patrick PIERRE
jeu., 27 nov. 2014 12:29:06 +0100
changeset 353 36519cbf459f
parent 351 715ab7002268
child 356 2fc11c1323b8
permissions -rw-r--r--
Ajout de <front>
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@73
   203
   match,
patrick@73
   204
   match+
patrick@73
   205
Patrick@161
   206
# ~~~~~~ match
Patrick@161
   207
match = element match { match.content }
Patrick@161
   208
Patrick@161
   209
match.content =
Patrick@161
   210
   match.item,
Patrick@161
   211
   match.item
Patrick@161
   212
patrick@73
   213
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sort ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   214
patrick@73
   215
sort = element sort { sort.attributes, sort.content }
patrick@73
   216
patrick@73
   217
sort.attributes =
patrick@73
   218
   shuffle.attribute?
patrick@75
   219
patrick@73
   220
sort.content =
patrick@73
   221
   comparison?,
patrick@73
   222
   sort.item,
patrick@73
   223
   sort.item+
patrick@73
   224
patrick@125
   225
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ categories ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@125
   226
Patrick@310
   227
# ~~~~~~ category.head
Patrick@310
   228
category.head = element head { category.head.content }
Patrick@310
   229
Patrick@310
   230
category.head.content =
Patrick@310
   231
   title,
Patrick@310
   232
   shorttitle?,
Patrick@310
   233
   subtitle*
Patrick@310
   234
patrick@125
   235
# ~~~~~~ categories
Patrick@168
   236
categories = element categories { categories.attributes, categories.content }
patrick@125
   237
Patrick@168
   238
categories.attributes =
Patrick@168
   239
   multiple.attribute?
Patrick@310
   240
patrick@125
   241
categories.content =
Patrick@344
   242
   categories.intruders?,
patrick@125
   243
   category,
patrick@125
   244
   category+
patrick@125
   245
patrick@125
   246
# ~~~~~~ category
patrick@125
   247
category = element category { category.content }
patrick@125
   248
patrick@125
   249
category.content =
patrick@125
   250
   category.head,
patrick@125
   251
   category.item*
patrick@125
   252
patrick@194
   253
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pip ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@194
   254
patrick@194
   255
pip = element pip { pip.attributes, pip.content }
patrick@194
   256
patrick@194
   257
pip.attributes =
patrick@194
   258
   multiple.attribute?
patrick@194
   259
patrick@194
   260
pip.content =
patrick@194
   261
   pip.image
patrick@194
   262
patrick@87
   263
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ production ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@87
   264
patrick@87
   265
production = element production { empty }
patrick@87
   266
patrick@73
   267
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ composite ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   268
patrick@77
   269
# ~~~~~~ composite
Patrick@161
   270
composite = element composite { composite.attributes, composite.content }
Patrick@161
   271
Patrick@161
   272
composite.attributes =
Patrick@161
   273
   multipage.attribute?
Patrick@310
   274
multipage.attribute = attribute multipage { xsd:boolean }
patrick@75
   275
patrick@73
   276
composite.content =
patrick@85
   277
   subquiz,
Patrick@154
   278
   subquiz+
patrick@77
   279
patrick@85
   280
# ~~~~~~ subquiz
patrick@85
   281
subquiz = element subquiz { subquiz.content }
patrick@77
   282
patrick@85
   283
subquiz.content =
patrick@77
   284
   instructions?,
Patrick@141
   285
   engine,
Patrick@141
   286
   help?,
Patrick@141
   287
   answer?
patrick@73
   288
patrick@73
   289
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ help ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   290
patrick@73
   291
help = element help { help.content }
patrick@73
   292
patrick@73
   293
help.content =
patrick@73
   294
   (section+ | block+)?,
patrick@73
   295
   link*
patrick@73
   296
patrick@87
   297
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ answer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   298
patrick@87
   299
answer = element answer { answer.content }
patrick@73
   300
patrick@87
   301
answer.content =
patrick@81
   302
   (section+ | block+)?,
patrick@80
   303
   link*
patrick@73
   304
patrick@73
   305
patrick@73
   306
# =============================================================================
patrick@73
   307
#                                 BLOCK LEVEL
patrick@73
   308
# =============================================================================
patrick@73
   309
patrick@73
   310
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   311
Patrick@313
   312
blanks.block = (
Patrick@313
   313
   blanks.p | blanks.list | blanks.blockquote | blanks.speech | blanks.table
Patrick@313
   314
 | blanks.media)
Patrick@336
   315
pointing.block = (
Patrick@336
   316
   pointing.p | pointing.list | pointing.blockquote | pointing.speech
Patrick@336
   317
 | pointing.table | media)
patrick@73
   318
patrick@73
   319
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   320
patrick@73
   321
blanks.p = element p { blanks.p.content }
Patrick@336
   322
pointing.p = element p { pointing.p.content }
patrick@73
   323
patrick@73
   324
blanks.p.content =
patrick@75
   325
   blanks.inlines
Patrick@336
   326
pointing.p.content =
Patrick@336
   327
   pointing.inlines
patrick@73
   328
patrick@73
   329
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   330
patrick@73
   331
# ~~~~~~ list
patrick@75
   332
blanks.list = element list {
patrick@73
   333
   block.head?,
patrick@73
   334
   (  (attribute type {"ordered"}?, blanks.item, blanks.item+)
patrick@73
   335
    | (attribute type {"glossary"}, glossary.item+) )
patrick@75
   336
}
Patrick@336
   337
pointing.list = element list {
patrick@73
   338
   block.head?,
Patrick@336
   339
   (  (attribute type {"ordered"}?, pointing.item, pointing.item+)
patrick@73
   340
    | (attribute type {"glossary"}, glossary.item+) )
patrick@75
   341
}
patrick@73
   342
patrick@73
   343
# ~~~~~~ item
patrick@73
   344
blanks.item = element item { blanks.item.content }
Patrick@336
   345
pointing.item = element item { pointing.item.content }
patrick@73
   346
patrick@73
   347
blanks.item.content =
patrick@75
   348
   blanks.inlines
patrick@73
   349
 | blanks.block+
Patrick@336
   350
pointing.item.content =
Patrick@336
   351
   pointing.inlines
Patrick@336
   352
 | pointing.block+
patrick@73
   353
Patrick@313
   354
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blockquote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@313
   355
Patrick@313
   356
blanks.blockquote = element blockquote {
Patrick@313
   357
   blockquote.attributes, blanks.blockquote.content }
Patrick@336
   358
pointing.blockquote = element blockquote {
Patrick@336
   359
   blockquote.attributes, pointing.blockquote.content }
Patrick@313
   360
Patrick@313
   361
blanks.blockquote.content =
Patrick@313
   362
   block.head?,
Patrick@313
   363
   (blanks.p | speech | blanks.list)+,
Patrick@313
   364
   attribution?
Patrick@336
   365
pointing.blockquote.content =
Patrick@313
   366
   block.head?,
Patrick@336
   367
   (pointing.p | speech | pointing.list)+,
Patrick@313
   368
   attribution?
Patrick@313
   369
Patrick@313
   370
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@313
   371
Patrick@313
   372
# ~~~~~~ speech
Patrick@313
   373
blanks.speech = element speech { blanks.speech.content }
Patrick@336
   374
pointing.speech = element speech { pointing.speech.content }
Patrick@313
   375
Patrick@313
   376
blanks.speech.content =
Patrick@313
   377
   blanks.speaker?,
Patrick@313
   378
   stage?,
Patrick@313
   379
   (blanks.p | blanks.blockquote)+
Patrick@336
   380
pointing.speech.content =
Patrick@336
   381
   pointing.speaker?,
Patrick@313
   382
   stage?,
Patrick@336
   383
   (pointing.p | pointing.blockquote)+
Patrick@313
   384
Patrick@313
   385
# ~~~~~~ speaker
Patrick@313
   386
blanks.speaker = element speaker { blanks.speaker.content }
Patrick@336
   387
pointing.speaker = element speaker { pointing.speaker.content }
Patrick@313
   388
Patrick@313
   389
blanks.speaker.content = blanks.inlines
Patrick@336
   390
pointing.speaker.content = pointing.inlines
Patrick@313
   391
patrick@73
   392
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   393
Patrick@313
   394
# ~~~~~~ table
patrick@249
   395
blanks.table = element table { table.attributes, blanks.table.content }
Patrick@336
   396
pointing.table = element table { table.attributes, pointing.table.content }
patrick@73
   397
patrick@73
   398
blanks.table.content =
patrick@73
   399
   block.head?,
patrick@249
   400
   thead?,
patrick@249
   401
   (blanks.tbody+ | blanks.tr+),
Patrick@313
   402
   blanks.table.caption?
Patrick@336
   403
pointing.table.content =
patrick@73
   404
   block.head?,
Patrick@336
   405
   (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@73
   435
Patrick@336
   436
pointing.td.content =
Patrick@336
   437
   pointing.inlines
Patrick@336
   438
 | (pointing.p | media)+
Patrick@313
   439
Patrick@313
   440
# ~~~~~~ table.caption
Patrick@313
   441
blanks.table.caption = element caption { blanks.caption.content }
Patrick@336
   442
pointing.table.caption = element caption { pointing.caption.content }
Patrick@313
   443
Patrick@313
   444
blanks.caption.content =
Patrick@313
   445
   blanks.inlines
Patrick@313
   446
 | (blanks.p | speech | blanks.list | blockquote)+
Patrick@336
   447
pointing.caption.content =
Patrick@336
   448
   pointing.inlines
Patrick@336
   449
 | (pointing.p | speech | pointing.list | blockquote)+
patrick@73
   450
Patrick@174
   451
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@174
   452
Patrick@313
   453
# ~~~~~~ media
Patrick@313
   454
blanks.media = element media { media.attributes, blanks.media.content }
Patrick@336
   455
pointing.media = element media { media.attributes, pointing.media.content }
Patrick@174
   456
Patrick@313
   457
blanks.media.content =
Patrick@174
   458
   block.head?,
Patrick@174
   459
   (blanks.image | audio | video)+,
Patrick@313
   460
   blanks.media.caption?,
Patrick@313
   461
   link?
Patrick@336
   462
pointing.media.content =
Patrick@313
   463
   block.head?,
Patrick@313
   464
   (image | audio | video)+,
Patrick@336
   465
   pointing.media.caption?,
Patrick@174
   466
   link?
Patrick@174
   467
Patrick@174
   468
# ~~~~~~ blanks.image
Patrick@174
   469
blanks.image = element image { image.attributes, blanks.image.content }
patrick@194
   470
pip.image = element image { image.attributes, pip.image.content }
Patrick@174
   471
Patrick@174
   472
blanks.image.content =
Patrick@174
   473
   copyright?,
Patrick@192
   474
   blanks.dropzone*
patrick@194
   475
pip.image.content =
patrick@194
   476
   pip.dropzone+
Patrick@174
   477
Patrick@313
   478
# ~~~~~~ dropzone
Patrick@192
   479
blanks.dropzone = element dropzone {
Patrick@192
   480
   blanks.dropzone.attributes, blanks.dropzone.content }
patrick@194
   481
pip.dropzone = element dropzone {
patrick@194
   482
   pip.dropzone.attributes, pip.dropzone.content }
Patrick@183
   483
Patrick@192
   484
blanks.dropzone.attributes =
Patrick@183
   485
   x.attribute
Patrick@310
   486
 & y.attribute
patrick@194
   487
pip.dropzone.attributes =
patrick@194
   488
   x.attribute
patrick@194
   489
 & y.attribute
patrick@194
   490
 & w.attribute
patrick@194
   491
 & h.attribute
Patrick@174
   492
Patrick@192
   493
blanks.dropzone.content =
Patrick@183
   494
   blank
patrick@194
   495
pip.dropzone.content =
patrick@194
   496
   image?
Patrick@174
   497
Patrick@313
   498
# ~~~~~~ media.caption
Patrick@313
   499
blanks.media.caption = element caption {
Patrick@313
   500
   caption.attributes, blanks.caption.content }
Patrick@336
   501
pointing.media.caption = element caption {
Patrick@336
   502
   caption.attributes, pointing.caption.content }
Patrick@313
   503
patrick@73
   504
# ~~~~~~~~~~~~~~~~~~~~~~~~ choices.right, choices.wrong ~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   505
patrick@73
   506
choices.right = element right { choices.right.content }
patrick@73
   507
choices.wrong = element wrong { choices.right.content }
patrick@73
   508
patrick@73
   509
choices.right.content =
patrick@73
   510
   inlines
Patrick@161
   511
 | ((p | image | (audio, image?) | video), help?, answer?)
patrick@73
   512
Patrick@342
   513
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blanks.intruders ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   514
Patrick@342
   515
blanks.intruders = element intruders { blanks.intruders.content }
patrick@73
   516
Patrick@342
   517
blanks.intruders.content =
Patrick@343
   518
   blank+
patrick@73
   519
Patrick@313
   520
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ match.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   521
Patrick@161
   522
match.item = element item { match.item.content }
patrick@73
   523
Patrick@161
   524
match.item.content =
Patrick@161
   525
   inlines
Patrick@341
   526
 | (p, help?, answer?)
patrick@73
   527
Patrick@313
   528
# ~~~~~~~~~~~~~~~~~~~~~~~~ comparison, sort.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   529
patrick@73
   530
# ~~~~~~ comparison
patrick@73
   531
comparison = element comparison { comparison.content }
patrick@73
   532
patrick@73
   533
comparison.content = inlines
patrick@73
   534
patrick@73
   535
# ~~~~~~ sort.item
patrick@73
   536
sort.item = element item { sort.item.attributes, sort.item.content }
patrick@73
   537
patrick@73
   538
sort.item.attributes =
patrick@73
   539
   item.shuffle.attribute?
patrick@73
   540
item.shuffle.attribute = attribute shuffle { xsd:integer }
patrick@73
   541
Patrick@161
   542
sort.item.content =
Patrick@161
   543
   inlines
Patrick@341
   544
 | (p, help?, answer?)
patrick@73
   545
Patrick@344
   546
# ~~~~~~~~~~~~~~~~~~~~~ categories.intruders, category.item ~~~~~~~~~~~~~~~~~~~
patrick@125
   547
Patrick@344
   548
# ~~~~~~ categories.intruders
Patrick@344
   549
categories.intruders = element intruders { categories.intruders.content }
Patrick@342
   550
Patrick@344
   551
categories.intruders.content =
Patrick@342
   552
   category.item+
Patrick@342
   553
Patrick@342
   554
# ~~~~~~ category.item
patrick@125
   555
category.item = element item { category.item.content }
patrick@125
   556
Patrick@161
   557
category.item.content =
Patrick@161
   558
   inlines
Patrick@341
   559
 | (p, help?, answer?)
patrick@125
   560
patrick@73
   561
patrick@73
   562
# =============================================================================
patrick@73
   563
#                                 INLINE LEVEL
patrick@73
   564
# =============================================================================
patrick@73
   565
patrick@75
   566
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@75
   567
Patrick@293
   568
blanks.inlines = mixed {
Patrick@293
   569
   sup*
Patrick@293
   570
 & sub*
Patrick@293
   571
 & var*
Patrick@293
   572
 & number*
Patrick@293
   573
 & acronym*
Patrick@293
   574
 & warning*
Patrick@293
   575
Patrick@291
   576
 & highlight*
Patrick@291
   577
 & emphasis*
Patrick@291
   578
 & mentioned*
Patrick@350
   579
 & literal*
Patrick@350
   580
 & term*
Patrick@291
   581
 & stage*
Patrick@350
   582
 & name*
Patrick@350
   583
 & foreign*
Patrick@350
   584
 & date*
Patrick@350
   585
 & math*
Patrick@351
   586
 & quote*
Patrick@291
   587
 & initial*
Patrick@291
   588
 & note*
Patrick@291
   589
 & link*
Patrick@291
   590
 & anchor*
Patrick@291
   591
 & index*
Patrick@351
   592
 & image*
Patrick@351
   593
 & audio*
Patrick@351
   594
 & smil*
Patrick@293
   595
patrick@75
   596
 & blank*
Patrick@293
   597
}
Patrick@288
   598
Patrick@336
   599
pointing.inlines = mixed {
Patrick@293
   600
   sup*
Patrick@293
   601
 & sub*
Patrick@293
   602
 & var*
Patrick@293
   603
 & number*
Patrick@293
   604
 & acronym*
Patrick@293
   605
 & warning*
Patrick@293
   606
Patrick@291
   607
 & highlight*
Patrick@291
   608
 & emphasis*
Patrick@291
   609
 & mentioned*
Patrick@350
   610
 & literal*
Patrick@350
   611
 & term*
Patrick@291
   612
 & stage*
Patrick@350
   613
 & name*
Patrick@350
   614
 & foreign*
Patrick@350
   615
 & date*
Patrick@350
   616
 & math*
Patrick@351
   617
 & quote*
Patrick@291
   618
 & initial*
Patrick@291
   619
 & note*
Patrick@291
   620
 & link*
Patrick@291
   621
 & anchor*
Patrick@291
   622
 & index*
Patrick@351
   623
 & image*
Patrick@351
   624
 & audio*
Patrick@351
   625
 & smil*
Patrick@293
   626
Patrick@336
   627
 & point*
Patrick@293
   628
}
patrick@75
   629
patrick@73
   630
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blank ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   631
patrick@73
   632
# ~~~~~~ blank
Patrick@216
   633
blank = element blank { blank.attributes, blank.content }
Patrick@216
   634
Patrick@216
   635
blank.attributes =
Patrick@216
   636
   function.attribute?
Patrick@216
   637
function.attribute = attribute function { 'lowercase' | 'uppercase' }
patrick@73
   638
patrick@73
   639
blank.content =
patrick@73
   640
   text
patrick@87
   641
 | (s+, help?, answer?)
patrick@73
   642
patrick@73
   643
# ~~~~~~ s
patrick@73
   644
s = element s { s.content }
patrick@73
   645
patrick@73
   646
s.content = text
patrick@73
   647
Patrick@336
   648
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ point ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   649
Patrick@336
   650
point = element point { point.attributes, point.content }
patrick@73
   651
Patrick@336
   652
point.attributes =
Patrick@336
   653
   point.ref.attribute?
Patrick@340
   654
point.ref.attribute = attribute ref {
Patrick@340
   655
   "right" | "cat1" | "cat2" | "cat3" | "cat4" | "cat5" }
Patrick@336
   656
Patrick@336
   657
point.content = simple.inlines