RelaxNG/publiquiz.rnc
author iinov
jeu., 08 nov. 2018 15:26:56 +0100
changeset 469 c662d725dd69
parent 468 6b322a48536c
child 472 021552e09b34
permissions -rw-r--r--
Date complète
patrick@73
     1
include "publidoc.rnc" {
patrick@73
     2
   start = publiquiz
patrick@73
     3
patrick@73
     4
   document.content =
patrick@73
     5
      top.head?,
patrick@73
     6
      (division | topic | quiz)+
patrick@84
     7
patrick@84
     8
   division.content =
patrick@84
     9
      division.head?,
Patrick@353
    10
      front?,
patrick@84
    11
      (division | topic | quiz)+
Coraline@436
    12
Coraline@436
    13
   nowrap.content =
Coraline@441
    14
       inlines | blanks.inlines | blanks-m.inlines | blanks-c.inlines
Coraline@441
    15
       | pointing.inlines
patrick@73
    16
}
patrick@73
    17
patrick@75
    18
patrick@73
    19
publiquiz = element publiquiz {
patrick@73
    20
   publiquiz.attributes,
patrick@73
    21
   publiquiz.content
patrick@73
    22
}
patrick@73
    23
patrick@73
    24
publiquiz.attributes =
patrick@73
    25
   version.attribute
patrick@73
    26
patrick@73
    27
publiquiz.content =
patrick@73
    28
   document
patrick@73
    29
 | top.quiz
patrick@73
    30
patrick@73
    31
patrick@73
    32
# =============================================================================
patrick@73
    33
#                                  TOP LEVEL
patrick@73
    34
# =============================================================================
patrick@73
    35
Patrick@310
    36
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ top.quiz ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
    37
patrick@128
    38
top.quiz = element quiz { top.quiz.attributes, top.quiz.content }
patrick@73
    39
patrick@73
    40
top.quiz.attributes =
Patrick@388
    41
   quiz.id.attribute?
Patrick@158
    42
 & quiz.type.attribute?
patrick@73
    43
 & lang.attribute?
patrick@117
    44
quiz.id.attribute = attribute id { xsd:NMTOKEN }
Patrick@158
    45
quiz.type.attribute = attribute type { xsd:NCName }
patrick@73
    46
patrick@128
    47
top.quiz.content =
patrick@128
    48
   top.head?,
claire@345
    49
   instructions?,
patrick@128
    50
   (engine | composite),
patrick@128
    51
   help?,
patrick@128
    52
   answer?
patrick@73
    53
Patrick@310
    54
patrick@73
    55
# =============================================================================
Patrick@310
    56
#                                COMPONENT LEVEL
patrick@73
    57
# =============================================================================
patrick@73
    58
patrick@73
    59
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ quiz ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
    60
patrick@73
    61
quiz = element quiz { quiz.attributes, quiz.content }
patrick@73
    62
patrick@73
    63
quiz.attributes =
Patrick@310
    64
   (quiz.id.attribute | xmlid.attribute)?
Patrick@158
    65
 & quiz.type.attribute?
patrick@73
    66
 & lang.attribute?
patrick@73
    67
patrick@73
    68
quiz.content =
patrick@73
    69
   component.head?,
Patrick@417
    70
   instructions?,
patrick@87
    71
   (engine | composite),
patrick@73
    72
   help?,
patrick@87
    73
   answer?
patrick@73
    74
patrick@73
    75
patrick@73
    76
# =============================================================================
patrick@73
    77
#                                 SECTION LEVEL
patrick@73
    78
# =============================================================================
patrick@73
    79
patrick@73
    80
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
    81
patrick@73
    82
blanks.section = element section { section.attributes, blanks.section.content }
Coraline@409
    83
blanks-m.section = element section {
Coraline@409
    84
   section.attributes, blanks-m.section.content }
Coraline@441
    85
blanks-c.section = element section {
Coraline@441
    86
   section.attributes, blanks-c.section.content }
Coraline@442
    87
correct.section = element section {
Coraline@442
    88
   section.attributes, correct.section.content }
Patrick@336
    89
pointing.section = element section {
Patrick@336
    90
   section.attributes, pointing.section.content }
patrick@73
    91
patrick@73
    92
blanks.section.content =
patrick@73
    93
   section.head?,
patrick@73
    94
   (blanks.section+ | blanks.block+)
Coraline@409
    95
blanks-m.section.content =
Coraline@409
    96
   section.head?,
Coraline@409
    97
   (blanks-m.section+ | blanks-m.block+)
Coraline@441
    98
blanks-c.section.content =
Coraline@441
    99
   section.head?,
Coraline@441
   100
   (blanks-c.section+ | blanks-c.block+)
Coraline@442
   101
correct.section.content =
Coraline@442
   102
   section.head?,
Coraline@442
   103
   (correct.section+ | correct.block+)
Patrick@336
   104
pointing.section.content =
patrick@73
   105
   section.head?,
Patrick@336
   106
   (pointing.section+ | pointing.block+)
patrick@73
   107
patrick@73
   108
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ instructions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   109
patrick@73
   110
instructions = element instructions { section.content }
patrick@73
   111
patrick@73
   112
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ engine ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   113
patrick@73
   114
engine =
patrick@87
   115
   choices-radio
patrick@87
   116
 | choices-check
patrick@87
   117
 | blanks-fill
patrick@87
   118
 | blanks-select
Coraline@409
   119
 | blanks-media
Coraline@441
   120
 | blanks-choices
Coraline@442
   121
 | correct-line
Patrick@336
   122
 | pointing
Patrick@336
   123
 | pointing-categories
patrick@73
   124
 | matching
patrick@73
   125
 | sort
patrick@125
   126
 | categories
Coraline@438
   127
 | wordsearch
Patrick@448
   128
 | flashcard
Patrick@450
   129
 | coloring
Patrick@450
   130
 | memory
iinov@463
   131
 | dictation
patrick@87
   132
 | production
patrick@73
   133
patrick@73
   134
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ choices ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   135
patrick@87
   136
choices-radio = element choices-radio {
Patrick@376
   137
   choices-radio.attributes, choices-radio.content }
patrick@87
   138
choices-check = element choices-check {
Patrick@376
   139
   choices-check.attributes, choices-check.content }
patrick@73
   140
Patrick@376
   141
choices-radio.attributes =
patrick@73
   142
   shuffle.attribute?
Patrick@376
   143
choices-check.attributes =
Patrick@376
   144
   success.attribute?
Patrick@376
   145
 & shuffle.attribute?
Patrick@376
   146
success.attribute = attribute success { xsd:decimal {maxInclusive="1"} }
patrick@73
   147
shuffle.attribute = attribute shuffle { xsd:boolean }
patrick@73
   148
patrick@87
   149
choices-radio.content =
patrick@73
   150
   choices.right
patrick@73
   151
 & choices.wrong+
patrick@87
   152
choices-check.content =
patrick@73
   153
   (choices.right | choices.wrong)+
patrick@73
   154
patrick@73
   155
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blanks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   156
patrick@87
   157
blanks-fill = element blanks-fill {
patrick@87
   158
   blanks-fill.attributes, blanks-fill.content }
patrick@87
   159
blanks-select = element blanks-select {
patrick@87
   160
   blanks-select.attributes, blanks-select.content }
Coraline@409
   161
blanks-media = element blanks-media {
Coraline@409
   162
   blanks-select.attributes, blanks-media.content }
Coraline@441
   163
blanks-choices = element blanks-choices {
Coraline@441
   164
   blanks-choices.content }
patrick@73
   165
patrick@87
   166
blanks-fill.attributes =
Patrick@376
   167
   success.attribute?
Patrick@376
   168
 & strict.attribute?
claire@381
   169
 & long.attribute?
patrick@87
   170
blanks-select.attributes =
Patrick@376
   171
   success.attribute?
Patrick@376
   172
 & multiple.attribute?
claire@380
   173
 & noshuffle.attribute?
Coraline@409
   174
 & orientation.attribute?
patrick@73
   175
strict.attribute = attribute strict { xsd:boolean }
patrick@73
   176
multiple.attribute = attribute multiple { xsd:boolean }
Coraline@437
   177
noshuffle.attribute = attribute no-shuffle { "true" | "false" | "alpha" }
claire@381
   178
long.attribute = attribute long { xsd:positiveInteger }
Coraline@409
   179
orientation.attribute = attribute orientation {"north"|"east"|"west"|"south"}
patrick@73
   180
patrick@87
   181
blanks-fill.content =
patrick@73
   182
   (blanks.block+ | blanks.section+)
patrick@87
   183
blanks-select.content =
Patrick@342
   184
   blanks.intruders?,
patrick@73
   185
   (blanks.block+ | blanks.section+)
Coraline@409
   186
blanks-media.content =
Coraline@409
   187
   blanks-m.intruders?,
Coraline@409
   188
   (blanks-m.block+ | blanks-m.section+)
Coraline@441
   189
blanks-choices.content =
Coraline@441
   190
   (blanks-c.block+ | blanks-c.section+)
patrick@73
   191
Coraline@442
   192
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ correct-line ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@448
   193
Patrick@448
   194
correct-line = element correct-line { correct.attributes, correct.content }
Coraline@442
   195
Patrick@450
   196
correct.attributes =
Coraline@402
   197
   remove-space.attribute?
Coraline@402
   198
remove-space.attribute = attribute remove-space { xsd:boolean }
Coraline@402
   199
Coraline@442
   200
correct.content =
Coraline@442
   201
   correct.intruders?,
Coraline@442
   202
   (correct.block+ | correct.section+)
Coraline@442
   203
Patrick@336
   204
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pointing ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   205
Patrick@336
   206
pointing = element pointing { pointing.attributes, pointing.content }
patrick@75
   207
Patrick@336
   208
pointing.attributes =
Patrick@376
   209
   success.attribute?
Patrick@376
   210
 & pointing.type.attribute?
Patrick@336
   211
pointing.type.attribute = attribute type { "radio" | "check" }
patrick@73
   212
Patrick@336
   213
pointing.content =
Patrick@336
   214
   (pointing.section+ | pointing.block+)
Patrick@336
   215
Patrick@336
   216
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pointing-categories ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@336
   217
Patrick@336
   218
# ~~~~~~ pointing-categories
Patrick@376
   219
pointing-categories = element pointing-categories {
Patrick@376
   220
   pointing-c.attributes, pointing-c.content }
Patrick@376
   221
Patrick@376
   222
pointing-c.attributes =
Patrick@376
   223
   success.attribute?
Patrick@336
   224
Patrick@336
   225
pointing-c.content =
Patrick@336
   226
   pointing-c.categories,
Patrick@336
   227
   pointing.section
Patrick@336
   228
Patrick@336
   229
# ~~~~~~ pointing-c.categories
Patrick@336
   230
pointing-c.categories = element categories { pointing-c.categories.content }
Patrick@336
   231
Patrick@336
   232
pointing-c.categories.content =
Patrick@336
   233
   pointing-c.category1,
Patrick@336
   234
   pointing-c.category2,
Patrick@336
   235
   (pointing-c.category3,
Patrick@336
   236
      (pointing-c.category4, pointing-c.category5?)?)?
Patrick@336
   237
Patrick@336
   238
# ~~~~~~ pointing-c.categoryN
Patrick@336
   239
pointing-c.category1 = element category {
Patrick@336
   240
   attribute id { "1" }, pointing-c.category.content }
Patrick@336
   241
pointing-c.category2 = element category {
Patrick@336
   242
   attribute id { "2" }, pointing-c.category.content }
Patrick@336
   243
pointing-c.category3 = element category {
Patrick@336
   244
   attribute id { "3" }, pointing-c.category.content }
Patrick@336
   245
pointing-c.category4 = element category {
Patrick@336
   246
   attribute id { "4" }, pointing-c.category.content }
Patrick@336
   247
pointing-c.category5 = element category {
Patrick@336
   248
   attribute id { "5" }, pointing-c.category.content }
Patrick@336
   249
Patrick@336
   250
pointing-c.category.content = inlines
Patrick@336
   251
patrick@73
   252
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ matching ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   253
Patrick@161
   254
# ~~~~~~ matching
Patrick@169
   255
matching = element matching { matching.attributes, matching.content }
Patrick@169
   256
Patrick@169
   257
matching.attributes =
Patrick@376
   258
   success.attribute?
Patrick@376
   259
 & multiple.attribute?
Coraline@438
   260
 & noshuffle.attribute?
Coraline@409
   261
 & orientation.attribute?
patrick@75
   262
patrick@73
   263
matching.content =
Patrick@359
   264
   matching.intruders?,
patrick@73
   265
   match,
patrick@73
   266
   match+
patrick@73
   267
Patrick@161
   268
# ~~~~~~ match
Patrick@161
   269
match = element match { match.content }
Patrick@161
   270
Patrick@161
   271
match.content =
Patrick@161
   272
   match.item,
Patrick@161
   273
   match.item
Patrick@161
   274
patrick@73
   275
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sort ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   276
patrick@73
   277
sort = element sort { sort.attributes, sort.content }
patrick@73
   278
patrick@73
   279
sort.attributes =
Patrick@376
   280
   success.attribute?
Patrick@376
   281
 & shuffle.attribute?
Coraline@409
   282
 & orientation.attribute?
patrick@75
   283
patrick@73
   284
sort.content =
iinov@462
   285
    sort.intruders?,
iinov@461
   286
    comparison?,
iinov@461
   287
    sort.item,
iinov@461
   288
    sort.item+
patrick@73
   289
patrick@125
   290
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ categories ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@125
   291
Patrick@310
   292
# ~~~~~~ category.head
Patrick@310
   293
category.head = element head { category.head.content }
Patrick@310
   294
Patrick@310
   295
category.head.content =
Patrick@384
   296
   title
Patrick@384
   297
 & shorttitle?
Patrick@384
   298
 & subtitle*
Patrick@310
   299
patrick@125
   300
# ~~~~~~ categories
Patrick@168
   301
categories = element categories { categories.attributes, categories.content }
patrick@125
   302
Patrick@168
   303
categories.attributes =
Patrick@376
   304
   success.attribute?
Patrick@376
   305
 & multiple.attribute?
claire@380
   306
 & noshuffle.attribute?
Coraline@409
   307
 & orientation.attribute?
Patrick@310
   308
patrick@125
   309
categories.content =
Patrick@344
   310
   categories.intruders?,
patrick@125
   311
   category,
patrick@125
   312
   category+
patrick@125
   313
patrick@125
   314
# ~~~~~~ category
patrick@125
   315
category = element category { category.content }
patrick@125
   316
patrick@125
   317
category.content =
patrick@125
   318
   category.head,
patrick@125
   319
   category.item*
patrick@125
   320
Coraline@438
   321
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ wordsearch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@448
   322
Coraline@438
   323
wordsearch = element wordsearch {wordsearch.attributes, wordsearch.content }
Coraline@438
   324
Coraline@438
   325
wordsearch.attributes =
Coraline@438
   326
   strict.attribute ?
Coraline@438
   327
 & wordlist.attribute ?
Coraline@438
   328
Coraline@438
   329
wordlist.attribute = attribute wordlist { "hidden" | "right" | "left" }
Coraline@438
   330
Coraline@438
   331
wordsearch.content =
Coraline@438
   332
   words
Coraline@438
   333
 & grid
Coraline@438
   334
Coraline@438
   335
# ~~~~~~ words
Coraline@438
   336
words = element words {words.content}
Coraline@438
   337
words.content = words.item+
Coraline@438
   338
Coraline@438
   339
# ~~~~~~ grid
Coraline@438
   340
grid = element grid {grid.content}
Coraline@438
   341
grid.content = line+
Coraline@438
   342
Coraline@438
   343
line = element line {line.content}
Coraline@438
   344
line.content = cell+
Coraline@438
   345
Coraline@438
   346
cell = element cell {cell.content}
Coraline@438
   347
cell.content = xsd:token {pattern = "."}
Patrick@450
   348
Patrick@448
   349
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ flashcard ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@448
   350
Patrick@448
   351
# ~~~~~~ flashcard
Patrick@448
   352
flashcard = element flashcard { flashcard.content }
Patrick@448
   353
Patrick@448
   354
flashcard.content =
Patrick@448
   355
   side1,
Patrick@448
   356
   side2
Patrick@448
   357
Patrick@448
   358
# ~~~~~~ side1
Patrick@448
   359
side1 = element side1 { side1.content }
Patrick@448
   360
Patrick@448
   361
side1.content =
Patrick@448
   362
    section+ | block+
Patrick@448
   363
Patrick@448
   364
# ~~~~~~ side2
Patrick@448
   365
side2 = element side2 { side2.content }
Patrick@448
   366
Patrick@448
   367
side2.content =
Patrick@448
   368
    instructions?,
Patrick@448
   369
    flashcard.engine,
Patrick@448
   370
    help?,
Patrick@448
   371
    answer?
Patrick@448
   372
Patrick@448
   373
# ~~~~~~ flashcard.engine
Patrick@448
   374
flashcard.engine =
Patrick@448
   375
    choices-radio
Patrick@448
   376
    | choices-check
Patrick@448
   377
    | blanks-fill
Patrick@448
   378
    | blanks-select
Patrick@448
   379
    | sort
Patrick@448
   380
Patrick@450
   381
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ coloring ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@450
   382
Patrick@450
   383
coloring = element coloring { coloring.attributes, coloring.content }
Patrick@450
   384
Patrick@450
   385
coloring.attributes =
Patrick@450
   386
    nomark.attribute?
Patrick@450
   387
nomark.attribute = attribute nomark { xsd:boolean }
Patrick@450
   388
Patrick@450
   389
coloring.content =
Patrick@450
   390
    palette
Patrick@450
   391
  & canvas
Patrick@450
   392
  & areas?
Patrick@450
   393
Patrick@450
   394
# ~~~~~~ palette
Patrick@450
   395
palette = element palette { palette.content }
Patrick@450
   396
Patrick@450
   397
palette.content =
Patrick@450
   398
    color+
Patrick@450
   399
Patrick@450
   400
# ~~~~~~ canvas
Patrick@450
   401
canvas = element canvas { canvas.attributes }
Patrick@450
   402
Patrick@450
   403
canvas.attributes =
Patrick@450
   404
    media.id.attribute
Patrick@450
   405
Patrick@450
   406
# ~~~~~~ areas
Patrick@450
   407
areas = element areas { areas.attributes }
Patrick@450
   408
Patrick@450
   409
areas.attributes =
Patrick@450
   410
    media.id.attribute
Patrick@450
   411
Patrick@450
   412
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ memory ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@450
   413
Patrick@450
   414
# ~~~~~~ memory
Patrick@450
   415
memory = element memory { memory.attributes, memory.content }
Patrick@450
   416
Patrick@450
   417
memory.attributes =
Patrick@450
   418
    display.attribute?
Patrick@450
   419
    & delay.attribute?
Patrick@450
   420
display.attribute = attribute display { xsd:positiveInteger }
Patrick@450
   421
delay.attribute = attribute delay { xsd:positiveInteger }
Patrick@450
   422
Patrick@450
   423
memory.content =
Patrick@450
   424
   memory.match,
Patrick@450
   425
   memory.match+
Patrick@450
   426
Patrick@450
   427
# ~~~~~~ memory.match
Patrick@450
   428
memory.match = element match { memory-m.content }
Patrick@450
   429
Patrick@450
   430
memory-m.content =
Patrick@450
   431
    memory-m.item,
Patrick@450
   432
    memory-m.item,
Patrick@450
   433
    audio?
Patrick@450
   434
iinov@463
   435
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ dictation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
iinov@463
   436
iinov@465
   437
dictation = element dictation { dictation.attributes, dictation.content }
iinov@465
   438
iinov@465
   439
dictation.attributes =
iinov@465
   440
    case_insensitive.attribute?
iinov@465
   441
case_insensitive.attribute = attribute case-insensitive { xsd:boolean }
iinov@463
   442
iinov@463
   443
dictation.content =
iinov@463
   444
    audio,
iinov@465
   445
    dictation.p
iinov@463
   446
patrick@87
   447
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ production ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@87
   448
Coraline@407
   449
production = element production { production.content }
Coraline@407
   450
Coraline@407
   451
production.content = text
patrick@87
   452
patrick@73
   453
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ composite ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   454
patrick@77
   455
# ~~~~~~ composite
Patrick@161
   456
composite = element composite { composite.attributes, composite.content }
Patrick@161
   457
Patrick@161
   458
composite.attributes =
Patrick@376
   459
   success.attribute?
Patrick@376
   460
 & multipage.attribute?
Patrick@310
   461
multipage.attribute = attribute multipage { xsd:boolean }
patrick@75
   462
patrick@73
   463
composite.content =
patrick@85
   464
   subquiz,
Patrick@154
   465
   subquiz+
patrick@77
   466
patrick@85
   467
# ~~~~~~ subquiz
patrick@85
   468
subquiz = element subquiz { subquiz.content }
patrick@77
   469
patrick@85
   470
subquiz.content =
patrick@77
   471
   instructions?,
Patrick@141
   472
   engine,
Patrick@141
   473
   help?,
Patrick@141
   474
   answer?
patrick@73
   475
patrick@73
   476
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ help ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   477
patrick@73
   478
help = element help { help.content }
patrick@73
   479
patrick@73
   480
help.content =
patrick@73
   481
   (section+ | block+)?,
patrick@73
   482
   link*
patrick@73
   483
patrick@87
   484
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ answer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   485
patrick@87
   486
answer = element answer { answer.content }
patrick@73
   487
patrick@87
   488
answer.content =
patrick@81
   489
   (section+ | block+)?,
patrick@80
   490
   link*
patrick@73
   491
patrick@73
   492
patrick@73
   493
# =============================================================================
patrick@73
   494
#                                 BLOCK LEVEL
patrick@73
   495
# =============================================================================
patrick@73
   496
patrick@73
   497
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   498
Patrick@313
   499
blanks.block = (
Patrick@313
   500
   blanks.p | blanks.list | blanks.blockquote | blanks.speech | blanks.table
Patrick@313
   501
 | blanks.media)
Coraline@409
   502
blanks-m.block = (
Coraline@409
   503
   blanks-m.p | blanks-m.list | blanks-m.blockquote | blanks-m.speech
Coraline@409
   504
 | blanks-m.table | blanks-m.media)
Coraline@441
   505
blanks-c.block = (
Coraline@441
   506
   blanks-c.p | blanks-c.list | blanks-c.blockquote | blanks-c.speech
Coraline@441
   507
 | blanks-c.table | blanks-c.media)
Coraline@442
   508
correct.block = (
Coraline@442
   509
   correct.p | correct.list | correct.blockquote | correct.speech
Coraline@442
   510
 | correct.table | media)
Patrick@336
   511
pointing.block = (
Patrick@336
   512
   pointing.p | pointing.list | pointing.blockquote | pointing.speech
Patrick@336
   513
 | pointing.table | media)
patrick@73
   514
patrick@73
   515
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   516
patrick@73
   517
blanks.p = element p { blanks.p.content }
Coraline@409
   518
blanks-m.p = element p { blanks-m.p.content }
Coraline@441
   519
blanks-c.p = element p { blanks-c.p.content }
Coraline@442
   520
correct.p = element p { correct.p.content }
Patrick@336
   521
pointing.p = element p { pointing.p.content }
iinov@463
   522
dictation.p = element p { dictation.p.content }
patrick@73
   523
patrick@73
   524
blanks.p.content =
iinov@463
   525
    blanks.inlines
Coraline@409
   526
blanks-m.p.content =
iinov@463
   527
    blanks-m.inlines
Coraline@441
   528
blanks-c.p.content =
iinov@463
   529
    blanks-c.inlines
Coraline@442
   530
correct.p.content =
iinov@463
   531
    correct.inlines
Patrick@336
   532
pointing.p.content =
iinov@463
   533
    pointing.inlines
iinov@463
   534
dictation.p.content =
iinov@463
   535
    dictation.inlines
patrick@73
   536
patrick@73
   537
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   538
patrick@73
   539
# ~~~~~~ list
patrick@75
   540
blanks.list = element list {
patrick@73
   541
   block.head?,
patrick@73
   542
   (  (attribute type {"ordered"}?, blanks.item, blanks.item+)
Coraline@422
   543
    | (attribute type {"glossary"}, item.glossary+) )
patrick@75
   544
}
Coraline@409
   545
blanks-m.list = element list {
Coraline@409
   546
   block.head?,
Coraline@441
   547
   (  (attribute type {"ordered"}?, blanks-m.item, blanks-m.item+)
Coraline@441
   548
    | (attribute type {"glossary"}, item.glossary+) )
Coraline@441
   549
}
Coraline@441
   550
blanks-c.list = element list {
Coraline@441
   551
   block.head?,
Coraline@409
   552
   (  (attribute type {"ordered"}?, blanks.item, blanks.item+)
Coraline@422
   553
    | (attribute type {"glossary"}, item.glossary+) )
Coraline@409
   554
}
Coraline@442
   555
correct.list = element list {
Coraline@442
   556
   block.head?,
Coraline@442
   557
   (  (attribute type {"ordered"}?, correct.item, correct.item+)
Coraline@442
   558
    | (attribute type {"glossary"}, item.glossary+) )
Coraline@442
   559
}
Patrick@336
   560
pointing.list = element list {
patrick@73
   561
   block.head?,
Patrick@336
   562
   (  (attribute type {"ordered"}?, pointing.item, pointing.item+)
Coraline@422
   563
    | (attribute type {"glossary"}, item.glossary+) )
patrick@75
   564
}
patrick@73
   565
patrick@73
   566
# ~~~~~~ item
patrick@73
   567
blanks.item = element item { blanks.item.content }
Coraline@441
   568
blanks-m.item = element item { blanks-m.item.content }
Coraline@441
   569
blanks-c.item = element item { blanks-c.item.content }
Coraline@442
   570
correct.item = element item { correct.item.content }
Patrick@336
   571
pointing.item = element item { pointing.item.content }
Patrick@450
   572
patrick@73
   573
Coraline@442
   574
blanks.item.content = blanks.inlines | blanks.block+
Coraline@442
   575
blanks-m.item.content = blanks-m.inlines | blanks-m.block+
Coraline@442
   576
blanks-c.item.content = blanks-c.inlines | blanks-c.block+
Coraline@442
   577
correct.item.content = correct.inlines | correct.block+
Coraline@442
   578
pointing.item.content = pointing.inlines | pointing.block+
patrick@73
   579
Patrick@313
   580
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blockquote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@313
   581
Patrick@313
   582
blanks.blockquote = element blockquote {
Patrick@313
   583
   blockquote.attributes, blanks.blockquote.content }
Coraline@409
   584
blanks-m.blockquote = element blockquote {
Coraline@409
   585
   blockquote.attributes, blanks-m.blockquote.content }
Coraline@441
   586
blanks-c.blockquote = element blockquote {
Coraline@441
   587
   blockquote.attributes, blanks-c.blockquote.content }
Coraline@442
   588
correct.blockquote = element blockquote {
Coraline@442
   589
   blockquote.attributes, correct.blockquote.content }
Patrick@336
   590
pointing.blockquote = element blockquote {
Patrick@336
   591
   blockquote.attributes, pointing.blockquote.content }
Patrick@313
   592
Patrick@313
   593
blanks.blockquote.content =
Patrick@313
   594
   block.head?,
Patrick@313
   595
   (blanks.p | speech | blanks.list)+,
Patrick@313
   596
   attribution?
Coraline@409
   597
blanks-m.blockquote.content =
Coraline@409
   598
   block.head?,
Coraline@409
   599
   (blanks-m.p | speech | blanks-m.list)+,
Coraline@409
   600
   attribution?
Coraline@441
   601
blanks-c.blockquote.content =
Coraline@441
   602
   block.head?,
Coraline@441
   603
   (blanks-c.p | speech | blanks-c.list)+,
Coraline@441
   604
   attribution?
Coraline@442
   605
correct.blockquote.content =
Coraline@442
   606
   block.head?,
Coraline@442
   607
   (correct.p | speech | correct.list)+,
Coraline@442
   608
   attribution?
Patrick@336
   609
pointing.blockquote.content =
Patrick@313
   610
   block.head?,
Patrick@336
   611
   (pointing.p | speech | pointing.list)+,
Patrick@313
   612
   attribution?
Patrick@313
   613
Patrick@313
   614
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@313
   615
Patrick@313
   616
# ~~~~~~ speech
Patrick@313
   617
blanks.speech = element speech { blanks.speech.content }
Coraline@409
   618
blanks-m.speech = element speech { blanks-m.speech.content }
Coraline@441
   619
blanks-c.speech = element speech { blanks-c.speech.content }
Coraline@442
   620
correct.speech = element speech { correct.speech.content }
Patrick@336
   621
pointing.speech = element speech { pointing.speech.content }
Patrick@313
   622
Patrick@313
   623
blanks.speech.content =
Patrick@313
   624
   blanks.speaker?,
Patrick@313
   625
   stage?,
Patrick@313
   626
   (blanks.p | blanks.blockquote)+
Coraline@409
   627
blanks-m.speech.content =
Coraline@409
   628
   blanks-m.speaker?,
Coraline@409
   629
   stage?,
Coraline@409
   630
   (blanks-m.p | blanks-m.blockquote)+
Coraline@441
   631
blanks-c.speech.content =
Coraline@441
   632
   blanks-c.speaker?,
Coraline@441
   633
   stage?,
Coraline@441
   634
   (blanks-c.p | blanks-c.blockquote)+
Coraline@442
   635
correct.speech.content =
Coraline@442
   636
   correct.speaker?,
Coraline@442
   637
   stage?,
Coraline@442
   638
   (correct.p | correct.blockquote)+
Patrick@336
   639
pointing.speech.content =
Patrick@336
   640
   pointing.speaker?,
Patrick@313
   641
   stage?,
Patrick@336
   642
   (pointing.p | pointing.blockquote)+
Patrick@313
   643
Patrick@313
   644
# ~~~~~~ speaker
Patrick@313
   645
blanks.speaker = element speaker { blanks.speaker.content }
Coraline@409
   646
blanks-m.speaker = element speaker { blanks-m.speaker.content }
Coraline@441
   647
blanks-c.speaker = element speaker { blanks-c.speaker.content }
Coraline@442
   648
correct.speaker = element speaker { correct.speaker.content }
Patrick@336
   649
pointing.speaker = element speaker { pointing.speaker.content }
Patrick@313
   650
Patrick@313
   651
blanks.speaker.content = blanks.inlines
Coraline@409
   652
blanks-m.speaker.content = blanks-m.inlines
Coraline@441
   653
blanks-c.speaker.content = blanks-c.inlines
Coraline@442
   654
correct.speaker.content = correct.inlines
Patrick@336
   655
pointing.speaker.content = pointing.inlines
Patrick@313
   656
patrick@73
   657
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   658
Patrick@313
   659
# ~~~~~~ table
patrick@249
   660
blanks.table = element table { table.attributes, blanks.table.content }
Coraline@409
   661
blanks-m.table = element table { table.attributes, blanks-m.table.content }
Coraline@441
   662
blanks-c.table = element table { table.attributes, blanks-m.table.content }
Coraline@442
   663
correct.table = element table { table.attributes, correct.table.content }
Patrick@336
   664
pointing.table = element table { table.attributes, pointing.table.content }
patrick@73
   665
patrick@73
   666
blanks.table.content =
patrick@73
   667
   block.head?,
Patrick@358
   668
   ((thead?, blanks.tbody+) | blanks.tr+),
Patrick@313
   669
   blanks.table.caption?
Coraline@409
   670
blanks-m.table.content =
Coraline@409
   671
   block.head?,
Coraline@409
   672
   ((thead?, blanks-m.tbody+) | blanks-m.tr+),
Coraline@409
   673
   blanks-m.table.caption?
Coraline@441
   674
blanks-c.table.content =
Coraline@441
   675
   block.head?,
Coraline@441
   676
   ((thead?, blanks-c.tbody+) | blanks-c.tr+),
Coraline@441
   677
   blanks-c.table.caption?
Coraline@442
   678
correct.table.content =
Coraline@442
   679
   block.head?,
Coraline@442
   680
   ((thead?, correct.tbody+) | correct.tr+),
Coraline@442
   681
   correct.table.caption?
Patrick@336
   682
pointing.table.content =
patrick@73
   683
   block.head?,
Patrick@358
   684
   ((thead?, pointing.tbody+) | pointing.tr+),
Patrick@336
   685
   pointing.table.caption?
patrick@73
   686
patrick@73
   687
# ~~~~~~ tbody
patrick@249
   688
blanks.tbody = element tbody { blanks.tbody.content }
Coraline@409
   689
blanks-m.tbody = element tbody { blanks-m.tbody.content }
Coraline@441
   690
blanks-c.tbody = element tbody { blanks-m.tbody.content }
Coraline@442
   691
correct.tbody = element tbody { correct.tbody.content }
Patrick@336
   692
pointing.tbody = element tbody { pointing.tbody.content }
patrick@73
   693
patrick@73
   694
blanks.tbody.content =
patrick@249
   695
   blanks.tr+
Coraline@409
   696
blanks-m.tbody.content =
Coraline@409
   697
   blanks-m.tr+
Coraline@441
   698
blanks-c.tbody.content =
Coraline@441
   699
   blanks-c.tr+
Coraline@442
   700
correct.tbody.content =
Coraline@442
   701
   correct.tr+
Patrick@336
   702
pointing.tbody.content =
Patrick@336
   703
   pointing.tr+
patrick@73
   704
patrick@249
   705
# ~~~~~~ tr
patrick@249
   706
blanks.tr = element tr { tr.attributes, blanks.tr.content }
Coraline@409
   707
blanks-m.tr = element tr { tr.attributes, blanks-m.tr.content }
Coraline@441
   708
blanks-c.tr = element tr { tr.attributes, blanks-c.tr.content }
Coraline@442
   709
correct.tr = element tr { tr.attributes, correct.tr.content }
Patrick@336
   710
pointing.tr = element tr { tr.attributes, pointing.tr.content }
patrick@73
   711
patrick@249
   712
blanks.tr.content =
patrick@249
   713
  (blanks.td | blanks.th)+
Coraline@409
   714
blanks-m.tr.content =
Coraline@409
   715
  (blanks-m.td | blanks-m.th)+
Coraline@441
   716
blanks-c.tr.content =
Coraline@441
   717
  (blanks-c.td | blanks-c.th)+
Coraline@442
   718
correct.tr.content =
Coraline@442
   719
  (correct.td | correct.th)+
Patrick@336
   720
pointing.tr.content =
Patrick@336
   721
  (pointing.td | pointing.th)+
patrick@73
   722
patrick@249
   723
# ~~~~~~ td, th
patrick@249
   724
blanks.td = element td { td.attributes, blanks.td.content }
patrick@249
   725
blanks.th = element th { td.attributes, blanks.td.content }
Coraline@409
   726
blanks-m.td = element td { td.attributes, blanks-m.td.content }
Coraline@409
   727
blanks-m.th = element th { td.attributes, blanks-m.td.content }
Coraline@441
   728
blanks-c.td = element td { td.attributes, blanks-c.td.content }
Coraline@441
   729
blanks-c.th = element th { td.attributes, blanks-c.td.content }
Coraline@442
   730
correct.td = element td { td.attributes, correct.td.content }
Coraline@442
   731
correct.th = element th { td.attributes, correct.td.content }
Patrick@336
   732
pointing.td = element td { td.attributes, pointing.td.content }
Patrick@336
   733
pointing.th = element th { td.attributes, pointing.td.content }
patrick@73
   734
patrick@249
   735
blanks.td.content =
patrick@75
   736
   blanks.inlines
Patrick@313
   737
 | (blanks.p | blanks.media)+
Coraline@409
   738
blanks-m.td.content =
Coraline@409
   739
   blanks-m.inlines
Coraline@409
   740
 | (blanks-m.p | blanks-m.media)+
Coraline@441
   741
blanks-c.td.content =
Coraline@441
   742
   blanks-c.inlines
Coraline@441
   743
 | (blanks-c.p | blanks-c.media)+
Coraline@442
   744
correct.td.content =
Coraline@442
   745
   correct.inlines
Coraline@442
   746
 | (correct.p | media)+
Patrick@336
   747
pointing.td.content =
Patrick@336
   748
   pointing.inlines
Patrick@336
   749
 | (pointing.p | media)+
Patrick@313
   750
Patrick@313
   751
# ~~~~~~ table.caption
Patrick@313
   752
blanks.table.caption = element caption { blanks.caption.content }
Coraline@409
   753
blanks-m.table.caption = element caption { blanks-m.caption.content }
Coraline@441
   754
blanks-c.table.caption = element caption { blanks-c.caption.content }
Coraline@442
   755
correct.table.caption = element caption { correct.caption.content }
Patrick@336
   756
pointing.table.caption = element caption { pointing.caption.content }
Patrick@313
   757
Patrick@313
   758
blanks.caption.content =
Patrick@313
   759
   blanks.inlines
Patrick@313
   760
 | (blanks.p | speech | blanks.list | blockquote)+
Coraline@409
   761
blanks-m.caption.content =
Coraline@409
   762
   blanks-m.inlines
Coraline@409
   763
 | (blanks-m.p | speech | blanks-m.list | blockquote)+
Coraline@441
   764
blanks-c.caption.content =
Coraline@441
   765
   blanks-c.inlines
Coraline@441
   766
 | (blanks-c.p | speech | blanks-c.list | blockquote)+
Coraline@442
   767
correct.caption.content =
Coraline@442
   768
   correct.inlines
Coraline@442
   769
 | (correct.p | speech | correct.list | blockquote)+
Patrick@336
   770
pointing.caption.content =
Patrick@336
   771
   pointing.inlines
Patrick@336
   772
 | (pointing.p | speech | pointing.list | blockquote)+
patrick@73
   773
Patrick@174
   774
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@174
   775
Patrick@313
   776
# ~~~~~~ media
Patrick@313
   777
blanks.media = element media { media.attributes, blanks.media.content }
Coraline@409
   778
blanks-m.media = element media { media.attributes, blanks-m.media.content }
Coraline@441
   779
blanks-c.media = element media { media.attributes, blanks-c.media.content }
Coraline@442
   780
correct.media = element media { media.attributes, correct.media.content }
Patrick@336
   781
pointing.media = element media { media.attributes, pointing.media.content }
Patrick@174
   782
Patrick@313
   783
blanks.media.content =
Patrick@174
   784
   block.head?,
Patrick@174
   785
   (blanks.image | audio | video)+,
Patrick@313
   786
   blanks.media.caption?,
Patrick@313
   787
   link?
Coraline@409
   788
blanks-m.media.content =
Coraline@409
   789
   block.head?,
Coraline@409
   790
   (blanks-m.image | audio | video)+,
Coraline@409
   791
   blanks-m.media.caption?,
Coraline@409
   792
   link?
Coraline@441
   793
blanks-c.media.content =
Coraline@441
   794
   block.head?,
Coraline@441
   795
   (image | audio | video)+,
Coraline@441
   796
   blanks-c.media.caption?,
Coraline@441
   797
   link?
Coraline@442
   798
correct.media.content =
Coraline@442
   799
   block.head?,
Coraline@442
   800
   (image | audio | video)+,
Coraline@442
   801
   correct.media.caption?,
Coraline@442
   802
   link?
Patrick@336
   803
pointing.media.content =
Patrick@313
   804
   block.head?,
Patrick@313
   805
   (image | audio | video)+,
Patrick@336
   806
   pointing.media.caption?,
Patrick@174
   807
   link?
Patrick@174
   808
Patrick@174
   809
# ~~~~~~ blanks.image
Patrick@174
   810
blanks.image = element image { image.attributes, blanks.image.content }
Coraline@409
   811
blanks-m.image = element image { image.attributes, blanks-m.image.content }
Patrick@174
   812
Patrick@174
   813
blanks.image.content =
Patrick@174
   814
   copyright?,
Patrick@192
   815
   blanks.dropzone*
Coraline@409
   816
blanks-m.image.content =
Coraline@409
   817
   copyright?,
Coraline@409
   818
   blanks-m.dropzone*
Patrick@174
   819
Patrick@313
   820
# ~~~~~~ dropzone
Patrick@192
   821
blanks.dropzone = element dropzone {
Patrick@192
   822
   blanks.dropzone.attributes, blanks.dropzone.content }
Coraline@409
   823
blanks-m.dropzone = element dropzone {
Patrick@411
   824
   blanks-m.dropzone.attributes, blanks-m.dropzone.content }
Patrick@183
   825
Patrick@192
   826
blanks.dropzone.attributes =
Patrick@183
   827
   x.attribute
Patrick@310
   828
 & y.attribute
Patrick@411
   829
blanks-m.dropzone.attributes =
patrick@194
   830
   x.attribute
patrick@194
   831
 & y.attribute
Coraline@412
   832
 & h.attribute
patrick@194
   833
 & w.attribute
Patrick@174
   834
Patrick@192
   835
blanks.dropzone.content =
Patrick@183
   836
   blank
Coraline@409
   837
blanks-m.dropzone.content =
Coraline@409
   838
   blank-m
Patrick@174
   839
Patrick@313
   840
# ~~~~~~ media.caption
Patrick@313
   841
blanks.media.caption = element caption {
Patrick@313
   842
   caption.attributes, blanks.caption.content }
Coraline@409
   843
blanks-m.media.caption = element caption {
Coraline@409
   844
   caption.attributes, blanks-m.caption.content }
Coraline@441
   845
blanks-c.media.caption = element caption {
Coraline@441
   846
   caption.attributes, blanks-c.caption.content }
Coraline@442
   847
correct.media.caption = element caption {
Coraline@442
   848
   caption.attributes, correct.caption.content }
Patrick@336
   849
pointing.media.caption = element caption {
Patrick@336
   850
   caption.attributes, pointing.caption.content }
Patrick@313
   851
patrick@73
   852
# ~~~~~~~~~~~~~~~~~~~~~~~~ choices.right, choices.wrong ~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   853
patrick@73
   854
choices.right = element right { choices.right.content }
patrick@73
   855
choices.wrong = element wrong { choices.right.content }
patrick@73
   856
patrick@73
   857
choices.right.content =
patrick@73
   858
   inlines
Patrick@161
   859
 | ((p | image | (audio, image?) | video), help?, answer?)
patrick@73
   860
Coraline@409
   861
# ~~~~~~~~~~~~~~~~~~~~ blanks.intruders, blanks-m.intruders  ~~~~~~~~~~~~~~~~~~
patrick@73
   862
Patrick@342
   863
blanks.intruders = element intruders { blanks.intruders.content }
Coraline@409
   864
blanks-m.intruders = element intruders { blanks-m.intruders.content }
patrick@73
   865
Coraline@409
   866
blanks.intruders.content = blank+
Coraline@409
   867
blanks-m.intruders.content = blank-m+
patrick@73
   868
Coraline@442
   869
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ correct.intruders ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Coraline@442
   870
Coraline@442
   871
correct.intruders = element intruders { correct.intruders.content }
Coraline@442
   872
Coraline@442
   873
correct.intruders.content = char+
Coraline@442
   874
Patrick@359
   875
# ~~~~~~~~~~~~~~~~~~~~~~~ matching.intruders, match.item ~~~~~~~~~~~~~~~~~~~~~~
patrick@73
   876
Patrick@359
   877
# ~~~~~~~ matching.intruders
Patrick@359
   878
matching.intruders = element intruders { matching.intruders.content }
Patrick@359
   879
Patrick@359
   880
matching.intruders.content =
Patrick@359
   881
   match.item+
Patrick@359
   882
Patrick@359
   883
# ~~~~~~~ match.item
Patrick@161
   884
match.item = element item { match.item.content }
patrick@73
   885
Patrick@161
   886
match.item.content =
Patrick@161
   887
   inlines
Patrick@341
   888
 | (p, help?, answer?)
patrick@73
   889
iinov@462
   890
# ~~~~~~~~~~~~~~~~~~~~ sort.intruders, comparison, sort.item ~~~~~~~~~~~~~~~~~~
patrick@73
   891
iinov@461
   892
# ~~~~~~~ sort.intruders
iinov@461
   893
sort.intruders = element intruders { sort.intruders.content }
iinov@461
   894
iinov@461
   895
sort.intruders.content =
iinov@461
   896
   sort.item+
iinov@461
   897
iinov@462
   898
# ~~~~~~ comparison
iinov@462
   899
comparison = element comparison { comparison.content }
iinov@462
   900
iinov@462
   901
comparison.content = inlines
iinov@462
   902
patrick@73
   903
# ~~~~~~ sort.item
patrick@73
   904
sort.item = element item { sort.item.attributes, sort.item.content }
patrick@73
   905
patrick@73
   906
sort.item.attributes =
patrick@73
   907
   item.shuffle.attribute?
patrick@73
   908
item.shuffle.attribute = attribute shuffle { xsd:integer }
patrick@73
   909
Patrick@161
   910
sort.item.content =
Patrick@161
   911
   inlines
Patrick@341
   912
 | (p, help?, answer?)
patrick@73
   913
Patrick@344
   914
# ~~~~~~~~~~~~~~~~~~~~~ categories.intruders, category.item ~~~~~~~~~~~~~~~~~~~
patrick@125
   915
Patrick@344
   916
# ~~~~~~ categories.intruders
Patrick@344
   917
categories.intruders = element intruders { categories.intruders.content }
Patrick@342
   918
Patrick@344
   919
categories.intruders.content =
Patrick@342
   920
   category.item+
Patrick@342
   921
Patrick@342
   922
# ~~~~~~ category.item
patrick@125
   923
category.item = element item { category.item.content }
patrick@125
   924
Patrick@161
   925
category.item.content =
Patrick@161
   926
   inlines
Patrick@341
   927
 | (p, help?, answer?)
patrick@125
   928
Coraline@438
   929
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ words.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Coraline@438
   930
words.item = element item {words.item.content, words.item.attributes }
Patrick@450
   931
Coraline@438
   932
words.item.content = inlines
Coraline@438
   933
Coraline@438
   934
words.item.attributes =
Coraline@438
   935
   startx
Coraline@438
   936
 & starty
Coraline@438
   937
 & endx
Coraline@438
   938
 & endy
Coraline@438
   939
Coraline@438
   940
startx = attribute startx {xsd:token {pattern = "[a-zA-Z]+"}}
Coraline@438
   941
starty = attribute starty {xsd:token {pattern = "\d+"}}
Coraline@438
   942
endx = attribute endx {xsd:token {pattern = "[a-zA-Z]+"}}
Coraline@438
   943
endy = attribute endy {xsd:token {pattern = "\d+"}}
Coraline@438
   944
Patrick@450
   945
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ color ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@450
   946
Patrick@450
   947
color = element color { color.attributes }
Patrick@450
   948
Patrick@450
   949
color.attributes =
Patrick@450
   950
    color.code
Patrick@450
   951
    & color.coderef?
Patrick@450
   952
color.code = attribute code {xsd:token { pattern = "#(\d|\w){6}"}}
Patrick@450
   953
color.coderef = attribute coderef { list{xsd:token { pattern = "#(\d|\w){6}"}+}}
Patrick@450
   954
Patrick@450
   955
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ memory-m.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@450
   956
Patrick@450
   957
memory-m.item = element item { memory-m.item.content }
Patrick@450
   958
Patrick@450
   959
memory-m.item.content = image
Patrick@450
   960
patrick@73
   961
patrick@73
   962
# =============================================================================
patrick@73
   963
#                                 INLINE LEVEL
patrick@73
   964
# =============================================================================
patrick@73
   965
patrick@75
   966
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@75
   967
Patrick@293
   968
blanks.inlines = mixed {
Patrick@293
   969
   sup*
Patrick@293
   970
 & sub*
Patrick@293
   971
 & var*
Patrick@293
   972
 & number*
Patrick@293
   973
 & acronym*
Patrick@293
   974
 & warning*
Patrick@293
   975
Patrick@291
   976
 & highlight*
Patrick@291
   977
 & emphasis*
Patrick@291
   978
 & mentioned*
Patrick@350
   979
 & literal*
Patrick@350
   980
 & term*
Patrick@291
   981
 & stage*
Patrick@350
   982
 & name*
Patrick@350
   983
 & foreign*
Patrick@350
   984
 & date*
Patrick@350
   985
 & math*
Patrick@351
   986
 & quote*
Patrick@291
   987
 & initial*
Patrick@291
   988
 & note*
Patrick@291
   989
 & link*
Patrick@291
   990
 & anchor*
Patrick@291
   991
 & index*
Patrick@351
   992
 & image*
Patrick@351
   993
 & audio*
Patrick@351
   994
 & smil*
Coraline@436
   995
 & nowrap*
Patrick@293
   996
patrick@75
   997
 & blank*
Patrick@293
   998
}
Patrick@288
   999
Coraline@409
  1000
blanks-m.inlines = mixed {
Coraline@409
  1001
   sup*
Coraline@409
  1002
 & sub*
Coraline@409
  1003
 & var*
Coraline@409
  1004
 & number*
Coraline@409
  1005
 & acronym*
Coraline@409
  1006
 & warning*
Coraline@409
  1007
Coraline@409
  1008
 & highlight*
Coraline@409
  1009
 & emphasis*
Coraline@409
  1010
 & mentioned*
Coraline@409
  1011
 & literal*
Coraline@409
  1012
 & term*
Coraline@409
  1013
 & stage*
Coraline@409
  1014
 & name*
Coraline@409
  1015
 & foreign*
Coraline@409
  1016
 & date*
Coraline@409
  1017
 & math*
Coraline@409
  1018
 & quote*
Coraline@409
  1019
 & initial*
Coraline@409
  1020
 & note*
Coraline@409
  1021
 & link*
Coraline@409
  1022
 & anchor*
Coraline@409
  1023
 & index*
Coraline@409
  1024
 & image*
Coraline@409
  1025
 & audio*
Coraline@409
  1026
 & smil*
Coraline@436
  1027
 & nowrap*
Coraline@409
  1028
Coraline@409
  1029
 & blank-m*
Coraline@409
  1030
}
Coraline@409
  1031
Coraline@441
  1032
blanks-c.inlines = mixed {
Coraline@441
  1033
   sup*
Coraline@441
  1034
 & sub*
Coraline@441
  1035
 & var*
Coraline@441
  1036
 & number*
Coraline@441
  1037
 & acronym*
Coraline@441
  1038
 & warning*
Coraline@441
  1039
Coraline@441
  1040
 & highlight*
Coraline@441
  1041
 & emphasis*
Coraline@441
  1042
 & mentioned*
Coraline@441
  1043
 & literal*
Coraline@441
  1044
 & term*
Coraline@441
  1045
 & stage*
Coraline@441
  1046
 & name*
Coraline@441
  1047
 & foreign*
Coraline@441
  1048
 & date*
Coraline@441
  1049
 & math*
Coraline@441
  1050
 & quote*
Coraline@441
  1051
 & initial*
Coraline@441
  1052
 & note*
Coraline@441
  1053
 & link*
Coraline@441
  1054
 & anchor*
Coraline@441
  1055
 & index*
Coraline@441
  1056
 & image*
Coraline@441
  1057
 & audio*
Coraline@441
  1058
 & smil*
Coraline@441
  1059
 & nowrap*
Coraline@441
  1060
Coraline@441
  1061
 & blank-c*
Coraline@441
  1062
}
Coraline@441
  1063
Coraline@442
  1064
correct.inlines = mixed {
Coraline@442
  1065
   sup*
Coraline@442
  1066
 & sub*
Coraline@442
  1067
 & var*
Coraline@442
  1068
 & number*
Coraline@442
  1069
 & acronym*
Coraline@442
  1070
 & warning*
Coraline@442
  1071
Coraline@442
  1072
 & highlight*
Coraline@442
  1073
 & emphasis*
Coraline@442
  1074
 & mentioned*
Coraline@442
  1075
 & literal*
Coraline@442
  1076
 & term*
Coraline@442
  1077
 & stage*
Coraline@442
  1078
 & name*
Coraline@442
  1079
 & foreign*
Coraline@442
  1080
 & date*
Coraline@442
  1081
 & math*
Coraline@442
  1082
 & quote*
Coraline@442
  1083
 & initial*
Coraline@442
  1084
 & note*
Coraline@442
  1085
 & link*
Coraline@442
  1086
 & anchor*
Coraline@442
  1087
 & index*
Coraline@442
  1088
 & image*
Coraline@442
  1089
 & audio*
Coraline@442
  1090
 & smil*
Coraline@442
  1091
 & nowrap*
Coraline@442
  1092
Coraline@442
  1093
 & char*
Coraline@442
  1094
}
Coraline@442
  1095
Patrick@336
  1096
pointing.inlines = mixed {
Patrick@293
  1097
   sup*
Patrick@293
  1098
 & sub*
Patrick@293
  1099
 & var*
Patrick@293
  1100
 & number*
Patrick@293
  1101
 & acronym*
Patrick@293
  1102
 & warning*
Patrick@293
  1103
Patrick@291
  1104
 & highlight*
Patrick@291
  1105
 & emphasis*
Patrick@291
  1106
 & mentioned*
Patrick@350
  1107
 & literal*
Patrick@350
  1108
 & term*
Patrick@291
  1109
 & stage*
Patrick@350
  1110
 & name*
Patrick@350
  1111
 & foreign*
Patrick@350
  1112
 & date*
Patrick@350
  1113
 & math*
Patrick@351
  1114
 & quote*
Patrick@291
  1115
 & initial*
Patrick@291
  1116
 & note*
Patrick@291
  1117
 & link*
Patrick@291
  1118
 & anchor*
Patrick@291
  1119
 & index*
Patrick@351
  1120
 & image*
Patrick@351
  1121
 & audio*
Patrick@351
  1122
 & smil*
Coraline@436
  1123
 & nowrap*
Patrick@293
  1124
Patrick@336
  1125
 & point*
Patrick@293
  1126
}
patrick@75
  1127
iinov@463
  1128
dictation.inlines = mixed {
iinov@463
  1129
   warning*
iinov@463
  1130
 & dictation.hint*
iinov@463
  1131
}
iinov@463
  1132
Coraline@441
  1133
# ~~~~~~~~~~~~~~~~~~~~~~~~~~ blank, blank-m, blank-c ~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
  1134
patrick@73
  1135
# ~~~~~~ blank
Patrick@216
  1136
blank = element blank { blank.attributes, blank.content }
Patrick@216
  1137
Patrick@216
  1138
blank.attributes =
claire@381
  1139
   area.attribute?
claire@381
  1140
 & long.attribute?
claire@381
  1141
area.attribute = attribute area { xsd:boolean }
patrick@73
  1142
patrick@73
  1143
blank.content =
patrick@73
  1144
   text
patrick@87
  1145
 | (s+, help?, answer?)
patrick@73
  1146
Coraline@409
  1147
# ~~~~~~ blank-m
Coraline@409
  1148
blank-m = element blank { blank-m.content }
Patrick@411
  1149
blank-m.content =
Patrick@411
  1150
   p
Patrick@411
  1151
 | math
Patrick@411
  1152
 | image
Patrick@411
  1153
 | audio
Patrick@411
  1154
 | (s-m+, help?, answer?)
Patrick@450
  1155
Coraline@441
  1156
# ~~~~~~ blank-c
Coraline@441
  1157
blank-c = element blank { blank-c.attributes, blank-c.content }
Patrick@450
  1158
Coraline@441
  1159
blank-c.attributes = form.attribute?
Coraline@441
  1160
form.attribute = attribute form { 'radio' | 'check' }
Patrick@450
  1161
Coraline@441
  1162
blank-c.content = (blank-c.right | blank-c.wrong)+, help?, answer?
Coraline@441
  1163
blank-c.right = element right { inlines }
Patrick@450
  1164
blank-c.wrong = element wrong { inlines }
Coraline@409
  1165
patrick@73
  1166
# ~~~~~~ s
patrick@73
  1167
s = element s { s.content }
Coraline@409
  1168
s.content = text
patrick@73
  1169
Coraline@409
  1170
# ~~~~~~ s-m
Coraline@409
  1171
s-m = element s { s-m.content }
Patrick@411
  1172
s-m.content =
Patrick@411
  1173
   p
Patrick@411
  1174
 | math
Patrick@411
  1175
 | image
Patrick@411
  1176
 | audio
Patrick@450
  1177
Coraline@442
  1178
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ char ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Coraline@442
  1179
Coraline@442
  1180
char = element char { char.attributes, char.content }
Coraline@442
  1181
Coraline@442
  1182
char.attributes = function.attribute?
Coraline@442
  1183
function.attribute = attribute function { "accent" | "uppercase" }
Coraline@442
  1184
Coraline@442
  1185
char.content = text
patrick@73
  1186
Patrick@336
  1187
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ point ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@73
  1188
Patrick@336
  1189
point = element point { point.attributes, point.content }
patrick@73
  1190
Patrick@336
  1191
point.attributes =
Patrick@336
  1192
   point.ref.attribute?
Coraline@409
  1193
Patrick@340
  1194
point.ref.attribute = attribute ref {
Patrick@340
  1195
   "right" | "cat1" | "cat2" | "cat3" | "cat4" | "cat5" }
Patrick@336
  1196
Patrick@356
  1197
point.content = inlines
iinov@463
  1198
iinov@463
  1199
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ dictation.hint ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
iinov@463
  1200
iinov@463
  1201
# ~~~~~~ dictation.hint
iinov@463
  1202
dictation.hint = element hint { dictation.hint.content }
iinov@463
  1203
iinov@463
  1204
dictation.hint.content =
iinov@463
  1205
    dictation.hint.w,
iinov@463
  1206
    mistake+
iinov@463
  1207
iinov@463
  1208
# ~~~~~~ dictation.hint.w
iinov@463
  1209
dictation.hint.w = element w { text }
iinov@463
  1210
iinov@463
  1211
# ~~~~~~ mistake
iinov@463
  1212
mistake = element mistake { mistake.attributes, mistake.content }
iinov@463
  1213
iinov@463
  1214
mistake.attributes =
iinov@468
  1215
   mistake.is.attribute?
iinov@463
  1216
mistake.is.attribute = attribute is { text }
iinov@463
  1217
iinov@463
  1218
mistake.content = inlines