Rev 14600 | 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" |
||
| 3788 | bpr | 4 | |
| 5 | :Classer les objets selon leurs propriétés dans un tableau. |
||
| 6 | |||
| 7718 | bpr | 7 | On présente une liste d'objets et une liste d'attributs (propriétés). Il faut remplir |
| 4416 | bpr | 8 | un tableau selon que les objets vérifient ou non les propriétés en remplissant une case. |
| 3788 | bpr | 9 | |
| 10 | <p> |
||
| 13473 | obado | 11 | Pour construire un exercice avec ce modèle, il suffit d'entrer la liste |
| 12 | des attributs et une liste d'objets en indiquant s'ils vérifient ou non |
||
| 13 | les propriétés dans le même ordre que les attributs (avec un 0 ou un 1) |
||
| 14 | </p><p> |
||
| 15 | Cet exercice peut facilement être transformé pour être inclus dans un module OEF |
||
| 16 | si l'on désire mettre les données dans un fichier auxiliaire. Pour cela, |
||
| 17 | il suffit de remplir le champ \text{file=} en mettant le nom du fichier |
||
| 18 | (une fois l'exercice transféré dans un module OEF d'un compte Modtool). |
||
| 19 | </p><p class="wims_credits"> |
||
| 20 | Auteur du modèle : <a href="mailto:bpr@math.u-psud.fr">Bernadette Perrin-Riou</a> |
||
| 21 | </p> |
||
| 3788 | bpr | 22 | |
| 23 | :%%%%%%%%%%%%%%%%% ATTENTION %%%%%%%%%%%%%%%%%%%% |
||
| 24 | |||
| 25 | Enlevez l'en-tête ci-dessus si vous détruisez les balises pour le modèle ! |
||
| 26 | (Ce sont les lignes qui commencent par un ':'.) |
||
| 27 | Sinon l'exercice risque de ne pas pouvoir repasser sous Createxo. |
||
| 28 | |||
| 29 | :%%%%%%%% Paramètres d'exemples à redéfinir %%%%%%%%%%%%%%%%% |
||
| 30 | |||
| 5724 | bpr | 31 | :\title{Tableau à remplir (fill)} |
| 32 | :\author{Bernadette, Perrin-Riou} |
||
| 33 | :\email{bpr@math.u-psud.fr} |
||
| 34 | :\credits{} |
||
| 13473 | obado | 35 | |
| 3788 | bpr | 36 | :Instruction |
| 37 | \text{instruction= Remplir le tableau.} |
||
| 38 | |||
| 39 | :Nombre d'objets tirés au sort |
||
| 40 | \integer{N=3} |
||
| 4416 | bpr | 41 | |
| 3788 | bpr | 42 | :Nom du fichier |
| 7718 | bpr | 43 | Ne remplissez que si vous désirez transférer le source de cet exercice dans un compte Modtool |
| 4049 | bpr | 44 | et utiliser un fichier de données (dans un module OEF) |
| 3788 | bpr | 45 | du type |
| 4049 | bpr | 46 | <pre> |
| 11364 | bpr | 47 | poils,plumes,quatre pattes,ailes |
| 48 | :pie,0,1,0,1 |
||
| 4049 | bpr | 49 | :boeuf,1,0,1,0 |
| 50 | </pre> |
||
| 7718 | bpr | 51 | Dans ce cas, les données suivantes ne seront pas prises en compte. |
| 4049 | bpr | 52 | Sinon, remplissez les données. |
| 13473 | obado | 53 | \text{file=} |
| 3788 | bpr | 54 | |
| 55 | :Liste des attributs |
||
| 11364 | bpr | 56 | \text{attribut=poils,plumes,quatre pattes,ailes} |
| 13473 | obado | 57 | |
| 3788 | bpr | 58 | :Données |
| 11357 | bpr | 59 | une ligne par objet. |
| 11364 | bpr | 60 | \text{data=pie,0,1,0,1 |
| 3788 | bpr | 61 | boeuf,1,0,1,0 |
| 62 | chat,1,0,1,0 |
||
| 63 | moustique,0,0,0,1} |
||
| 13473 | obado | 64 | |
| 5129 | bpr | 65 | :Code pour les étiquettes à insérer dans le tableau |
| 13473 | obado | 66 | Mettre le nom des objets suivi par les nombres 0 ou 1 selon que l'attribut est vrai ou faux, |
| 4674 | bpr | 67 | un objet par ligne. |
| 3788 | bpr | 68 | \text{nonoui=--,X} |
| 69 | |||
| 70 | :%%%%%%%%%%%%%% Rien à modifier avant l'énoncé %%%%%%%%%%%%%%%% |
||
| 13473 | obado | 71 | # maximum 40 cases à remplir |
| 3788 | bpr | 72 | |
| 73 | \integer{w=\size[1]+10} |
||
| 74 | |||
| 13716 | obado | 75 | \css{<style> |
| 14600 | obado | 76 | .tablefill td {text-align:center;min-width:50px;} |
| 13489 | obado | 77 | </style>} |
| 3788 | bpr | 78 | \if{\file notsametext}{ |
| 4416 | bpr | 79 | \text{file=randitem(\file)} |
| 3788 | bpr | 80 | \text{attribut=wims(record 0 of \file)} |
| 81 | \integer{datacnt=wims(recordcnt \file)} |
||
| 82 | \integer{N=min(\N,\datacnt)} |
||
| 83 | \text{choix=shuffle(\datacnt)} |
||
| 84 | \text{choix=\choix[1..\N]} |
||
| 85 | \text{data=} |
||
| 86 | \for{s in \choix}{ |
||
| 87 | \text{data=\data |
||
| 88 | wims(record \s of \file)} |
||
| 4416 | bpr | 89 | } |
| 90 | \matrix{data=\data} |
||
| 91 | \text{data=wims(replace internal ;; by ; in \data)} |
||
| 92 | }{ |
||
| 3788 | bpr | 93 | \text{objet_cnt=rows(\data)} |
| 94 | \integer{N=min(\N,\objet_cnt)} |
||
| 4416 | bpr | 95 | \text{bat=shuffle(\objet_cnt)} |
| 96 | \text{bat=\bat[1..\N]} |
||
| 97 | \matrix{data=\data} |
||
| 98 | \matrix{data=\data[\bat;]} |
||
| 3788 | bpr | 99 | } |
| 100 | \integer{attribut_cnt=items(\attribut)} |
||
| 101 | \integer{ch_cnt=items(\nonoui)} |
||
| 102 | \text{Data=} |
||
| 103 | \text{STEP=} |
||
| 104 | \for{u=1 to \N}{ |
||
| 105 | \text{STEP=\STEP |
||
| 106 | wims(makelist r x for x = (\u-1)*\attribut_cnt + 1 to (\u)*\attribut_cnt)} |
||
| 107 | \text{Data=wims(append item \data[\u;2..-1] to \Data)} |
||
| 6582 | bpr | 108 | \for{c=0 to \ch_cnt-1}{ |
| 5147 | bpr | 109 | \text{Data=wims(replace internal \c by \nonoui[\c+1] in \Data)} |
| 6582 | bpr | 110 | } |
| 5147 | bpr | 111 | } |
| 3788 | bpr | 112 | \matrix{STEP=\STEP} |
| 113 | \text{STEP1=wims(replace internal ; by , in \STEP)} |
||
| 114 | \text{STEP1=wims(nonempty items \STEP1)} |
||
| 115 | \steps{\STEP1} |
||
| 13489 | obado | 116 | |
| 13473 | obado | 117 | \statement{ |
| 16074 | bpr | 118 | <div class="wims_question">\instruction</div> |
| 14600 | obado | 119 | <table class="wimstable tablefill"> |
| 120 | <thead> |
||
| 13489 | obado | 121 | <tr> |
| 14600 | obado | 122 | <td></td> |
| 123 | \for{k=1 to \attribut_cnt}{<th scope="col">\attribut[\k]</th>} |
||
| 13489 | obado | 124 | </tr> |
| 14600 | obado | 125 | </thead> |
| 126 | <tbody> |
||
| 13489 | obado | 127 | \for{j=1 to \N}{ |
| 13473 | obado | 128 | <tr> |
| 14600 | obado | 129 | <th scope="row">\data[\j;1]</th> |
| 13489 | obado | 130 | \for{k=1 to \attribut_cnt}{ |
| 131 | <td>\embed{\STEP[\j;\k], \size[1] x \size[2]}</td> |
||
| 132 | } |
||
| 13473 | obado | 133 | </tr> |
| 13489 | obado | 134 | } |
| 14600 | obado | 135 | </tbody> |
| 13489 | obado | 136 | </table> |
| 3788 | bpr | 137 | } |
| 6132 | bpr | 138 | |
| 3788 | bpr | 139 | \answer{}{\Data[1]}{type=clickfill} |
| 140 | \answer{}{\Data[2]}{type=clickfill} |
||
| 141 | \answer{}{\Data[3]}{type=clickfill} |
||
| 142 | \answer{}{\Data[4]}{type=clickfill} |
||
| 143 | \answer{}{\Data[5]}{type=clickfill} |
||
| 144 | \answer{}{\Data[6]}{type=clickfill} |
||
| 145 | \answer{}{\Data[7]}{type=clickfill} |
||
| 146 | \answer{}{\Data[8]}{type=clickfill} |
||
| 147 | \answer{}{\Data[9]}{type=clickfill} |
||
| 148 | \answer{}{\Data[10]}{type=clickfill} |
||
| 149 | \answer{}{\Data[11]}{type=clickfill} |
||
| 150 | \answer{}{\Data[12]}{type=clickfill} |
||
| 151 | \answer{}{\Data[13]}{type=clickfill} |
||
| 152 | \answer{}{\Data[14]}{type=clickfill} |
||
| 153 | \answer{}{\Data[15]}{type=clickfill} |
||
| 154 | \answer{}{\Data[16]}{type=clickfill} |
||
| 155 | \answer{}{\Data[17]}{type=clickfill} |
||
| 156 | \answer{}{\Data[18]}{type=clickfill} |
||
| 157 | \answer{}{\Data[19]}{type=clickfill} |
||
| 158 | \answer{}{\Data[20]}{type=clickfill} |
||
| 159 | \answer{}{\Data[21]}{type=clickfill} |
||
| 160 | \answer{}{\Data[22]}{type=clickfill} |
||
| 161 | \answer{}{\Data[23]}{type=clickfill} |
||
| 162 | \answer{}{\Data[24]}{type=clickfill} |
||
| 163 | \answer{}{\Data[25]}{type=clickfill} |
||
| 164 | \answer{}{\Data[26]}{type=clickfill} |
||
| 165 | \answer{}{\Data[27]}{type=clickfill} |
||
| 166 | \answer{}{\Data[28]}{type=clickfill} |
||
| 167 | \answer{}{\Data[30]}{type=clickfill} |
||
| 168 | \answer{}{\Data[31]}{type=clickfill} |
||
| 169 | \answer{}{\Data[32]}{type=clickfill} |
||
| 170 | \answer{}{\Data[33]}{type=clickfill} |
||
| 171 | \answer{}{\Data[34]}{type=clickfill} |
||
| 172 | \answer{}{\Data[35]}{type=clickfill} |
||
| 173 | \answer{}{\Data[36]}{type=clickfill} |
||
| 174 | \answer{}{\Data[37]}{type=clickfill} |
||
| 175 | \answer{}{\Data[38]}{type=clickfill} |
||
| 176 | \answer{}{\Data[39]}{type=clickfill} |
||
| 177 | \answer{}{\Data[40]}{type=clickfill} |