RelaxNG/publiquiz.rnc
changeset 450 fd645a45932e
parent 448 9bc794bf36b0
child 461 58b2704e601a
--- a/RelaxNG/publiquiz.rnc	mar. nov. 28 13:03:48 2017 +0100
+++ b/RelaxNG/publiquiz.rnc	mar. févr. 27 05:29:56 2018 +0100
@@ -1,4 +1,3 @@
-
 include "publidoc.rnc" {
    start = publiquiz
 
@@ -127,6 +126,8 @@
  | categories
  | wordsearch
  | flashcard
+ | coloring
+ | memory
  | production
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ choices ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -191,7 +192,7 @@
 
 correct-line = element correct-line { correct.attributes, correct.content }
 
-correct.attributes = 
+correct.attributes =
    remove-space.attribute?
 remove-space.attribute = attribute remove-space { xsd:boolean }
 
@@ -342,7 +343,7 @@
 
 cell = element cell {cell.content}
 cell.content = xsd:token {pattern = "."}
-   
+
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ flashcard ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 # ~~~~~~ flashcard
@@ -375,6 +376,60 @@
     | blanks-select
     | sort
 
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ coloring ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+coloring = element coloring { coloring.attributes, coloring.content }
+
+coloring.attributes =
+    nomark.attribute?
+nomark.attribute = attribute nomark { xsd:boolean }
+
+coloring.content =
+    palette
+  & canvas
+  & areas?
+
+# ~~~~~~ palette
+palette = element palette { palette.content }
+
+palette.content =
+    color+
+
+# ~~~~~~ canvas
+canvas = element canvas { canvas.attributes }
+
+canvas.attributes =
+    media.id.attribute
+
+# ~~~~~~ areas
+areas = element areas { areas.attributes }
+
+areas.attributes =
+    media.id.attribute
+
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ memory ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# ~~~~~~ memory
+memory = element memory { memory.attributes, memory.content }
+
+memory.attributes =
+    display.attribute?
+    & delay.attribute?
+display.attribute = attribute display { xsd:positiveInteger }
+delay.attribute = attribute delay { xsd:positiveInteger }
+
+memory.content =
+   memory.match,
+   memory.match+
+
+# ~~~~~~ memory.match
+memory.match = element match { memory-m.content }
+
+memory-m.content =
+    memory-m.item,
+    memory-m.item,
+    audio?
+
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ production ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 production = element production { production.content }
@@ -497,7 +552,7 @@
 blanks-c.item = element item { blanks-c.item.content }
 correct.item = element item { correct.item.content }
 pointing.item = element item { pointing.item.content }
-                        
+
 
 blanks.item.content = blanks.inlines | blanks.block+
 blanks-m.item.content = blanks-m.inlines | blanks-m.block+
@@ -850,7 +905,7 @@
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ words.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 words.item = element item {words.item.content, words.item.attributes }
-  
+
 words.item.content = inlines
 
 words.item.attributes =
@@ -864,6 +919,22 @@
 endx = attribute endx {xsd:token {pattern = "[a-zA-Z]+"}}
 endy = attribute endy {xsd:token {pattern = "\d+"}}
 
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ color ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+color = element color { color.attributes }
+
+color.attributes =
+    color.code
+    & color.coderef?
+color.code = attribute code {xsd:token { pattern = "#(\d|\w){6}"}}
+color.coderef = attribute coderef { list{xsd:token { pattern = "#(\d|\w){6}"}+}}
+
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ memory-m.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+memory-m.item = element item { memory-m.item.content }
+
+memory-m.item.content = image
+
 
 # =============================================================================
 #                                 INLINE LEVEL
@@ -1053,16 +1124,16 @@
  | image
  | audio
  | (s-m+, help?, answer?)
-       
+
 # ~~~~~~ blank-c
 blank-c = element blank { blank-c.attributes, blank-c.content }
-                  
+
 blank-c.attributes = form.attribute?
 form.attribute = attribute form { 'radio' | 'check' }
-                                
+
 blank-c.content = (blank-c.right | blank-c.wrong)+, help?, answer?
 blank-c.right = element right { inlines }
-blank-c.wrong = element wrong { inlines }                      
+blank-c.wrong = element wrong { inlines }
 
 # ~~~~~~ s
 s = element s { s.content }
@@ -1075,7 +1146,7 @@
  | math
  | image
  | audio
-      
+
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ char ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 char = element char { char.attributes, char.content }