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