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