Subversion Repositories wimsdev

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3788 bpr 1
type=datalist
2
textarea="data"
3
 
4
:Classer les objets selon leurs propriétés dans un tableau.
5
 
6
On présente une liste d'objets et une liste d'attributs (propriétés). Il faut remplir 
4416 bpr 7
un tableau selon que les objets vérifient ou non les propriétés en remplissant une case.
3788 bpr 8
 
9
<p>
10
Pour construire un exercice avec ce modèle, il suffit d'entrer la liste
11
des attributs et une liste d'objets en indiquant s'ils vérifient ou non
12
les propriétés dans le même ordre que les attributs (avec un 0 ou un 1)
13
<p>
14
Cet exercice peut facilement être transformé pour être inclus dans un module OEF
3791 bpr 15
si l'on désire mettre les données dans un fichier auxiliaire. Pour cela,
16
il suffit de remplir le champ \text{file=} en mettant le nom du fichier
17
(une fois l'exercice transféré dans un module OEF d'un compte Modtool).
3788 bpr 18
<p>
19
Auteur du modèle : Bernadette Perrin-Riou <bpr@math.u-psud.fr>
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
 
29
:
30
\title{Tableau à remplir (fill)}
31
:
32
\author{Bernadette Perrin-Riou}
33
:
34
\email{bpr@math.u-psud.fr}
35
:Instruction
36
\text{instruction= Remplir le tableau.}
37
 
38
:Nombre d'objets tirés au sort
39
\integer{N=3}
4416 bpr 40
 
3788 bpr 41
:Nom du fichier
4416 bpr 42
Ne remplissez que si vous désirez transférer le source de cet exercice dans un compte Modtool 
4049 bpr 43
et utiliser un fichier de données (dans un module OEF)
3788 bpr 44
du type
4049 bpr 45
<pre>
46
 poils,plumes,quatre membres,ailes
47
 :pie,0,1,1,1
48
 :boeuf,1,0,1,0
49
</pre>
50
Dans ce cas, les données suivantes ne seront pas prises en compte. 
51
Sinon, remplissez les données.
3788 bpr 52
 
4049 bpr 53
\text{file=}
3788 bpr 54
:Liste des attributs
55
\text{attribut=poils,plumes,quatre membres,ailes}
56
:Données
57
une ligne par objets.
58
\text{data=pie,0,1,1,1
59
boeuf,1,0,1,0
60
chat,1,0,1,0
61
moustique,0,0,0,1}
62
:Textes pour la réponse
3791 bpr 63
mettre les textes correspondant aux nombres 0,1, ... dans les données des attributs
3788 bpr 64
\text{nonoui=--,X}
65
 
66
:%%%%%%%%%%%%%% Rien à modifier avant l'énoncé %%%%%%%%%%%%%%%%
67
maximum 40 cases à remplir
68
 
69
\integer{w=\size[1]+10}
70
 
71
\css{<style type="text/css">
72
   .question {background-color: #FFFFCC;margin: 2% 2%;padding: 1%;}
73
   table.tableau {border:solid 1px;
74
    border-collapse:collapse;}
75
    table.tableau td, th {text-align:center;border:solid 1px;width:55px;}
76
   ol li {list-style: upper-alpha; }
77
    table.tableau th { background-color:#CCCFFF;}
78
 </style>}
79
\if{\file notsametext}{
4416 bpr 80
  \text{file=randitem(\file)}
3788 bpr 81
  \text{attribut=wims(record 0 of \file)}
82
  \integer{datacnt=wims(recordcnt \file)}
83
  \integer{N=min(\N,\datacnt)}
84
  \text{choix=shuffle(\datacnt)}
85
  \text{choix=\choix[1..\N]}
86
  \text{data=}
87
  \for{s in \choix}{
88
    \text{data=\data
89
wims(record \s of \file)}
4416 bpr 90
  }
91
  \matrix{data=\data}
92
  \text{data=wims(replace internal ;; by ; in \data)}
93
}{
3788 bpr 94
  \text{objet_cnt=rows(\data)}
95
  \integer{N=min(\N,\objet_cnt)}
4416 bpr 96
  \text{bat=shuffle(\objet_cnt)}
97
  \text{bat=\bat[1..\N]}
98
  \matrix{data=\data}
99
  \matrix{data=\data[\bat;]}
3788 bpr 100
}
101
\integer{attribut_cnt=items(\attribut)}
102
\integer{ch_cnt=items(\nonoui)}
103
\for{c=0 to \ch_cnt-1}{
104
 \matrix{data=wims(replace internal \c by \nonoui[\c+1] in \data)}
105
}
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)}
112
  }
113
\matrix{STEP=\STEP}
114
\text{STEP1=wims(replace internal ; by , in \STEP)}
115
\text{STEP1=wims(nonempty items \STEP1)}
116
\steps{\STEP1}
4416 bpr 117
\statement{<div class="question">\instruction
3788 bpr 118
<center>
119
<table class="tableau"><tr> <th></th>
120
\for{k=1 to \attribut_cnt}{<th>\attribut[\k]</th>}
121
<tr>
122
\for{j=1 to \N}{ 
123
  <tr><th>\data[\j;1]</th>
124
   \for{k=1 to \attribut_cnt}{
125
     <td>\embed{\STEP[\j;\k], \size[1] x \size[2]}</td>
126
    }
127
  </tr>
128
}
129
</table>
130
</center>
131
</div>
132
}
133
\answer{}{\Data[1]}{type=clickfill}
134
\answer{}{\Data[2]}{type=clickfill}
135
\answer{}{\Data[3]}{type=clickfill}
136
\answer{}{\Data[4]}{type=clickfill}
137
\answer{}{\Data[5]}{type=clickfill}
138
\answer{}{\Data[6]}{type=clickfill}
139
\answer{}{\Data[7]}{type=clickfill}
140
\answer{}{\Data[8]}{type=clickfill}
141
\answer{}{\Data[9]}{type=clickfill}
142
\answer{}{\Data[10]}{type=clickfill}
143
\answer{}{\Data[11]}{type=clickfill}
144
\answer{}{\Data[12]}{type=clickfill}
145
\answer{}{\Data[13]}{type=clickfill}
146
\answer{}{\Data[14]}{type=clickfill}
147
\answer{}{\Data[15]}{type=clickfill}
148
\answer{}{\Data[16]}{type=clickfill}
149
\answer{}{\Data[17]}{type=clickfill}
150
\answer{}{\Data[18]}{type=clickfill}
151
\answer{}{\Data[19]}{type=clickfill}
152
\answer{}{\Data[20]}{type=clickfill}
153
\answer{}{\Data[21]}{type=clickfill}
154
\answer{}{\Data[22]}{type=clickfill}
155
\answer{}{\Data[23]}{type=clickfill}
156
\answer{}{\Data[24]}{type=clickfill}
157
\answer{}{\Data[25]}{type=clickfill}
158
\answer{}{\Data[26]}{type=clickfill}
159
\answer{}{\Data[27]}{type=clickfill}
160
\answer{}{\Data[28]}{type=clickfill}
161
\answer{}{\Data[30]}{type=clickfill}
162
\answer{}{\Data[31]}{type=clickfill}
163
\answer{}{\Data[32]}{type=clickfill}
164
\answer{}{\Data[33]}{type=clickfill}
165
\answer{}{\Data[34]}{type=clickfill}
166
\answer{}{\Data[35]}{type=clickfill}
167
\answer{}{\Data[36]}{type=clickfill}
168
\answer{}{\Data[37]}{type=clickfill}
169
\answer{}{\Data[38]}{type=clickfill}
170
\answer{}{\Data[39]}{type=clickfill}
171
\answer{}{\Data[40]}{type=clickfill}
172