RelaxNG/publiquiz.rnc
changeset 450 fd645a45932e
parent 448 9bc794bf36b0
child 461 58b2704e601a
equal deleted inserted replaced
449:d8a9a8a8acc6 450:fd645a45932e
     1 
       
     2 include "publidoc.rnc" {
     1 include "publidoc.rnc" {
     3    start = publiquiz
     2    start = publiquiz
     4 
     3 
     5    document.content =
     4    document.content =
     6       top.head?,
     5       top.head?,
   125  | matching
   124  | matching
   126  | sort
   125  | sort
   127  | categories
   126  | categories
   128  | wordsearch
   127  | wordsearch
   129  | flashcard
   128  | flashcard
       
   129  | coloring
       
   130  | memory
   130  | production
   131  | production
   131 
   132 
   132 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ choices ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   133 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ choices ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   133 
   134 
   134 choices-radio = element choices-radio {
   135 choices-radio = element choices-radio {
   189 
   190 
   190 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ correct-line ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   191 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ correct-line ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   191 
   192 
   192 correct-line = element correct-line { correct.attributes, correct.content }
   193 correct-line = element correct-line { correct.attributes, correct.content }
   193 
   194 
   194 correct.attributes = 
   195 correct.attributes =
   195    remove-space.attribute?
   196    remove-space.attribute?
   196 remove-space.attribute = attribute remove-space { xsd:boolean }
   197 remove-space.attribute = attribute remove-space { xsd:boolean }
   197 
   198 
   198 correct.content =
   199 correct.content =
   199    correct.intruders?,
   200    correct.intruders?,
   340 line = element line {line.content}
   341 line = element line {line.content}
   341 line.content = cell+
   342 line.content = cell+
   342 
   343 
   343 cell = element cell {cell.content}
   344 cell = element cell {cell.content}
   344 cell.content = xsd:token {pattern = "."}
   345 cell.content = xsd:token {pattern = "."}
   345    
   346 
   346 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ flashcard ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   347 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ flashcard ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   347 
   348 
   348 # ~~~~~~ flashcard
   349 # ~~~~~~ flashcard
   349 flashcard = element flashcard { flashcard.content }
   350 flashcard = element flashcard { flashcard.content }
   350 
   351 
   372     choices-radio
   373     choices-radio
   373     | choices-check
   374     | choices-check
   374     | blanks-fill
   375     | blanks-fill
   375     | blanks-select
   376     | blanks-select
   376     | sort
   377     | sort
       
   378 
       
   379 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ coloring ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   380 
       
   381 coloring = element coloring { coloring.attributes, coloring.content }
       
   382 
       
   383 coloring.attributes =
       
   384     nomark.attribute?
       
   385 nomark.attribute = attribute nomark { xsd:boolean }
       
   386 
       
   387 coloring.content =
       
   388     palette
       
   389   & canvas
       
   390   & areas?
       
   391 
       
   392 # ~~~~~~ palette
       
   393 palette = element palette { palette.content }
       
   394 
       
   395 palette.content =
       
   396     color+
       
   397 
       
   398 # ~~~~~~ canvas
       
   399 canvas = element canvas { canvas.attributes }
       
   400 
       
   401 canvas.attributes =
       
   402     media.id.attribute
       
   403 
       
   404 # ~~~~~~ areas
       
   405 areas = element areas { areas.attributes }
       
   406 
       
   407 areas.attributes =
       
   408     media.id.attribute
       
   409 
       
   410 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ memory ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   411 
       
   412 # ~~~~~~ memory
       
   413 memory = element memory { memory.attributes, memory.content }
       
   414 
       
   415 memory.attributes =
       
   416     display.attribute?
       
   417     & delay.attribute?
       
   418 display.attribute = attribute display { xsd:positiveInteger }
       
   419 delay.attribute = attribute delay { xsd:positiveInteger }
       
   420 
       
   421 memory.content =
       
   422    memory.match,
       
   423    memory.match+
       
   424 
       
   425 # ~~~~~~ memory.match
       
   426 memory.match = element match { memory-m.content }
       
   427 
       
   428 memory-m.content =
       
   429     memory-m.item,
       
   430     memory-m.item,
       
   431     audio?
   377 
   432 
   378 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ production ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   433 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ production ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   379 
   434 
   380 production = element production { production.content }
   435 production = element production { production.content }
   381 
   436 
   495 blanks.item = element item { blanks.item.content }
   550 blanks.item = element item { blanks.item.content }
   496 blanks-m.item = element item { blanks-m.item.content }
   551 blanks-m.item = element item { blanks-m.item.content }
   497 blanks-c.item = element item { blanks-c.item.content }
   552 blanks-c.item = element item { blanks-c.item.content }
   498 correct.item = element item { correct.item.content }
   553 correct.item = element item { correct.item.content }
   499 pointing.item = element item { pointing.item.content }
   554 pointing.item = element item { pointing.item.content }
   500                         
   555 
   501 
   556 
   502 blanks.item.content = blanks.inlines | blanks.block+
   557 blanks.item.content = blanks.inlines | blanks.block+
   503 blanks-m.item.content = blanks-m.inlines | blanks-m.block+
   558 blanks-m.item.content = blanks-m.inlines | blanks-m.block+
   504 blanks-c.item.content = blanks-c.inlines | blanks-c.block+
   559 blanks-c.item.content = blanks-c.inlines | blanks-c.block+
   505 correct.item.content = correct.inlines | correct.block+
   560 correct.item.content = correct.inlines | correct.block+
   848    inlines
   903    inlines
   849  | (p, help?, answer?)
   904  | (p, help?, answer?)
   850 
   905 
   851 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ words.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   906 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ words.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   852 words.item = element item {words.item.content, words.item.attributes }
   907 words.item = element item {words.item.content, words.item.attributes }
   853   
   908 
   854 words.item.content = inlines
   909 words.item.content = inlines
   855 
   910 
   856 words.item.attributes =
   911 words.item.attributes =
   857    startx
   912    startx
   858  & starty
   913  & starty
   861 
   916 
   862 startx = attribute startx {xsd:token {pattern = "[a-zA-Z]+"}}
   917 startx = attribute startx {xsd:token {pattern = "[a-zA-Z]+"}}
   863 starty = attribute starty {xsd:token {pattern = "\d+"}}
   918 starty = attribute starty {xsd:token {pattern = "\d+"}}
   864 endx = attribute endx {xsd:token {pattern = "[a-zA-Z]+"}}
   919 endx = attribute endx {xsd:token {pattern = "[a-zA-Z]+"}}
   865 endy = attribute endy {xsd:token {pattern = "\d+"}}
   920 endy = attribute endy {xsd:token {pattern = "\d+"}}
       
   921 
       
   922 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ color ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   923 
       
   924 color = element color { color.attributes }
       
   925 
       
   926 color.attributes =
       
   927     color.code
       
   928     & color.coderef?
       
   929 color.code = attribute code {xsd:token { pattern = "#(\d|\w){6}"}}
       
   930 color.coderef = attribute coderef { list{xsd:token { pattern = "#(\d|\w){6}"}+}}
       
   931 
       
   932 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ memory-m.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   933 
       
   934 memory-m.item = element item { memory-m.item.content }
       
   935 
       
   936 memory-m.item.content = image
   866 
   937 
   867 
   938 
   868 # =============================================================================
   939 # =============================================================================
   869 #                                 INLINE LEVEL
   940 #                                 INLINE LEVEL
   870 # =============================================================================
   941 # =============================================================================
  1051    p
  1122    p
  1052  | math
  1123  | math
  1053  | image
  1124  | image
  1054  | audio
  1125  | audio
  1055  | (s-m+, help?, answer?)
  1126  | (s-m+, help?, answer?)
  1056        
  1127 
  1057 # ~~~~~~ blank-c
  1128 # ~~~~~~ blank-c
  1058 blank-c = element blank { blank-c.attributes, blank-c.content }
  1129 blank-c = element blank { blank-c.attributes, blank-c.content }
  1059                   
  1130 
  1060 blank-c.attributes = form.attribute?
  1131 blank-c.attributes = form.attribute?
  1061 form.attribute = attribute form { 'radio' | 'check' }
  1132 form.attribute = attribute form { 'radio' | 'check' }
  1062                                 
  1133 
  1063 blank-c.content = (blank-c.right | blank-c.wrong)+, help?, answer?
  1134 blank-c.content = (blank-c.right | blank-c.wrong)+, help?, answer?
  1064 blank-c.right = element right { inlines }
  1135 blank-c.right = element right { inlines }
  1065 blank-c.wrong = element wrong { inlines }                      
  1136 blank-c.wrong = element wrong { inlines }
  1066 
  1137 
  1067 # ~~~~~~ s
  1138 # ~~~~~~ s
  1068 s = element s { s.content }
  1139 s = element s { s.content }
  1069 s.content = text
  1140 s.content = text
  1070 
  1141 
  1073 s-m.content =
  1144 s-m.content =
  1074    p
  1145    p
  1075  | math
  1146  | math
  1076  | image
  1147  | image
  1077  | audio
  1148  | audio
  1078       
  1149 
  1079 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ char ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1150 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ char ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1080 
  1151 
  1081 char = element char { char.attributes, char.content }
  1152 char = element char { char.attributes, char.content }
  1082 
  1153 
  1083 char.attributes = function.attribute?
  1154 char.attributes = function.attribute?