Rev 13716 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
11375 | bpr | 1 | type=classify |
13716 | obado | 2 | textarea="data instruction" |
3 | iEdit="instruction" |
||
3788 | bpr | 4 | |
12169 | mquerol | 5 | :Classificar objectes per les seves propietats en una taula. |
3788 | bpr | 6 | |
12169 | mquerol | 7 | Presentem una llista d'objectes i una llista d'atributs (propietats). Heu d'omplir |
8 | una taula segons si els objectes verifiquen les propietats o no, omplint un quadre. |
||
3788 | bpr | 9 | |
10 | <p> |
||
12169 | mquerol | 11 | Per construir un exercici amb aquest model, només cal que introduïu la llista |
12 | d'atributs i una llista d'objectes on s'indiqui si verifiquen o no |
||
13 | les propietats en el mateix ordre que els atributs (amb un 0 o un 1) |
||
13476 | obado | 14 | </p><p> |
12169 | mquerol | 15 | Aquest exercici es pot transformar fàcilment per ser inclòs en un mòdul OEF |
16 | si voleu posar les dades en un fitxer auxiliar. Per això, |
||
17 | només has d'omplir el camp \text{file=} posant el nom del fitxer |
||
18 | (una vegada que l'exercici s'ha transferit a un mòdul OEF d'un compte de Modtool). |
||
13476 | obado | 19 | </p><p class="wims_credits"> |
15179 | lemaire | 20 | Autor del model: <a href="mailto:bernadette.m.riou@orange.fr">Bernadette Perrin-Riou</a></p> |
3788 | bpr | 21 | |
22 | :%%%%%%%%%%%%%%%%% ATTENTION %%%%%%%%%%%%%%%%%%%% |
||
23 | |||
24 | Enlevez l'en-tête ci-dessus si vous détruisez les balises pour le modèle ! |
||
25 | (Ce sont les lignes qui commencent par un ':'.) |
||
26 | Sinon l'exercice risque de ne pas pouvoir repasser sous Createxo. |
||
27 | |||
28 | :%%%%%%%% Paramètres d'exemples à redéfinir %%%%%%%%%%%%%%%%% |
||
29 | |||
12169 | mquerol | 30 | :\title{Taula per omplir (fill)} |
6582 | bpr | 31 | :\author{Bernadette, Perrin-Riou} |
32 | :\email{bpr@math.u-psud.fr} |
||
33 | :\credits{} |
||
13476 | obado | 34 | |
12169 | mquerol | 35 | :Enunciat |
3788 | bpr | 36 | \text{instruction= Remplir le tableau.} |
37 | |||
12169 | mquerol | 38 | :Nombre d'objectes triats a l'atzar |
3788 | bpr | 39 | \integer{N=3} |
4416 | bpr | 40 | |
12169 | mquerol | 41 | :Nom del fitxer |
42 | Ompliu només si voleu transferir el codi d'aquest exercici a un compte de Modtool |
||
43 | i utilitzeu un fitxer de dades (en un mòdul OEF) |
||
44 | del tipus |
||
4049 | bpr | 45 | <pre> |
12169 | mquerol | 46 | poils,plumes,quatre pattes,ailes |
47 | :pie,0,1,0,1 |
||
4049 | bpr | 48 | :boeuf,1,0,1,0 |
49 | </pre> |
||
12169 | mquerol | 50 | En aquest cas, no es tindrà en compte les dades següents. |
51 | En cas contrari, ompliu les dades. |
||
3788 | bpr | 52 | |
4049 | bpr | 53 | \text{file=} |
13476 | obado | 54 | |
12169 | mquerol | 55 | :Llista d'atributs |
56 | \text{attribut=poils,plumes,quatre pattes,ailes} |
||
13476 | obado | 57 | |
12169 | mquerol | 58 | :Dades |
59 | Una línia per objecte. |
||
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} |
||
13476 | obado | 64 | |
12169 | mquerol | 65 | :Codi per les etiquetes a inserir a la taula |
66 | Introduïu el nom dels objectes seguit dels números 0 o 1, segons que l'atribut sigui cert o fals, |
||
67 | un objecte per línia. |
||
3788 | bpr | 68 | \text{nonoui=--,X} |
69 | |||
70 | :%%%%%%%%%%%%%% Rien à modifier avant l'énoncé %%%%%%%%%%%%%%%% |
||
71 | maximum 40 cases à remplir |
||
72 | |||
73 | \integer{w=\size[1]+10} |
||
74 | |||
13716 | obado | 75 | \css{<style> |
13489 | obado | 76 | .question {margin: 2% 2%;padding: 1%;} |
77 | .wimstable td, th {text-align:center;min-width:50px;} |
||
78 | </style>} |
||
79 | |||
3788 | bpr | 80 | \if{\file notsametext}{ |
4416 | bpr | 81 | \text{file=randitem(\file)} |
3788 | bpr | 82 | \text{attribut=wims(record 0 of \file)} |
83 | \integer{datacnt=wims(recordcnt \file)} |
||
84 | \integer{N=min(\N,\datacnt)} |
||
85 | \text{choix=shuffle(\datacnt)} |
||
86 | \text{choix=\choix[1..\N]} |
||
87 | \text{data=} |
||
88 | \for{s in \choix}{ |
||
89 | \text{data=\data |
||
90 | wims(record \s of \file)} |
||
4416 | bpr | 91 | } |
92 | \matrix{data=\data} |
||
93 | \text{data=wims(replace internal ;; by ; in \data)} |
||
94 | }{ |
||
3788 | bpr | 95 | \text{objet_cnt=rows(\data)} |
96 | \integer{N=min(\N,\objet_cnt)} |
||
4416 | bpr | 97 | \text{bat=shuffle(\objet_cnt)} |
98 | \text{bat=\bat[1..\N]} |
||
99 | \matrix{data=\data} |
||
100 | \matrix{data=\data[\bat;]} |
||
3788 | bpr | 101 | } |
102 | \integer{attribut_cnt=items(\attribut)} |
||
103 | \integer{ch_cnt=items(\nonoui)} |
||
104 | \text{Data=} |
||
105 | \text{STEP=} |
||
106 | \for{u=1 to \N}{ |
||
107 | \text{STEP=\STEP |
||
108 | wims(makelist r x for x = (\u-1)*\attribut_cnt + 1 to (\u)*\attribut_cnt)} |
||
109 | \text{Data=wims(append item \data[\u;2..-1] to \Data)} |
||
6582 | bpr | 110 | \for{c=0 to \ch_cnt-1}{ |
5147 | bpr | 111 | \text{Data=wims(replace internal \c by \nonoui[\c+1] in \Data)} |
6582 | bpr | 112 | } |
5147 | bpr | 113 | } |
3788 | bpr | 114 | \matrix{STEP=\STEP} |
115 | \text{STEP1=wims(replace internal ; by , in \STEP)} |
||
116 | \text{STEP1=wims(nonempty items \STEP1)} |
||
117 | \steps{\STEP1} |
||
6132 | bpr | 118 | |
13489 | obado | 119 | \statement{ |
120 | <div class="instruction">\instruction</div> |
||
121 | <table class="wimstable"> |
||
122 | <tr> |
||
123 | <th></th> |
||
124 | \for{k=1 to \attribut_cnt}{<th>\attribut[\k]</th>} |
||
125 | </tr> |
||
126 | \for{j=1 to \N}{ |
||
127 | <tr> |
||
128 | <th>\data[\j;1]</th> |
||
129 | \for{k=1 to \attribut_cnt}{ |
||
130 | <td>\embed{\STEP[\j;\k], \size[1] x \size[2]}</td> |
||
131 | } |
||
132 | </tr> |
||
3788 | bpr | 133 | } |
13489 | obado | 134 | </table> |
3788 | bpr | 135 | } |
6132 | bpr | 136 | |
3788 | bpr | 137 | \answer{}{\Data[1]}{type=clickfill} |
138 | \answer{}{\Data[2]}{type=clickfill} |
||
139 | \answer{}{\Data[3]}{type=clickfill} |
||
140 | \answer{}{\Data[4]}{type=clickfill} |
||
141 | \answer{}{\Data[5]}{type=clickfill} |
||
142 | \answer{}{\Data[6]}{type=clickfill} |
||
143 | \answer{}{\Data[7]}{type=clickfill} |
||
144 | \answer{}{\Data[8]}{type=clickfill} |
||
145 | \answer{}{\Data[9]}{type=clickfill} |
||
146 | \answer{}{\Data[10]}{type=clickfill} |
||
147 | \answer{}{\Data[11]}{type=clickfill} |
||
148 | \answer{}{\Data[12]}{type=clickfill} |
||
149 | \answer{}{\Data[13]}{type=clickfill} |
||
150 | \answer{}{\Data[14]}{type=clickfill} |
||
151 | \answer{}{\Data[15]}{type=clickfill} |
||
152 | \answer{}{\Data[16]}{type=clickfill} |
||
153 | \answer{}{\Data[17]}{type=clickfill} |
||
154 | \answer{}{\Data[18]}{type=clickfill} |
||
155 | \answer{}{\Data[19]}{type=clickfill} |
||
156 | \answer{}{\Data[20]}{type=clickfill} |
||
157 | \answer{}{\Data[21]}{type=clickfill} |
||
158 | \answer{}{\Data[22]}{type=clickfill} |
||
159 | \answer{}{\Data[23]}{type=clickfill} |
||
160 | \answer{}{\Data[24]}{type=clickfill} |
||
161 | \answer{}{\Data[25]}{type=clickfill} |
||
162 | \answer{}{\Data[26]}{type=clickfill} |
||
163 | \answer{}{\Data[27]}{type=clickfill} |
||
164 | \answer{}{\Data[28]}{type=clickfill} |
||
165 | \answer{}{\Data[30]}{type=clickfill} |
||
166 | \answer{}{\Data[31]}{type=clickfill} |
||
167 | \answer{}{\Data[32]}{type=clickfill} |
||
168 | \answer{}{\Data[33]}{type=clickfill} |
||
169 | \answer{}{\Data[34]}{type=clickfill} |
||
170 | \answer{}{\Data[35]}{type=clickfill} |
||
171 | \answer{}{\Data[36]}{type=clickfill} |
||
172 | \answer{}{\Data[37]}{type=clickfill} |
||
173 | \answer{}{\Data[38]}{type=clickfill} |
||
174 | \answer{}{\Data[39]}{type=clickfill} |
||
12169 | mquerol | 175 | \answer{}{\Data[40]}{type=clickfill} |