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