# HG changeset patch # User Patrick PIERRE # Date 1359915761 -3600 # Node ID 1f9fa4e74cd0389ebe5eebcae8d146821d9771da # Parent e9d1bb4692b5c0241a9fc3ec0dd2c49526b83889 Exercices avec images diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/Images/chat.png Binary file RelaxNG/Examples/Quiz/Images/chat.png has changed diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/Images/chaton.png Binary file RelaxNG/Examples/Quiz/Images/chaton.png has changed diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/Images/choices-check_audioi01.png Binary file RelaxNG/Examples/Quiz/Images/choices-check_audioi01.png has changed diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/Images/choices-radioq02i01.jpg Binary file RelaxNG/Examples/Quiz/Images/choices-radioq02i01.jpg has changed diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/Images/couleuvre.png Binary file RelaxNG/Examples/Quiz/Images/couleuvre.png has changed diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/Images/elephant.png Binary file RelaxNG/Examples/Quiz/Images/elephant.png has changed diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/Images/elephanteau.png Binary file RelaxNG/Examples/Quiz/Images/elephanteau.png has changed diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/Images/hippocampe.png Binary file RelaxNG/Examples/Quiz/Images/hippocampe.png has changed diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/Images/lezard.png Binary file RelaxNG/Examples/Quiz/Images/lezard.png has changed diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/Images/lievre.png Binary file RelaxNG/Examples/Quiz/Images/lievre.png has changed diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/Images/lion.png Binary file RelaxNG/Examples/Quiz/Images/lion.png has changed diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/Images/lionceau.png Binary file RelaxNG/Examples/Quiz/Images/lionceau.png has changed diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/Images/loup.png Binary file RelaxNG/Examples/Quiz/Images/loup.png has changed diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/Images/lynx.png Binary file RelaxNG/Examples/Quiz/Images/lynx.png has changed diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/Images/ours.png Binary file RelaxNG/Examples/Quiz/Images/ours.png has changed diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/Images/ourson.png Binary file RelaxNG/Examples/Quiz/Images/ourson.png has changed diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/Images/rouge-gorge.png Binary file RelaxNG/Examples/Quiz/Images/rouge-gorge.png has changed diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/Images/tigre.png Binary file RelaxNG/Examples/Quiz/Images/tigre.png has changed diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/Images/tigreau.png Binary file RelaxNG/Examples/Quiz/Images/tigreau.png has changed diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/categories_image.xml --- /dev/null jeu. janv. 01 00:00:00 1970 +0000 +++ b/RelaxNG/Examples/Quiz/categories_image.xml dim. févr. 03 19:22:41 2013 +0100 @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Id$ --> +<publiquiz version="1.0"> + <quiz id="categories_image" xml:lang="fr"> + <head> + <title>Exercice de catégories avec images</title> + </head> + + <instructions> + <p>Classez les animaux suivants par mode de reproduction.</p> + </instructions> + + <categories> + <category> + <head> + <title>Mammifère</title> + </head> + <item><image id="loup"/></item> + <item><image id="elephant"/></item> + <item><image id="lievre"/></item> + </category> + <category> + <head> + <title>Vivipare</title> + </head> + <item><image id="lezard"/></item> + <item><image id="hippocampe"/></item> + </category> + <category> + <head> + <title>Ovipare</title> + </head> + <item><image id="rouge-gorge"/></item> + <item><image id="couleuvre"/></item> + </category> + </categories> + </quiz> +</publiquiz> diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/choices-check_audio.xml --- a/RelaxNG/Examples/Quiz/choices-check_audio.xml ven. févr. 01 19:21:20 2013 +0100 +++ b/RelaxNG/Examples/Quiz/choices-check_audio.xml dim. févr. 03 19:22:41 2013 +0100 @@ -11,10 +11,10 @@ </instructions> <choices-check> - <right><audio id="choices-check_audioa01"/></right> - <wrong><audio id="choices-check_audioa02"/></wrong> - <right><audio id="choices-check_audioa03"/></right> - <wrong><audio id="choices-check_audioa04"/></wrong> + <right><audio id="choices-check_audioa01"/><image id="choices-check_audioi01"/></right> + <wrong><audio id="choices-check_audioa02"/><image id="choices-check_audioi01"/></wrong> + <right><audio id="choices-check_audioa03"/><image id="choices-check_audioi01"/></right> + <wrong><audio id="choices-check_audioa04"/><image id="choices-check_audioi01"/></wrong> </choices-check> </quiz> </publiquiz> diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/composite.xml --- a/RelaxNG/Examples/Quiz/composite.xml ven. févr. 01 19:21:20 2013 +0100 +++ b/RelaxNG/Examples/Quiz/composite.xml dim. févr. 03 19:22:41 2013 +0100 @@ -94,9 +94,9 @@ <p>Associez les animaux avec leur catégorie.</p> </instructions> <matching> - <match><p>oiseau</p> <p>hirondelle</p></match> - <match><p>mammifère</p> <p>baleine</p></match> - <match><p>reptile</p> <p>couleuvre</p></match> + <match><item>oiseau</item> <item>hirondelle</item></match> + <match><item>mammifère</item> <item>baleine</item></match> + <match><item>reptile</item> <item>couleuvre</item></match> </matching> </subquiz> diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/matching.xml --- a/RelaxNG/Examples/Quiz/matching.xml ven. févr. 01 19:21:20 2013 +0100 +++ b/RelaxNG/Examples/Quiz/matching.xml dim. févr. 03 19:22:41 2013 +0100 @@ -12,20 +12,20 @@ <matching> <match> - <p>On s'entend très bien.</p> - <p>On s'entend comme chien et chat.</p> + <item>On s'entend très bien.</item> + <item>On s'entend comme chien et chat.</item> </match> <match> - <p>On a perdu le contact.</p> - <p>On a gardé contact.</p> + <item>On a perdu le contact.</item> + <item>On a gardé contact.</item> </match> <match> - <p>On se chamaille souvent.</p> - <p>On ne se dispute jamais.</p> + <item>On se chamaille souvent.</item> + <item>On ne se dispute jamais.</item> </match> <match> - <p>On s’amuse comme des fous.</p> - <p>On est plutôt sérieux ensemble.</p> + <item>On s’amuse comme des fous.</item> + <item>On est plutôt sérieux ensemble.</item> </match> </matching> </quiz> diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/matching_image.xml --- /dev/null jeu. janv. 01 00:00:00 1970 +0000 +++ b/RelaxNG/Examples/Quiz/matching_image.xml dim. févr. 03 19:22:41 2013 +0100 @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Id$ --> +<publiquiz version="1.0"> + <quiz id="matching_image" xml:lang="fr"> + <head> + <title>Exercice d'appariement avec images</title> + </head> + + <instructions> + <p>Associez les petits avec leur parent.</p> + </instructions> + + <matching> + <match> + <item><image id="chat"/></item> + <item><image id="chaton"/></item> + </match> + <match> + <item><image id="elephant"/></item> + <item><image id="elephanteau"/></item> + </match> + <match> + <item><image id="lion"/></item> + <item><image id="lionceau"/></item> + </match> + <match> + <item><image id="ours"/></item> + <item><image id="ourson"/></item> + </match> + <match> + <item><image id="tigre"/></item> + <item><image id="tigreau"/></item> + </match> + </matching> + </quiz> +</publiquiz> diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/Examples/Quiz/sort_image.xml --- /dev/null jeu. janv. 01 00:00:00 1970 +0000 +++ b/RelaxNG/Examples/Quiz/sort_image.xml dim. févr. 03 19:22:41 2013 +0100 @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Id$ --> +<publiquiz version="1.0"> + <quiz id="sort_image" xml:lang="fr"> + <head> + <title>Exercice de tri avec image</title> + </head> + + <instructions> + <p>Rangez les animaux pour réaliser une chaîne alimentaire.</p> + </instructions> + + <sort> + <comparison>sont mangés par</comparison> + <item shuffle="3"><image id="lievre"/></item> + <item shuffle="1"><image id="loup"/></item> + <item shuffle="2"><image id="lynx"/></item> + </sort> + </quiz> +</publiquiz> diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/publiquiz.rnc --- a/RelaxNG/publiquiz.rnc ven. févr. 01 19:21:20 2013 +0100 +++ b/RelaxNG/publiquiz.rnc dim. févr. 03 19:22:41 2013 +0100 @@ -155,12 +155,20 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ matching ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# ~~~~~~ matching matching = element matching { matching.content } matching.content = match, match+ +# ~~~~~~ match +match = element match { match.content } + +match.content = + match.item, + match.item + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sort ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sort = element sort { sort.attributes, sort.content } @@ -204,7 +212,11 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ composite ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~ composite -composite = element composite { composite.content } +composite = element composite { composite.attributes, composite.content } + +composite.attributes = + multipage.attribute? +multipage.attribute = attribute multipage { xsd:boolean } composite.content = subquiz, @@ -337,7 +349,6 @@ point.inlines | (p | media)+ - # ~~~~~~~~~~~~~~~~~~~~~~~~ choices.right, choices.wrong ~~~~~~~~~~~~~~~~~~~~~~~ choices.right = element right { choices.right.content } @@ -345,8 +356,7 @@ choices.right.content = inlines - | ((p+ | image | (audio, image?)), help?, answer?) - + | ((p | image | (audio, image?) | video), help?, answer?) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blanks.wrongs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -361,13 +371,13 @@ blanks.wrong.content = text -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ match ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (match) item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -match = element match { match.content } +match.item = element item { match.item.content } -match.content = - (p | section), - (p | section) +match.item.content = + inlines + | (image | (audio, image?) | video) # ~~~~~~~~~~~~~~~~~~~~~~~~ (sort) comparison, item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -383,14 +393,17 @@ item.shuffle.attribute? item.shuffle.attribute = attribute shuffle { xsd:integer } -sort.item.content = inlines +sort.item.content = + inlines + | (image | (audio, image?) | video) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (category) item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# ~~~~~~ category.item category.item = element item { category.item.content } -category.item.content = inlines +category.item.content = + inlines + | (image | (audio, image?) | video) # ============================================================================= diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 RelaxNG/publiset.rnc --- a/RelaxNG/publiset.rnc ven. févr. 01 19:21:20 2013 +0100 +++ b/RelaxNG/publiset.rnc dim. févr. 03 19:22:41 2013 +0100 @@ -131,6 +131,7 @@ composition.file.attributes = name.attribute + & path.attribute? & (xpath.attribute | xslt.attribute)? selection.file.attributes = name.attribute diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 Xxe/Css/publiquiz.css --- a/Xxe/Css/publiquiz.css ven. févr. 01 19:21:20 2013 +0100 +++ b/Xxe/Css/publiquiz.css dim. févr. 03 19:22:41 2013 +0100 @@ -261,7 +261,14 @@ /* composite ~~~~~~~~~~~~~~~~~~~~~~~ */ composite:before { - content: insert-before-button() " Composite"; + content: insert-before-button() + command-button(command, "putAttribute", parameter, "multipage true", icon, icon(plus-box)) + " Composite"; +} +composite[multipage]:before { + content: insert-before-button() + " Composite – multipage = " label(attribute, multipage, color, black) + set-attribute-button(attribute, multipage, unset-attribute, yes) } subquiz { @@ -316,6 +323,13 @@ /* Block level ============================================================= */ +/* image ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +right image, wrong image, item image { + content: concatenate("image('Images/", attr(id), ".png', -128, -96, smooth)"); + vertical-align: middle; +} + /* choices.right, choices.wrong ~~~~ */ choices-radio right:before, choices-radio wrong:before, @@ -407,21 +421,22 @@ match { display: block; margin-left: 24px; + margin-bottom: .8em; } -match > section:before, match > p:before { +match > item:before { display: none; } -match section, match p { +match item { display: inline; } -match > section:first-child:after, match > p:first-child:after { +match > item:first-child:after { color: #7f7f7f; content: " —> "; } -match > section:last-child:after, match > p:last-child:after { +match > item:last-child:after { display: none; } @@ -472,6 +487,7 @@ category > item { margin-left: 1em; + margin-bottom: 0.8em; } category:after { diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 Xxe/Templates/publiquiz_categories_image.xml --- /dev/null jeu. janv. 01 00:00:00 1970 +0000 +++ b/Xxe/Templates/publiquiz_categories_image.xml dim. févr. 03 19:22:41 2013 +0100 @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Id$ --> +<publiquiz version="1.0"> + <quiz id="???"> + <head> + <title></title> + </head> + + <instructions> + <p></p> + </instructions> + + <categories> + <category> + <head> + <title></title> + </head> + <item><image id="???"/></item> + </category> + <category> + <head> + <title></title> + </head> + <item><image id="???"/></item> + </category> + </categories> + </quiz> +</publiquiz> diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 Xxe/Templates/publiquiz_choices-radio_image.xml --- /dev/null jeu. janv. 01 00:00:00 1970 +0000 +++ b/Xxe/Templates/publiquiz_choices-radio_image.xml dim. févr. 03 19:22:41 2013 +0100 @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<publiquiz version="1.0"> + <quiz id="???"> + <head> + <title></title> + </head> + + <instructions> + <p></p> + </instructions> + + <choices-radio> + <right><image id="???"/></right> + <wrong><image id="???"/></wrong> + </choices-radio> + </quiz> +</publiquiz> diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 Xxe/Templates/publiquiz_matching.xml --- a/Xxe/Templates/publiquiz_matching.xml ven. févr. 01 19:21:20 2013 +0100 +++ b/Xxe/Templates/publiquiz_matching.xml dim. févr. 03 19:22:41 2013 +0100 @@ -11,12 +11,12 @@ <matching> <match> - <p></p> - <p></p> + <item></item> + <item></item> </match> <match> - <p></p> - <p></p> + <item></item> + <item></item> </match> </matching> </quiz> diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 Xxe/Templates/publiquiz_matching_image.xml --- /dev/null jeu. janv. 01 00:00:00 1970 +0000 +++ b/Xxe/Templates/publiquiz_matching_image.xml dim. févr. 03 19:22:41 2013 +0100 @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<publiquiz version="1.0"> + <quiz id="???"> + <head> + <title></title> + </head> + + <instructions> + <p></p> + </instructions> + + <matching> + <match> + <item><image id="???"/></item> + <item><image id="???"/></item> + </match> + <match> + <item><image id="???"/></item> + <item><image id="???"/></item> + </match> + </matching> + </quiz> +</publiquiz> diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 Xxe/Templates/publiquiz_sort_image.xml --- /dev/null jeu. janv. 01 00:00:00 1970 +0000 +++ b/Xxe/Templates/publiquiz_sort_image.xml dim. févr. 03 19:22:41 2013 +0100 @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Id$ --> +<publiquiz version="1.0"> + <quiz id="???"> + <head> + <title></title> + </head> + + <instructions> + <p></p> + </instructions> + + <sort> + <comparison></comparison> + <item><image id="???"/></item> + <item><image id="???"/></item> + </sort> + </quiz> +</publiquiz> diff -r e9d1bb4692b5 -r 1f9fa4e74cd0 Xxe/publiquiz.xxe --- a/Xxe/publiquiz.xxe ven. févr. 01 19:21:20 2013 +0100 +++ b/Xxe/publiquiz.xxe dim. févr. 03 19:22:41 2013 +0100 @@ -16,6 +16,8 @@ <!-- ================================================================== --> <template location="Templates/publiquiz_choices-radio.xml" name="Exercice QCM – radio"/> + <template location="Templates/publiquiz_choices-radio_image.xml" + name="Exercice QCM – radio avec images"/> <template location="Templates/publiquiz_choices-check.xml" name="Exercice QCM – check"/> <template location="Templates/publiquiz_blanks-fill.xml" @@ -26,10 +28,16 @@ name="Exercice de pointage"/> <template location="Templates/publiquiz_matching.xml" name="Exercice d'appariement"/> + <template location="Templates/publiquiz_matching_image.xml" + name="Exercice d'appariement avec images"/> <template location="Templates/publiquiz_sort.xml" name="Exercice de tri"/> + <template location="Templates/publiquiz_sort_image.xml" + name="Exercice de tri avec images"/> <template location="Templates/publiquiz_categories.xml" name="Exercice de catégories"/> + <template location="Templates/publiquiz_categories_image.xml" + name="Exercice de catégories avec images"/> <template location="Templates/publiquiz_production.xml" name="Exercice de production"/> <template location="Templates/publiquiz_composite.xml"