RelaxNG/publiquiz.rnc
changeset 376 1434bae63b20
parent 360 77f406396cfc
child 379 f19169277267
equal deleted inserted replaced
375:e880564ea01e 376:1434bae63b20
   110  | production
   110  | production
   111 
   111 
   112 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ choices ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   112 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ choices ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   113 
   113 
   114 choices-radio = element choices-radio {
   114 choices-radio = element choices-radio {
   115    choices.attributes, choices-radio.content }
   115    choices-radio.attributes, choices-radio.content }
   116 choices-check = element choices-check {
   116 choices-check = element choices-check {
   117    choices.attributes, choices-check.content }
   117    choices-check.attributes, choices-check.content }
   118 
   118 
   119 choices.attributes =
   119 choices-radio.attributes =
   120    shuffle.attribute?
   120    shuffle.attribute?
       
   121 choices-check.attributes =
       
   122    success.attribute?
       
   123  & shuffle.attribute?
       
   124 success.attribute = attribute success { xsd:decimal {maxInclusive="1"} }
   121 shuffle.attribute = attribute shuffle { xsd:boolean }
   125 shuffle.attribute = attribute shuffle { xsd:boolean }
   122 
   126 
   123 choices-radio.content =
   127 choices-radio.content =
   124    choices.right
   128    choices.right
   125  & choices.wrong+
   129  & choices.wrong+
   133 blanks-select = element blanks-select {
   137 blanks-select = element blanks-select {
   134    blanks-select.attributes, blanks-select.content }
   138    blanks-select.attributes, blanks-select.content }
   135 blanks-char = element blanks-char { blanks-select.content }
   139 blanks-char = element blanks-char { blanks-select.content }
   136 
   140 
   137 blanks-fill.attributes =
   141 blanks-fill.attributes =
   138    strict.attribute?
   142    success.attribute?
       
   143  & strict.attribute?
   139 blanks-select.attributes =
   144 blanks-select.attributes =
   140    multiple.attribute?
   145    success.attribute?
       
   146  & multiple.attribute?
   141 strict.attribute = attribute strict { xsd:boolean }
   147 strict.attribute = attribute strict { xsd:boolean }
   142 multiple.attribute = attribute multiple { xsd:boolean }
   148 multiple.attribute = attribute multiple { xsd:boolean }
   143 
   149 
   144 blanks-fill.content =
   150 blanks-fill.content =
   145    (blanks.block+ | blanks.section+)
   151    (blanks.block+ | blanks.section+)
   150 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pointing ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   156 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pointing ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   151 
   157 
   152 pointing = element pointing { pointing.attributes, pointing.content }
   158 pointing = element pointing { pointing.attributes, pointing.content }
   153 
   159 
   154 pointing.attributes =
   160 pointing.attributes =
   155    pointing.type.attribute?
   161    success.attribute?
       
   162  & pointing.type.attribute?
   156 pointing.type.attribute = attribute type { "radio" | "check" }
   163 pointing.type.attribute = attribute type { "radio" | "check" }
   157 
   164 
   158 pointing.content =
   165 pointing.content =
   159    (pointing.section+ | pointing.block+)
   166    (pointing.section+ | pointing.block+)
   160 
   167 
   161 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pointing-categories ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   168 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pointing-categories ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   162 
   169 
   163 # ~~~~~~ pointing-categories
   170 # ~~~~~~ pointing-categories
   164 pointing-categories = element pointing-categories { pointing-c.content }
   171 pointing-categories = element pointing-categories {
       
   172    pointing-c.attributes, pointing-c.content }
       
   173 
       
   174 pointing-c.attributes =
       
   175    success.attribute?
   165 
   176 
   166 pointing-c.content =
   177 pointing-c.content =
   167    pointing-c.categories,
   178    pointing-c.categories,
   168    pointing.section
   179    pointing.section
   169 
   180 
   194 
   205 
   195 # ~~~~~~ matching
   206 # ~~~~~~ matching
   196 matching = element matching { matching.attributes, matching.content }
   207 matching = element matching { matching.attributes, matching.content }
   197 
   208 
   198 matching.attributes =
   209 matching.attributes =
   199    multiple.attribute?
   210    success.attribute?
       
   211  & multiple.attribute?
   200 
   212 
   201 matching.content =
   213 matching.content =
   202    matching.intruders?,
   214    matching.intruders?,
   203    match,
   215    match,
   204    match+
   216    match+
   213 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sort ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   225 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sort ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   214 
   226 
   215 sort = element sort { sort.attributes, sort.content }
   227 sort = element sort { sort.attributes, sort.content }
   216 
   228 
   217 sort.attributes =
   229 sort.attributes =
   218    shuffle.attribute?
   230    success.attribute?
       
   231  & shuffle.attribute?
   219 
   232 
   220 sort.content =
   233 sort.content =
   221    comparison?,
   234    comparison?,
   222    sort.item,
   235    sort.item,
   223    sort.item+
   236    sort.item+
   234 
   247 
   235 # ~~~~~~ categories
   248 # ~~~~~~ categories
   236 categories = element categories { categories.attributes, categories.content }
   249 categories = element categories { categories.attributes, categories.content }
   237 
   250 
   238 categories.attributes =
   251 categories.attributes =
   239    multiple.attribute?
   252    success.attribute?
       
   253  & multiple.attribute?
   240 
   254 
   241 categories.content =
   255 categories.content =
   242    categories.intruders?,
   256    categories.intruders?,
   243    category,
   257    category,
   244    category+
   258    category+
   253 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pip ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   267 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pip ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   254 
   268 
   255 pip = element pip { pip.attributes, pip.content }
   269 pip = element pip { pip.attributes, pip.content }
   256 
   270 
   257 pip.attributes =
   271 pip.attributes =
   258    multiple.attribute?
   272    success.attribute?
       
   273  & multiple.attribute?
   259 
   274 
   260 pip.content =
   275 pip.content =
   261    pip.image
   276    pip.image
   262 
   277 
   263 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ production ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   278 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ production ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   268 
   283 
   269 # ~~~~~~ composite
   284 # ~~~~~~ composite
   270 composite = element composite { composite.attributes, composite.content }
   285 composite = element composite { composite.attributes, composite.content }
   271 
   286 
   272 composite.attributes =
   287 composite.attributes =
   273    multipage.attribute?
   288    success.attribute?
       
   289  & multipage.attribute?
   274 multipage.attribute = attribute multipage { xsd:boolean }
   290 multipage.attribute = attribute multipage { xsd:boolean }
   275 
   291 
   276 composite.content =
   292 composite.content =
   277    subquiz,
   293    subquiz,
   278    subquiz+
   294    subquiz+