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