Rev 13741 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 11360 | bpr | 1 | type=classify |
| 13716 | obado | 2 | textarea="data instruction" |
| 3 | iEdit="instruction" |
||
| 4188 | bpr | 4 | |
| 5 | :Classer tous les mots d'une phrase écrite selon un attribut (par exemple leur nature). |
||
| 6 | Cet exercice diffère d'autres exercices de classification par la manière dont les données sont |
||
| 7 | rentrées, la donnée étant une phrase et non une liste de mots. |
||
| 13488 | obado | 8 | <p class="wims_credits"> |
| 15179 | lemaire | 9 | Auteur du modèle : <a href="mailto:bernadette.m.riou@orange.fr">Bernadette Perrin-Riou</a> |
| 4188 | bpr | 10 | </p> |
| 11 | :%%%%%%%%%%%%%%%%% ATTENTION %%%%%%%%%%%%%%%%%%%% |
||
| 12 | |||
| 13 | Enlevez l'en-tête ci-dessus si vous détruisez les balises pour le modèle ! |
||
| 14 | (Ce sont les lignes qui commencent par un ':'.) |
||
| 15 | Sinon l'exercice risque de ne pas pouvoir repasser sous Createxo. |
||
| 16 | |||
| 17 | :%%%%%%%% Paramètres d'exemples à redéfinir %%%%%%%%%%%%%%%%% |
||
| 13488 | obado | 18 | |
| 4514 | bpr | 19 | :\title{Classer les mots d'une phrase} |
| 5147 | bpr | 20 | :\author{Bernadette, Perrin-Riou} |
| 5724 | bpr | 21 | :\email{} |
| 22 | :\credits{} |
||
| 13488 | obado | 23 | |
| 4188 | bpr | 24 | :Consigne |
| 13488 | obado | 25 | \text{instruction=Classer les mots selon leur nature ou des propriétés} |
| 4188 | bpr | 26 | |
| 27 | :Nom du fichier |
||
| 7718 | bpr | 28 | Ne remplissez que si vous vous désirez transférer le source de cet exercice dans un compte Modtool |
| 4188 | bpr | 29 | et utiliser un fichier de données (dans un module OEF) |
| 30 | du type |
||
| 31 | <pre> |
||
| 32 | V,N,Art,Adj,Prep |
||
| 33 | Verbe,Nom,Article,Adjectif,Préposition |
||
| 4674 | bpr | 34 | :Le|Art,petit|Adj,chat|N,boit|V,du|Art,lait.|N |
| 35 | :Le|Art,chat|N,boit|V,du|Art,lait|N,dans|Prep,un|Art,bol.|N |
||
| 4188 | bpr | 36 | </pre> |
| 7718 | bpr | 37 | Dans ce cas, les données principales ne seront pas prises en compte. |
| 4188 | bpr | 38 | Sinon, remplissez les données principales. |
| 39 | |||
| 40 | \text{file=} |
||
| 41 | |||
| 42 | :Nature des objets |
||
| 43 | \text{nom_nature=Verbe,Nom,Article,Adjectif,Préposition} |
||
| 44 | |||
| 45 | :Nature des mots (code) |
||
| 46 | C'est ce code qui sera utilisé dans les données principales. |
||
| 47 | \text{Nature=V,N,Art,Adj,Prep} |
||
| 48 | |||
| 13716 | obado | 49 | :Données principales |
| 7718 | bpr | 50 | Une phrase par ligne : les mots (ou groupes de mots) de la phrase sont séparés par des virgules. Après chaque mot, |
| 5907 | bpr | 51 | séparé du mot par la barre verticale <span class="tt">|</span>, est écrit la nature ou l'attribut du mot telle |
| 7718 | bpr | 52 | qu'il a été écrit dans le champ <span class="tt">Nature des mots (code)</span>. Si le mot (ou groupe de mots) |
| 4188 | bpr | 53 | n'est pas suivi d'une barre verticale |
| 7718 | bpr | 54 | et d'un attribut, il n'est pas proposé dans la liste des mots à placer, |
| 4188 | bpr | 55 | mais est écrit dans la phrase d'introduction. |
| 56 | |||
| 57 | \text{data=Le|Art,petit|Adj,chat|N,boit|V,du|Art,lait|N |
||
| 58 | Le|Art,chat|N,boit|V,du|Art,lait|N,dans|Prep,un|Art,bol|N |
||
| 59 | Le,chat|N,boit|V,du,lait|N,dans|Prep,un,bol|N} |
||
| 60 | |||
| 5797 | bpr | 61 | :Mise en aléatoire par des accolades emboitables |
| 62 | $embraced_randitem |
||
| 63 | \text{accolade=item(1,1 oui, |
||
| 64 | 2 non)} |
||
| 4188 | bpr | 65 | |
| 66 | :%%%%%%%%%%%%%% Rien à modifier avant l'énoncé %%%%%%%%%%%%%%%% |
||
| 13488 | obado | 67 | |
| 68 | ##s'il y a un nom de fichier dans file, utilise le fichier, sinon utilise data |
||
| 4188 | bpr | 69 | \if{\file notsametext}{ |
| 70 | \text{data=wims(randrecord \file)} |
||
| 71 | \text{Nature=wims(record 0 of \file)} |
||
| 72 | \text{nom_nature=row(2,\Nature)} |
||
| 73 | \text{Nature=row(1,\Nature)} |
||
| 74 | }{ |
||
| 75 | \text{data=randomrow(\data)} |
||
| 5797 | bpr | 76 | } |
| 77 | \text{accolade=wims(word 1 of \accolade)} |
||
| 78 | |||
| 79 | \text{data=\accolade=1 ? wims(embraced randitem \data)} |
||
| 4188 | bpr | 80 | \integer{cnt=items(\data)} |
| 81 | \integer{Nat_cnt=items(\Nature)} |
||
| 82 | \text{phrase=} |
||
| 83 | \text{nature=} |
||
| 84 | \text{tableau=wims(makelist videxxx for x = 1 to \Nat_cnt)} |
||
| 85 | \text{tableau=wims(items2lines \tableau)} |
||
| 86 | \for{u=1 to \cnt}{ |
||
| 87 | \text{w=\data[\u]} |
||
| 88 | \text{w=wims(replace internal | by , in \w)} |
||
| 89 | \text{phrase=\phrase \w[1]} |
||
| 90 | \for{h = 1 to \Nat_cnt}{ |
||
| 91 | \if{\w[2] issametext \Nature[\h]}{ |
||
| 92 | \text{ligne=row(\h,\tableau)} |
||
| 93 | \text{ligne=videxxx isitemof \ligne ? \w[1]:\ligne,\w[1]} |
||
| 94 | \text{tableau=wims(replace line number \h by \ligne in \tableau)} |
||
| 95 | \text{nature=wims(append item \w[2] to \nature)} |
||
| 96 | } |
||
| 97 | } |
||
| 98 | } |
||
| 99 | \matrix{tableau=\tableau} |
||
| 100 | \text{nature1=wims(listuniq \nature)} |
||
| 101 | \text{nature=} |
||
| 102 | \for{ a in \Nature}{ |
||
| 103 | \text{nature=\a isin \nature1 ? wims(append item \a to \nature)} |
||
| 104 | } |
||
| 105 | \text{question=} |
||
| 106 | \text{nom_question=} |
||
| 107 | \text{Step=} |
||
| 108 | \for{a in \nature}{ |
||
| 109 | \text{qu=position(\a,\Nature)} |
||
| 110 | \text{Step=wims(append item r \qu to \Step)} |
||
| 111 | \text{question=wims(append item \qu to \question)} |
||
| 112 | \text{nom_question=wims(append item \nom_nature[\qu] to \nom_question)} |
||
| 113 | } |
||
| 114 | \integer{question_cnt=items(\question)} |
||
| 115 | \steps{\Step} |
||
| 116 | |||
| 13488 | obado | 117 | \statement{ |
| 118 | <div class="instruction">\instruction</div> |
||
| 13741 | obado | 119 | <div class="wims_question">\phrase.</div> |
| 13488 | obado | 120 | <table class="wimsnoborder"> |
| 121 | \for{ s = 1 to \question_cnt}{ |
||
| 122 | <tr> |
||
| 123 | <th>\nom_question[\s]</th> |
||
| 124 | <td>\embed{\Step[\s],80 x 30 x \cnt}</td> |
||
| 125 | </tr> |
||
| 126 | } |
||
| 4188 | bpr | 127 | </table> |
| 128 | } |
||
| 129 | \answer{\nom_question[1]}{\tableau[1;]}{type=dragfill}{option=noorder} |
||
| 130 | \answer{\nom_question[2]}{\tableau[2;]}{type=dragfill}{option=noorder} |
||
| 131 | \answer{\nom_question[3]}{\tableau[3;]}{type=dragfill}{option=noorder} |
||
| 132 | \answer{\nom_question[4]}{\tableau[4;]}{type=dragfill}{option=noorder} |
||
| 133 | \answer{\nom_question[5]}{\tableau[5;]}{type=dragfill}{option=noorder} |
||
| 134 | \answer{\nom_question[6]}{\tableau[6;]}{type=dragfill}{option=noorder} |
||
| 135 | \answer{\nom_question[7]}{\tableau[7;]}{type=dragfill}{option=noorder} |
||
| 136 | \answer{\nom_question[8]}{\tableau[8;]}{type=dragfill}{option=noorder} |
||
| 137 | \answer{\nom_question[9]}{\tableau[9;]}{type=dragfill}{option=noorder} |
||
| 138 | \answer{\nom_question[10]}{\tableau[10;]}{type=dragfill}{option=noorder} |