RelaxNG/publiquiz.rnc
author Patrick PIERRE
sam., 24 sept. 2016 11:10:58 +0200
changeset 435 acc07d9146ed
parent 422 4840aea082dd
child 436 e0506760c16d
permissions -rw-r--r--
Attribut type pour <math>
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@417
    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 }
Coraline@409
    82
blanks-m.section = element section {
Coraline@409
    83
   section.attributes, blanks-m.section.content }
Patrick@336
    84
pointing.section = element section {
Patrick@336
    85
   section.attributes, pointing.section.content }
patrick@73
    86
patrick@73
    87
blanks.section.content =
patrick@73
    88
   section.head?,
patrick@73
    89
   (blanks.section+ | blanks.block+)
Coraline@409
    90
blanks-m.section.content =
Coraline@409
    91
   section.head?,
Coraline@409
    92
   (blanks-m.section+ | blanks-m.block+)
Patrick@336
    93
pointing.section.content =
patrick@73
    94
   section.head?,
Patrick@336
    95
   (pointing.section+ | pointing.block+)
patrick@73
    96
patrick@73
    97
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ instructions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
    98
patrick@73
    99
instructions = element instructions { section.content }
patrick@73
   100
patrick@73
   101
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ engine ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   102
patrick@73
   103
engine =
patrick@87
   104
   choices-radio
patrick@87
   105
 | choices-check
patrick@87
   106
 | blanks-fill
patrick@87
   107
 | blanks-select
Coraline@409
   108
 | blanks-media
Patrick@216
   109
 | blanks-char
Patrick@336
   110
 | pointing
Patrick@336
   111
 | pointing-categories
Coraline@409
   112
 | pip
patrick@73
   113
 | matching
patrick@73
   114
 | sort
patrick@125
   115
 | categories
patrick@87
   116
 | production
patrick@73
   117
patrick@73
   118
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ choices ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   119
patrick@87
   120
choices-radio = element choices-radio {
Patrick@376
   121
   choices-radio.attributes, choices-radio.content }
patrick@87
   122
choices-check = element choices-check {
Patrick@376
   123
   choices-check.attributes, choices-check.content }
patrick@73
   124
Patrick@376
   125
choices-radio.attributes =
patrick@73
   126
   shuffle.attribute?
Patrick@376
   127
choices-check.attributes =
Patrick@376
   128
   success.attribute?
Patrick@376
   129
 & shuffle.attribute?
Patrick@376
   130
success.attribute = attribute success { xsd:decimal {maxInclusive="1"} }
patrick@73
   131
shuffle.attribute = attribute shuffle { xsd:boolean }
patrick@73
   132
patrick@87
   133
choices-radio.content =
patrick@73
   134
   choices.right
patrick@73
   135
 & choices.wrong+
patrick@87
   136
choices-check.content =
patrick@73
   137
   (choices.right | choices.wrong)+
patrick@73
   138
patrick@73
   139
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blanks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   140
patrick@87
   141
blanks-fill = element blanks-fill {
patrick@87
   142
   blanks-fill.attributes, blanks-fill.content }
patrick@87
   143
blanks-select = element blanks-select {
patrick@87
   144
   blanks-select.attributes, blanks-select.content }
Coraline@409
   145
blanks-media = element blanks-media {
Coraline@409
   146
   blanks-select.attributes, blanks-media.content }
Patrick@411
   147
blanks-char = element blanks-char {
Coraline@402
   148
   blanks-char.attributes, blanks-select.content }
patrick@73
   149
patrick@87
   150
blanks-fill.attributes =
Patrick@376
   151
   success.attribute?
Patrick@376
   152
 & strict.attribute?
claire@381
   153
 & long.attribute?
patrick@87
   154
blanks-select.attributes =
Patrick@376
   155
   success.attribute?
Patrick@376
   156
 & multiple.attribute?
claire@380
   157
 & noshuffle.attribute?
Coraline@409
   158
 & orientation.attribute?
patrick@73
   159
strict.attribute = attribute strict { xsd:boolean }
patrick@73
   160
multiple.attribute = attribute multiple { xsd:boolean }
claire@380
   161
noshuffle.attribute = attribute no-shuffle { xsd:boolean }
claire@381
   162
long.attribute = attribute long { xsd:positiveInteger }
Coraline@409
   163
orientation.attribute = attribute orientation {"north"|"east"|"west"|"south"}
patrick@73
   164
patrick@87
   165
blanks-fill.content =
patrick@73
   166
   (blanks.block+ | blanks.section+)
patrick@87
   167
blanks-select.content =
Patrick@342
   168
   blanks.intruders?,
patrick@73
   169
   (blanks.block+ | blanks.section+)
Coraline@409
   170
blanks-media.content =
Coraline@409
   171
   blanks-m.intruders?,
Coraline@409
   172
   (blanks-m.block+ | blanks-m.section+)
patrick@73
   173
Coraline@402
   174
blanks-char.attributes =
Coraline@402
   175
   remove-space.attribute?
Coraline@402
   176
remove-space.attribute = attribute remove-space { xsd:boolean }
Coraline@402
   177
Patrick@336
   178
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pointing ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   179
Patrick@336
   180
pointing = element pointing { pointing.attributes, pointing.content }
patrick@75
   181
Patrick@336
   182
pointing.attributes =
Patrick@376
   183
   success.attribute?
Patrick@376
   184
 & pointing.type.attribute?
Patrick@336
   185
pointing.type.attribute = attribute type { "radio" | "check" }
patrick@73
   186
Patrick@336
   187
pointing.content =
Patrick@336
   188
   (pointing.section+ | pointing.block+)
Patrick@336
   189
Patrick@336
   190
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pointing-categories ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@336
   191
Patrick@336
   192
# ~~~~~~ pointing-categories
Patrick@376
   193
pointing-categories = element pointing-categories {
Patrick@376
   194
   pointing-c.attributes, pointing-c.content }
Patrick@376
   195
Patrick@376
   196
pointing-c.attributes =
Patrick@376
   197
   success.attribute?
Patrick@336
   198
Patrick@336
   199
pointing-c.content =
Patrick@336
   200
   pointing-c.categories,
Patrick@336
   201
   pointing.section
Patrick@336
   202
Patrick@336
   203
# ~~~~~~ pointing-c.categories
Patrick@336
   204
pointing-c.categories = element categories { pointing-c.categories.content }
Patrick@336
   205
Patrick@336
   206
pointing-c.categories.content =
Patrick@336
   207
   pointing-c.category1,
Patrick@336
   208
   pointing-c.category2,
Patrick@336
   209
   (pointing-c.category3,
Patrick@336
   210
      (pointing-c.category4, pointing-c.category5?)?)?
Patrick@336
   211
Patrick@336
   212
# ~~~~~~ pointing-c.categoryN
Patrick@336
   213
pointing-c.category1 = element category {
Patrick@336
   214
   attribute id { "1" }, pointing-c.category.content }
Patrick@336
   215
pointing-c.category2 = element category {
Patrick@336
   216
   attribute id { "2" }, pointing-c.category.content }
Patrick@336
   217
pointing-c.category3 = element category {
Patrick@336
   218
   attribute id { "3" }, pointing-c.category.content }
Patrick@336
   219
pointing-c.category4 = element category {
Patrick@336
   220
   attribute id { "4" }, pointing-c.category.content }
Patrick@336
   221
pointing-c.category5 = element category {
Patrick@336
   222
   attribute id { "5" }, pointing-c.category.content }
Patrick@336
   223
Patrick@336
   224
pointing-c.category.content = inlines
Patrick@336
   225
Coraline@409
   226
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pip ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Coraline@409
   227
Coraline@409
   228
pip = element pip { pip.content }
Coraline@409
   229
Coraline@409
   230
pip.content =
Coraline@409
   231
   pip.image
Coraline@409
   232
Coraline@409
   233
pip.image = element image { image.attributes, pip.image.content }
Coraline@409
   234
pip.image.content =
Coraline@409
   235
   pip.point+
Coraline@409
   236
patrick@73
   237
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ matching ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   238
Patrick@161
   239
# ~~~~~~ matching
Patrick@169
   240
matching = element matching { matching.attributes, matching.content }
Patrick@169
   241
Patrick@169
   242
matching.attributes =
Patrick@376
   243
   success.attribute?
Patrick@376
   244
 & multiple.attribute?
Coraline@409
   245
 & orientation.attribute?
patrick@75
   246
patrick@73
   247
matching.content =
Patrick@359
   248
   matching.intruders?,
patrick@73
   249
   match,
patrick@73
   250
   match+
patrick@73
   251
Patrick@161
   252
# ~~~~~~ match
Patrick@161
   253
match = element match { match.content }
Patrick@161
   254
Patrick@161
   255
match.content =
Patrick@161
   256
   match.item,
Patrick@161
   257
   match.item
Patrick@161
   258
patrick@73
   259
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sort ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   260
patrick@73
   261
sort = element sort { sort.attributes, sort.content }
patrick@73
   262
patrick@73
   263
sort.attributes =
Patrick@376
   264
   success.attribute?
Patrick@376
   265
 & shuffle.attribute?
Coraline@409
   266
 & orientation.attribute?
patrick@75
   267
patrick@73
   268
sort.content =
patrick@73
   269
   comparison?,
patrick@73
   270
   sort.item,
patrick@73
   271
   sort.item+
patrick@73
   272
patrick@125
   273
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ categories ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@125
   274
Patrick@310
   275
# ~~~~~~ category.head
Patrick@310
   276
category.head = element head { category.head.content }
Patrick@310
   277
Patrick@310
   278
category.head.content =
Patrick@384
   279
   title
Patrick@384
   280
 & shorttitle?
Patrick@384
   281
 & subtitle*
Patrick@310
   282
patrick@125
   283
# ~~~~~~ categories
Patrick@168
   284
categories = element categories { categories.attributes, categories.content }
patrick@125
   285
Patrick@168
   286
categories.attributes =
Patrick@376
   287
   success.attribute?
Patrick@376
   288
 & multiple.attribute?
claire@380
   289
 & noshuffle.attribute?
Coraline@409
   290
 & orientation.attribute?
Patrick@310
   291
patrick@125
   292
categories.content =
Patrick@344
   293
   categories.intruders?,
patrick@125
   294
   category,
patrick@125
   295
   category+
patrick@125
   296
patrick@125
   297
# ~~~~~~ category
patrick@125
   298
category = element category { category.content }
patrick@125
   299
patrick@125
   300
category.content =
patrick@125
   301
   category.head,
patrick@125
   302
   category.item*
patrick@125
   303
patrick@87
   304
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ production ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@87
   305
Coraline@407
   306
production = element production { production.content }
Coraline@407
   307
Coraline@407
   308
production.content = text
patrick@87
   309
patrick@73
   310
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ composite ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   311
patrick@77
   312
# ~~~~~~ composite
Patrick@161
   313
composite = element composite { composite.attributes, composite.content }
Patrick@161
   314
Patrick@161
   315
composite.attributes =
Patrick@376
   316
   success.attribute?
Patrick@376
   317
 & multipage.attribute?
Patrick@310
   318
multipage.attribute = attribute multipage { xsd:boolean }
patrick@75
   319
patrick@73
   320
composite.content =
patrick@85
   321
   subquiz,
Patrick@154
   322
   subquiz+
patrick@77
   323
patrick@85
   324
# ~~~~~~ subquiz
patrick@85
   325
subquiz = element subquiz { subquiz.content }
patrick@77
   326
patrick@85
   327
subquiz.content =
patrick@77
   328
   instructions?,
Patrick@141
   329
   engine,
Patrick@141
   330
   help?,
Patrick@141
   331
   answer?
patrick@73
   332
patrick@73
   333
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ help ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   334
patrick@73
   335
help = element help { help.content }
patrick@73
   336
patrick@73
   337
help.content =
patrick@73
   338
   (section+ | block+)?,
patrick@73
   339
   link*
patrick@73
   340
patrick@87
   341
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ answer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   342
patrick@87
   343
answer = element answer { answer.content }
patrick@73
   344
patrick@87
   345
answer.content =
patrick@81
   346
   (section+ | block+)?,
patrick@80
   347
   link*
patrick@73
   348
patrick@73
   349
patrick@73
   350
# =============================================================================
patrick@73
   351
#                                 BLOCK LEVEL
patrick@73
   352
# =============================================================================
patrick@73
   353
patrick@73
   354
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   355
Patrick@313
   356
blanks.block = (
Patrick@313
   357
   blanks.p | blanks.list | blanks.blockquote | blanks.speech | blanks.table
Patrick@313
   358
 | blanks.media)
Coraline@409
   359
blanks-m.block = (
Coraline@409
   360
   blanks-m.p | blanks-m.list | blanks-m.blockquote | blanks-m.speech
Coraline@409
   361
 | blanks-m.table | blanks-m.media)
Patrick@336
   362
pointing.block = (
Patrick@336
   363
   pointing.p | pointing.list | pointing.blockquote | pointing.speech
Patrick@336
   364
 | pointing.table | media)
patrick@73
   365
patrick@73
   366
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   367
patrick@73
   368
blanks.p = element p { blanks.p.content }
Coraline@409
   369
blanks-m.p = element p { blanks-m.p.content }
Patrick@336
   370
pointing.p = element p { pointing.p.content }
patrick@73
   371
patrick@73
   372
blanks.p.content =
patrick@75
   373
   blanks.inlines
Coraline@409
   374
blanks-m.p.content =
Coraline@409
   375
   blanks-m.inlines
Patrick@336
   376
pointing.p.content =
Patrick@336
   377
   pointing.inlines
patrick@73
   378
patrick@73
   379
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   380
patrick@73
   381
# ~~~~~~ list
patrick@75
   382
blanks.list = element list {
patrick@73
   383
   block.head?,
patrick@73
   384
   (  (attribute type {"ordered"}?, blanks.item, blanks.item+)
Coraline@422
   385
    | (attribute type {"glossary"}, item.glossary+) )
patrick@75
   386
}
Coraline@409
   387
blanks-m.list = element list {
Coraline@409
   388
   block.head?,
Coraline@409
   389
   (  (attribute type {"ordered"}?, blanks.item, blanks.item+)
Coraline@422
   390
    | (attribute type {"glossary"}, item.glossary+) )
Coraline@409
   391
}
Patrick@336
   392
pointing.list = element list {
patrick@73
   393
   block.head?,
Patrick@336
   394
   (  (attribute type {"ordered"}?, pointing.item, pointing.item+)
Coraline@422
   395
    | (attribute type {"glossary"}, item.glossary+) )
patrick@75
   396
}
patrick@73
   397
patrick@73
   398
# ~~~~~~ item
patrick@73
   399
blanks.item = element item { blanks.item.content }
Coraline@409
   400
blanks-m.item = element item { blanks.item.content }
Patrick@336
   401
pointing.item = element item { pointing.item.content }
patrick@73
   402
patrick@73
   403
blanks.item.content =
patrick@75
   404
   blanks.inlines
patrick@73
   405
 | blanks.block+
Coraline@409
   406
blanks-m.item.content =
Coraline@409
   407
   blanks-m.inlines
Coraline@409
   408
 | blanks-m.block+
Patrick@336
   409
pointing.item.content =
Patrick@336
   410
   pointing.inlines
Patrick@336
   411
 | pointing.block+
patrick@73
   412
Patrick@313
   413
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blockquote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@313
   414
Patrick@313
   415
blanks.blockquote = element blockquote {
Patrick@313
   416
   blockquote.attributes, blanks.blockquote.content }
Coraline@409
   417
blanks-m.blockquote = element blockquote {
Coraline@409
   418
   blockquote.attributes, blanks-m.blockquote.content }
Patrick@336
   419
pointing.blockquote = element blockquote {
Patrick@336
   420
   blockquote.attributes, pointing.blockquote.content }
Patrick@313
   421
Patrick@313
   422
blanks.blockquote.content =
Patrick@313
   423
   block.head?,
Patrick@313
   424
   (blanks.p | speech | blanks.list)+,
Patrick@313
   425
   attribution?
Coraline@409
   426
blanks-m.blockquote.content =
Coraline@409
   427
   block.head?,
Coraline@409
   428
   (blanks-m.p | speech | blanks-m.list)+,
Coraline@409
   429
   attribution?
Patrick@336
   430
pointing.blockquote.content =
Patrick@313
   431
   block.head?,
Patrick@336
   432
   (pointing.p | speech | pointing.list)+,
Patrick@313
   433
   attribution?
Patrick@313
   434
Patrick@313
   435
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@313
   436
Patrick@313
   437
# ~~~~~~ speech
Patrick@313
   438
blanks.speech = element speech { blanks.speech.content }
Coraline@409
   439
blanks-m.speech = element speech { blanks-m.speech.content }
Patrick@336
   440
pointing.speech = element speech { pointing.speech.content }
Patrick@313
   441
Patrick@313
   442
blanks.speech.content =
Patrick@313
   443
   blanks.speaker?,
Patrick@313
   444
   stage?,
Patrick@313
   445
   (blanks.p | blanks.blockquote)+
Coraline@409
   446
blanks-m.speech.content =
Coraline@409
   447
   blanks-m.speaker?,
Coraline@409
   448
   stage?,
Coraline@409
   449
   (blanks-m.p | blanks-m.blockquote)+
Patrick@336
   450
pointing.speech.content =
Patrick@336
   451
   pointing.speaker?,
Patrick@313
   452
   stage?,
Patrick@336
   453
   (pointing.p | pointing.blockquote)+
Patrick@313
   454
Patrick@313
   455
# ~~~~~~ speaker
Patrick@313
   456
blanks.speaker = element speaker { blanks.speaker.content }
Coraline@409
   457
blanks-m.speaker = element speaker { blanks-m.speaker.content }
Patrick@336
   458
pointing.speaker = element speaker { pointing.speaker.content }
Patrick@313
   459
Patrick@313
   460
blanks.speaker.content = blanks.inlines
Coraline@409
   461
blanks-m.speaker.content = blanks-m.inlines
Patrick@336
   462
pointing.speaker.content = pointing.inlines
Patrick@313
   463
patrick@73
   464
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   465
Patrick@313
   466
# ~~~~~~ table
patrick@249
   467
blanks.table = element table { table.attributes, blanks.table.content }
Coraline@409
   468
blanks-m.table = element table { table.attributes, blanks-m.table.content }
Patrick@336
   469
pointing.table = element table { table.attributes, pointing.table.content }
patrick@73
   470
patrick@73
   471
blanks.table.content =
patrick@73
   472
   block.head?,
Patrick@358
   473
   ((thead?, blanks.tbody+) | blanks.tr+),
Patrick@313
   474
   blanks.table.caption?
Coraline@409
   475
blanks-m.table.content =
Coraline@409
   476
   block.head?,
Coraline@409
   477
   ((thead?, blanks-m.tbody+) | blanks-m.tr+),
Coraline@409
   478
   blanks-m.table.caption?
Patrick@336
   479
pointing.table.content =
patrick@73
   480
   block.head?,
Patrick@358
   481
   ((thead?, pointing.tbody+) | pointing.tr+),
Patrick@336
   482
   pointing.table.caption?
patrick@73
   483
patrick@73
   484
# ~~~~~~ tbody
patrick@249
   485
blanks.tbody = element tbody { blanks.tbody.content }
Coraline@409
   486
blanks-m.tbody = element tbody { blanks-m.tbody.content }
Patrick@336
   487
pointing.tbody = element tbody { pointing.tbody.content }
patrick@73
   488
patrick@73
   489
blanks.tbody.content =
patrick@249
   490
   blanks.tr+
Coraline@409
   491
blanks-m.tbody.content =
Coraline@409
   492
   blanks-m.tr+
Patrick@336
   493
pointing.tbody.content =
Patrick@336
   494
   pointing.tr+
patrick@73
   495
patrick@249
   496
# ~~~~~~ tr
patrick@249
   497
blanks.tr = element tr { tr.attributes, blanks.tr.content }
Coraline@409
   498
blanks-m.tr = element tr { tr.attributes, blanks-m.tr.content }
Patrick@336
   499
pointing.tr = element tr { tr.attributes, pointing.tr.content }
patrick@73
   500
patrick@249
   501
blanks.tr.content =
patrick@249
   502
  (blanks.td | blanks.th)+
Coraline@409
   503
blanks-m.tr.content =
Coraline@409
   504
  (blanks-m.td | blanks-m.th)+
Patrick@336
   505
pointing.tr.content =
Patrick@336
   506
  (pointing.td | pointing.th)+
patrick@73
   507
patrick@249
   508
# ~~~~~~ td, th
patrick@249
   509
blanks.td = element td { td.attributes, blanks.td.content }
patrick@249
   510
blanks.th = element th { td.attributes, blanks.td.content }
Coraline@409
   511
blanks-m.td = element td { td.attributes, blanks-m.td.content }
Coraline@409
   512
blanks-m.th = element th { td.attributes, blanks-m.td.content }
Patrick@336
   513
pointing.td = element td { td.attributes, pointing.td.content }
Patrick@336
   514
pointing.th = element th { td.attributes, pointing.td.content }
patrick@73
   515
patrick@249
   516
blanks.td.content =
patrick@75
   517
   blanks.inlines
Patrick@313
   518
 | (blanks.p | blanks.media)+
Coraline@409
   519
blanks-m.td.content =
Coraline@409
   520
   blanks-m.inlines
Coraline@409
   521
 | (blanks-m.p | blanks-m.media)+
Patrick@336
   522
pointing.td.content =
Patrick@336
   523
   pointing.inlines
Patrick@336
   524
 | (pointing.p | media)+
Patrick@313
   525
Patrick@313
   526
# ~~~~~~ table.caption
Patrick@313
   527
blanks.table.caption = element caption { blanks.caption.content }
Coraline@409
   528
blanks-m.table.caption = element caption { blanks-m.caption.content }
Patrick@336
   529
pointing.table.caption = element caption { pointing.caption.content }
Patrick@313
   530
Patrick@313
   531
blanks.caption.content =
Patrick@313
   532
   blanks.inlines
Patrick@313
   533
 | (blanks.p | speech | blanks.list | blockquote)+
Coraline@409
   534
blanks-m.caption.content =
Coraline@409
   535
   blanks-m.inlines
Coraline@409
   536
 | (blanks-m.p | speech | blanks-m.list | blockquote)+
Patrick@336
   537
pointing.caption.content =
Patrick@336
   538
   pointing.inlines
Patrick@336
   539
 | (pointing.p | speech | pointing.list | blockquote)+
patrick@73
   540
Patrick@174
   541
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@174
   542
Patrick@313
   543
# ~~~~~~ media
Patrick@313
   544
blanks.media = element media { media.attributes, blanks.media.content }
Coraline@409
   545
blanks-m.media = element media { media.attributes, blanks-m.media.content }
Patrick@336
   546
pointing.media = element media { media.attributes, pointing.media.content }
Patrick@174
   547
Patrick@313
   548
blanks.media.content =
Patrick@174
   549
   block.head?,
Patrick@174
   550
   (blanks.image | audio | video)+,
Patrick@313
   551
   blanks.media.caption?,
Patrick@313
   552
   link?
Coraline@409
   553
blanks-m.media.content =
Coraline@409
   554
   block.head?,
Coraline@409
   555
   (blanks-m.image | audio | video)+,
Coraline@409
   556
   blanks-m.media.caption?,
Coraline@409
   557
   link?
Patrick@336
   558
pointing.media.content =
Patrick@313
   559
   block.head?,
Patrick@313
   560
   (image | audio | video)+,
Patrick@336
   561
   pointing.media.caption?,
Patrick@174
   562
   link?
Patrick@174
   563
Patrick@174
   564
# ~~~~~~ blanks.image
Patrick@174
   565
blanks.image = element image { image.attributes, blanks.image.content }
Coraline@409
   566
blanks-m.image = element image { image.attributes, blanks-m.image.content }
Patrick@174
   567
Patrick@174
   568
blanks.image.content =
Patrick@174
   569
   copyright?,
Patrick@192
   570
   blanks.dropzone*
Coraline@409
   571
blanks-m.image.content =
Coraline@409
   572
   copyright?,
Coraline@409
   573
   blanks-m.dropzone*
Patrick@174
   574
Patrick@313
   575
# ~~~~~~ dropzone
Patrick@192
   576
blanks.dropzone = element dropzone {
Patrick@192
   577
   blanks.dropzone.attributes, blanks.dropzone.content }
Coraline@409
   578
blanks-m.dropzone = element dropzone {
Patrick@411
   579
   blanks-m.dropzone.attributes, blanks-m.dropzone.content }
Patrick@183
   580
Patrick@192
   581
blanks.dropzone.attributes =
Patrick@183
   582
   x.attribute
Patrick@310
   583
 & y.attribute
Patrick@411
   584
blanks-m.dropzone.attributes =
patrick@194
   585
   x.attribute
patrick@194
   586
 & y.attribute
Coraline@412
   587
 & h.attribute
patrick@194
   588
 & w.attribute
Patrick@174
   589
Patrick@192
   590
blanks.dropzone.content =
Patrick@183
   591
   blank
Coraline@409
   592
blanks-m.dropzone.content =
Coraline@409
   593
   blank-m
Patrick@174
   594
Patrick@313
   595
# ~~~~~~ media.caption
Patrick@313
   596
blanks.media.caption = element caption {
Patrick@313
   597
   caption.attributes, blanks.caption.content }
Coraline@409
   598
blanks-m.media.caption = element caption {
Coraline@409
   599
   caption.attributes, blanks-m.caption.content }
Patrick@336
   600
pointing.media.caption = element caption {
Patrick@336
   601
   caption.attributes, pointing.caption.content }
Patrick@313
   602
patrick@73
   603
# ~~~~~~~~~~~~~~~~~~~~~~~~ choices.right, choices.wrong ~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   604
patrick@73
   605
choices.right = element right { choices.right.content }
patrick@73
   606
choices.wrong = element wrong { choices.right.content }
patrick@73
   607
patrick@73
   608
choices.right.content =
patrick@73
   609
   inlines
Patrick@161
   610
 | ((p | image | (audio, image?) | video), help?, answer?)
patrick@73
   611
Coraline@409
   612
# ~~~~~~~~~~~~~~~~~~~~ blanks.intruders, blanks-m.intruders  ~~~~~~~~~~~~~~~~~~
patrick@73
   613
Patrick@342
   614
blanks.intruders = element intruders { blanks.intruders.content }
Coraline@409
   615
blanks-m.intruders = element intruders { blanks-m.intruders.content }
patrick@73
   616
Coraline@409
   617
blanks.intruders.content = blank+
Coraline@409
   618
blanks-m.intruders.content = blank-m+
patrick@73
   619
Patrick@359
   620
# ~~~~~~~~~~~~~~~~~~~~~~~ matching.intruders, match.item ~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   621
Patrick@359
   622
# ~~~~~~~ matching.intruders
Patrick@359
   623
matching.intruders = element intruders { matching.intruders.content }
Patrick@359
   624
Patrick@359
   625
matching.intruders.content =
Patrick@359
   626
   match.item+
Patrick@359
   627
Patrick@359
   628
# ~~~~~~~ match.item
Patrick@161
   629
match.item = element item { match.item.content }
patrick@73
   630
Patrick@161
   631
match.item.content =
Patrick@161
   632
   inlines
Patrick@341
   633
 | (p, help?, answer?)
patrick@73
   634
Patrick@313
   635
# ~~~~~~~~~~~~~~~~~~~~~~~~ comparison, sort.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   636
patrick@73
   637
# ~~~~~~ comparison
patrick@73
   638
comparison = element comparison { comparison.content }
patrick@73
   639
patrick@73
   640
comparison.content = inlines
patrick@73
   641
patrick@73
   642
# ~~~~~~ sort.item
patrick@73
   643
sort.item = element item { sort.item.attributes, sort.item.content }
patrick@73
   644
patrick@73
   645
sort.item.attributes =
patrick@73
   646
   item.shuffle.attribute?
patrick@73
   647
item.shuffle.attribute = attribute shuffle { xsd:integer }
patrick@73
   648
Patrick@161
   649
sort.item.content =
Patrick@161
   650
   inlines
Patrick@341
   651
 | (p, help?, answer?)
patrick@73
   652
Patrick@344
   653
# ~~~~~~~~~~~~~~~~~~~~~ categories.intruders, category.item ~~~~~~~~~~~~~~~~~~~
patrick@125
   654
Patrick@344
   655
# ~~~~~~ categories.intruders
Patrick@344
   656
categories.intruders = element intruders { categories.intruders.content }
Patrick@342
   657
Patrick@344
   658
categories.intruders.content =
Patrick@342
   659
   category.item+
Patrick@342
   660
Patrick@342
   661
# ~~~~~~ category.item
patrick@125
   662
category.item = element item { category.item.content }
patrick@125
   663
Patrick@161
   664
category.item.content =
Patrick@161
   665
   inlines
Patrick@341
   666
 | (p, help?, answer?)
patrick@125
   667
patrick@73
   668
patrick@73
   669
# =============================================================================
patrick@73
   670
#                                 INLINE LEVEL
patrick@73
   671
# =============================================================================
patrick@73
   672
patrick@75
   673
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@75
   674
Patrick@293
   675
blanks.inlines = mixed {
Patrick@293
   676
   sup*
Patrick@293
   677
 & sub*
Patrick@293
   678
 & var*
Patrick@293
   679
 & number*
Patrick@293
   680
 & acronym*
Patrick@293
   681
 & warning*
Patrick@293
   682
Patrick@291
   683
 & highlight*
Patrick@291
   684
 & emphasis*
Patrick@291
   685
 & mentioned*
Patrick@350
   686
 & literal*
Patrick@350
   687
 & term*
Patrick@291
   688
 & stage*
Patrick@350
   689
 & name*
Patrick@350
   690
 & foreign*
Patrick@350
   691
 & date*
Patrick@350
   692
 & math*
Patrick@351
   693
 & quote*
Patrick@291
   694
 & initial*
Patrick@291
   695
 & note*
Patrick@291
   696
 & link*
Patrick@291
   697
 & anchor*
Patrick@291
   698
 & index*
Patrick@351
   699
 & image*
Patrick@351
   700
 & audio*
Patrick@351
   701
 & smil*
Patrick@293
   702
patrick@75
   703
 & blank*
Patrick@293
   704
}
Patrick@288
   705
Coraline@409
   706
blanks-m.inlines = mixed {
Coraline@409
   707
   sup*
Coraline@409
   708
 & sub*
Coraline@409
   709
 & var*
Coraline@409
   710
 & number*
Coraline@409
   711
 & acronym*
Coraline@409
   712
 & warning*
Coraline@409
   713
Coraline@409
   714
 & highlight*
Coraline@409
   715
 & emphasis*
Coraline@409
   716
 & mentioned*
Coraline@409
   717
 & literal*
Coraline@409
   718
 & term*
Coraline@409
   719
 & stage*
Coraline@409
   720
 & name*
Coraline@409
   721
 & foreign*
Coraline@409
   722
 & date*
Coraline@409
   723
 & math*
Coraline@409
   724
 & quote*
Coraline@409
   725
 & initial*
Coraline@409
   726
 & note*
Coraline@409
   727
 & link*
Coraline@409
   728
 & anchor*
Coraline@409
   729
 & index*
Coraline@409
   730
 & image*
Coraline@409
   731
 & audio*
Coraline@409
   732
 & smil*
Coraline@409
   733
Coraline@409
   734
 & blank-m*
Coraline@409
   735
}
Coraline@409
   736
Patrick@336
   737
pointing.inlines = mixed {
Patrick@293
   738
   sup*
Patrick@293
   739
 & sub*
Patrick@293
   740
 & var*
Patrick@293
   741
 & number*
Patrick@293
   742
 & acronym*
Patrick@293
   743
 & warning*
Patrick@293
   744
Patrick@291
   745
 & highlight*
Patrick@291
   746
 & emphasis*
Patrick@291
   747
 & mentioned*
Patrick@350
   748
 & literal*
Patrick@350
   749
 & term*
Patrick@291
   750
 & stage*
Patrick@350
   751
 & name*
Patrick@350
   752
 & foreign*
Patrick@350
   753
 & date*
Patrick@350
   754
 & math*
Patrick@351
   755
 & quote*
Patrick@291
   756
 & initial*
Patrick@291
   757
 & note*
Patrick@291
   758
 & link*
Patrick@291
   759
 & anchor*
Patrick@291
   760
 & index*
Patrick@351
   761
 & image*
Patrick@351
   762
 & audio*
Patrick@351
   763
 & smil*
Patrick@293
   764
Patrick@336
   765
 & point*
Patrick@293
   766
}
patrick@75
   767
Coraline@409
   768
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blank, blank-m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   769
patrick@73
   770
# ~~~~~~ blank
Patrick@216
   771
blank = element blank { blank.attributes, blank.content }
Patrick@216
   772
Patrick@216
   773
blank.attributes =
claire@381
   774
   area.attribute?
claire@381
   775
 & long.attribute?
claire@381
   776
 & function.attribute?
claire@381
   777
area.attribute = attribute area { xsd:boolean }
Coraline@402
   778
function.attribute = attribute function { 'accent' | 'uppercase' }
patrick@73
   779
patrick@73
   780
blank.content =
patrick@73
   781
   text
patrick@87
   782
 | (s+, help?, answer?)
patrick@73
   783
Coraline@409
   784
# ~~~~~~ blank-m
Coraline@409
   785
blank-m = element blank { blank-m.content }
Patrick@411
   786
blank-m.content =
Patrick@411
   787
   p
Patrick@411
   788
 | math
Patrick@411
   789
 | image
Patrick@411
   790
 | audio
Patrick@411
   791
 | (s-m+, help?, answer?)
Coraline@409
   792
patrick@73
   793
# ~~~~~~ s
patrick@73
   794
s = element s { s.content }
Coraline@409
   795
s.content = text
patrick@73
   796
Coraline@409
   797
# ~~~~~~ s-m
Coraline@409
   798
s-m = element s { s-m.content }
Patrick@411
   799
s-m.content =
Patrick@411
   800
   p
Patrick@411
   801
 | math
Patrick@411
   802
 | image
Patrick@411
   803
 | audio
patrick@73
   804
Patrick@336
   805
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ point ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   806
Patrick@336
   807
point = element point { point.attributes, point.content }
Coraline@409
   808
pip.point = element point { pip.point.attributes, point.content }
patrick@73
   809
Patrick@336
   810
point.attributes =
Patrick@336
   811
   point.ref.attribute?
Coraline@409
   812
pip.point.attributes =
Coraline@409
   813
   point.ref.attribute?
Coraline@409
   814
 & x.attribute
Coraline@409
   815
 & y.attribute
Coraline@409
   816
 & w.attribute
Coraline@409
   817
 & h.attribute
Coraline@409
   818
Patrick@340
   819
point.ref.attribute = attribute ref {
Patrick@340
   820
   "right" | "cat1" | "cat2" | "cat3" | "cat4" | "cat5" }
Patrick@336
   821
Patrick@356
   822
point.content = inlines