Subversion Repositories wimsdev

Rev

Rev 15404 | 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"
3786 bpr 4
 
12169 mquerol 5
:Classificar objectes per les seves propietats en una taula.
3786 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, marcant o no en el quadre.
3786 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.
13476 obado 17
</p><p class="wims_credits">
15179 lemaire 18
  Autor del model: <a href="mailto:bernadette.m.riou@orange.fr">Bernadette Perrin-Riou</a></p>
3786 bpr 19
 
20
:%%%%%%%%%%%%%%%%%      ATTENTION      %%%%%%%%%%%%%%%%%%%%
21
 
22
Enlevez l'en-tête ci-dessus si vous détruisez les balises pour le modèle !
23
(Ce sont les lignes qui commencent par un ':'.)
24
Sinon l'exercice risque de ne pas pouvoir repasser sous Createxo.
25
 
26
:%%%%%%%% Paramètres d'exemples à redéfinir %%%%%%%%%%%%%%%%%
27
 
12169 mquerol 28
:\title{Taula per omplir (checkbox)}
5147 bpr 29
:\author{Bernadette, Perrin-Riou}
4416 bpr 30
:\email{bpr@math.u-psud.fr}
6132 bpr 31
:\credits{}
13476 obado 32
 
12169 mquerol 33
:Enunciat
3786 bpr 34
\text{instruction= Remplir le tableau.}
35
 
12169 mquerol 36
:Nombre d'objectes triats a l'atzar
3786 bpr 37
\integer{N=3}
4416 bpr 38
 
12169 mquerol 39
:Nom del fitxer
40
Ompliu només si voleu utilitzar un fitxer de dades (en un mòdul OEF).
3786 bpr 41
\text{file=}
12169 mquerol 42
del tipus
4137 bpr 43
<pre>
12169 mquerol 44
 poils,plumes,quatre pattes,ailes
45
 :pie,0,1,0,1
4416 bpr 46
 :boeuf,1,0,1,0
4137 bpr 47
</pre>
12169 mquerol 48
En aquest cas, no es tindrà en compte les dades següents.
49
En cas contrari, ompliu les dades.
3786 bpr 50
 
12169 mquerol 51
:Llista d'atributs
52
\text{attribut=poils,plumes,quatre pattes,ailes}
13476 obado 53
 
12169 mquerol 54
:Dades
55
Una línia per objecte.
56
\text{data=pie,0,1,0,1
3786 bpr 57
boeuf,1,0,1,0
58
chat,1,0,1,0
59
moustique,0,0,0,1}
13476 obado 60
 
12169 mquerol 61
:Text o imatges per indicar una resposta bona o dolenta
62
Aquest text es mostra al moment de la resposta, per defecte apareixen les imatges.
4709 bpr 63
\text{nonoui=}
3786 bpr 64
 
65
:%%%%%%%%%%%%%% Rien à modifier avant l'énoncé %%%%%%%%%%%%%%%%
66
 
67
\text{size=50,50}
68
\integer{w=\size[1]+10}
13716 obado 69
\css{<style>
13483 obado 70
  .big_check{text-align: center}
15071 lemaire 71
  .cross{color:black; font-size:20pt;}
13483 obado 72
  @supports (zoom:2){
73
    .big_check>input{zoom: 1.4;}
74
  }
75
  @supports not (zoom:2){
76
    .big_check>input{transform: scale(1.4);}
77
  }
78
  .big_check>label{color:transparent;width:1px;height:1px;position: absolute;}
3786 bpr 79
 </style>}
17234 bpr 80
\text{nonoui=\nonoui issametext ? <img src="scripts/authors/jm.evers/gifs/ok.gif" width="15">,<img src="scripts/authors/jm.evers/gifs/nok.gif" width="15">}
3786 bpr 81
\if{\file notsametext}{
4416 bpr 82
  \text{file=randitem(\file)}
3786 bpr 83
  \text{attribut=wims(record 0 of \file)}
84
  \integer{datacnt=wims(recordcnt \file)}
85
  \integer{N=min(\N,\datacnt)}
86
  \text{choix=shuffle(\datacnt)}
87
  \text{choix=\choix[1..\N]}
88
  \text{data=}
89
  \for{s in \choix}{
90
    \text{data=\data
91
wims(record \s of \file)}
4416 bpr 92
  }
93
  \matrix{data=\data}
94
  \text{data=wims(replace internal ;; by ; in \data)}
95
}{
3786 bpr 96
  \text{objet_cnt=rows(\data)}
97
  \integer{N=min(\N,\objet_cnt)}
4416 bpr 98
  \text{bat=shuffle(\objet_cnt)}
99
  \text{bat=\bat[1..\N]}
100
  \matrix{data=\data}
101
  \matrix{data=\data[\bat;]}
3786 bpr 102
}
103
\integer{attribut_cnt=items(\attribut)}
104
\text{Data=}
105
\text{R=}
106
\for{u=1 to \N}{
107
  \for{v=2 to \attribut_cnt+1}{
108
    \integer{uu=(\u-1)*\attribut_cnt + \v -1}
109
    \text{Data=\data[\u;\v]=1? wims(append item \uu to \Data)}
110
  }
111
}
112
\text{C=wims(makelist x for x=1 to \N*\attribut_cnt)}
113
\text{C1=wims(makelist x for x=1 to \N*\attribut_cnt)}
114
\text{nstep=r1}
115
\nextstep{\nstep}
15071 lemaire 116
\text{tab=wims(makelist c for x=1 to \attribut_cnt+1)}
117
\text{tab=wims(replace internal , by | in |\tab|)}
118
\text{latexsrc=\begin{tabular}{\tab}\hline}
119
\for{lk=1 to \attribut_cnt}{
120
  \text{latexsrc=\latexsrc&\attribut[\lk]}
121
}
122
\text{latexsrc=\latexsrc \\\hline}
123
\text{latexsol=\latexsrc}
124
\for{jl=1 to \N}{
125
  \text{latexsrc=\latexsrc
126
  \data[\jl;1]}
127
  \text{latexsol=\latexsol
128
  \data[\jl;1]}
129
  \for{kl=1 to \attribut_cnt}{
130
    \integer{lkk=(\jl-1)*\attribut_cnt + \kl}
131
    \text{latexsrc=\latexsrc &}
132
    \text{latexsol=\latexsol &}
133
    \if{\lkk isitemof  \Data}{\text{latexsol=\latexsol \(\times\) }}
134
  }
135
  \text{latexsrc=\latexsrc \\\hline}
136
  \text{latexsol=\latexsol \\\hline}
137
}
138
\text{latexsrc=\latexsrc
139
\end{tabular}}
140
\text{latexsol=\latexsol
141
\end{tabular}}
13483 obado 142
 
15071 lemaire 143
\text{givegood=slib(oef/env givegood)}
144
\text{givegood=\givegood issametext ? 1}
145
 
4416 bpr 146
\statement{
13483 obado 147
  <div class="instruction">\instruction</div>
148
  <table class="wimstable">
15071 lemaire 149
    <thead>
13483 obado 150
    <tr>
15071 lemaire 151
      <td></td>
152
      \for{k=1 to \attribut_cnt}{<th scope="col">\attribut[\k]</th>}
13483 obado 153
    </tr>
15071 lemaire 154
    </thead>
155
    <tbody>
13483 obado 156
    \for{j=1 to \N}{
157
      <tr>
15071 lemaire 158
        <th scope="row">\data[\j;1]</th>
13483 obado 159
        \for{k=1 to \attribut_cnt}{
160
          \if{\step=1}{
161
            <td class="big_check">\embed{r1,\C[(\attribut_cnt)*(\j-1)+\k]}</td>
162
          }{
15071 lemaire 163
            <td class="big_check">\C[(\attribut_cnt)*(\j-1)+\k]</td>
13483 obado 164
          }
165
        }
166
      </tr>
3786 bpr 167
    }
15071 lemaire 168
    </tbody>
13483 obado 169
  </table>
3786 bpr 170
}
13483 obado 171
 
3786 bpr 172
\answer{}{\Data;\C1}{type=checkbox}{option=split noanalyzeprint nonstop}
173
\text{nstep=}
174
\text{C=}
15071 lemaire 175
\if{\givegood=0}{
176
  \text{feedbackbon=}
177
  \text{feedbackfaux=}
178
}
179
{
180
  \text{feedbackbon=<span class="oef_indgood">\nonoui[1]</span>}
181
  \text{feedbackfaux=<span class="oef_indbad">\nonoui[2]</span>}
182
}
183
\text{croix=<span class="cross">&#9745;</span>}
184
\text{nocroix=<span class="cross">&#9744;</span>}
185
\text{lignef=}
3786 bpr 186
\for{u=1 to \N}{
187
  \for{v=2 to \attribut_cnt+1}{
188
    \integer{uu=(\u-1)*\attribut_cnt + \v -1}
15071 lemaire 189
    \text{C=\uu isitemof \reply1 and \uu isitemof \Data ? wims(append item  \croix \feedbackbon  to \C)}
190
    \if{\uu isitemof \reply1 and \uu notitemof \Data}{
191
      \text{C= wims(append item \croix \feedbackfaux  to \C)}
192
      \text{lignef=wims(append item \u to \lignef)}
193
      }
194
      {\if{\uu notitemof \reply1 and \uu isitemof \Data}{
15404 lemaire 195
         \text{C= wims(append item \nocroix \feedbackfaux  to \C)}
15071 lemaire 196
         \text{lignef=wims(append item \u to \lignef)}
197
         }
198
      }
199
    \text{C=\uu notitemof \reply1 and \uu notitemof \Data ? wims(append item \nocroix \feedbackbon to \C)}
3786 bpr 200
  }
4709 bpr 201
}
202
 
15071 lemaire 203
\feedback{\givegood>0}{\nonoui[1] : votre réponse est correcte, \nonoui[2] : votre réponse n'est pas correcte.
204
}
205
\integer{nblignef=items(\lignef)}
206
\feedback{\givegood=0 and \nblignef>0}{<div class="feedback oef_indbad">\if{\nblignef=1}{
207
La ligne \lignef du tableau n'est pas remplie}{Les lignes \lignef[1..-2] et \lignef[-1] du tableau ne sont pas remplies} correctement.</div>}
4709 bpr 208
 
15071 lemaire 209
 
210
\latex{
211
\begin{statement}
212
\instruction
213
\newline
214
\latexsrc
215
\end{statement}
216
\begin{solution}\
217
\begin{center}
218
\latexsol
219
\end{center}
220
\end{solution}
11375 bpr 221
}