Subversion Repositories wimsdev

Rev

Rev 12169 | Rev 13483 | 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
3786 bpr 2
textarea="data"
3
 
12169 mquerol 4
:Classificar objectes per les seves propietats en una taula.
3786 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, marcant o no en el quadre.
3786 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.
13476 obado 16
</p><p class="wims_credits">
17
  Autor del model: Bernadette Perrin-Riou <bpr@math.u-psud.fr></p>
3786 bpr 18
 
19
:%%%%%%%%%%%%%%%%%      ATTENTION      %%%%%%%%%%%%%%%%%%%%
20
 
21
Enlevez l'en-tête ci-dessus si vous détruisez les balises pour le modèle !
22
(Ce sont les lignes qui commencent par un ':'.)
23
Sinon l'exercice risque de ne pas pouvoir repasser sous Createxo.
24
 
25
:%%%%%%%% Paramètres d'exemples à redéfinir %%%%%%%%%%%%%%%%%
26
 
12169 mquerol 27
:\title{Taula per omplir (checkbox)}
5147 bpr 28
:\author{Bernadette, Perrin-Riou}
4416 bpr 29
:\email{bpr@math.u-psud.fr}
6132 bpr 30
:\credits{}
13476 obado 31
 
12169 mquerol 32
:Enunciat
3786 bpr 33
\text{instruction= Remplir le tableau.}
34
 
12169 mquerol 35
:Nombre d'objectes triats a l'atzar
3786 bpr 36
\integer{N=3}
4416 bpr 37
 
12169 mquerol 38
:Nom del fitxer
39
Ompliu només si voleu utilitzar un fitxer de dades (en un mòdul OEF).
3786 bpr 40
\text{file=}
12169 mquerol 41
del tipus
4137 bpr 42
<pre>
12169 mquerol 43
 poils,plumes,quatre pattes,ailes
44
 :pie,0,1,0,1
4416 bpr 45
 :boeuf,1,0,1,0
4137 bpr 46
</pre>
12169 mquerol 47
En aquest cas, no es tindrà en compte les dades següents.
48
En cas contrari, ompliu les dades.
3786 bpr 49
 
12169 mquerol 50
:Llista d'atributs
51
\text{attribut=poils,plumes,quatre pattes,ailes}
13476 obado 52
 
12169 mquerol 53
:Dades
54
Una línia per objecte.
55
\text{data=pie,0,1,0,1
3786 bpr 56
boeuf,1,0,1,0
57
chat,1,0,1,0
58
moustique,0,0,0,1}
13476 obado 59
 
12169 mquerol 60
:Text o imatges per indicar una resposta bona o dolenta
61
Aquest text es mostra al moment de la resposta, per defecte apareixen les imatges.
4709 bpr 62
\text{nonoui=}
3786 bpr 63
 
64
:%%%%%%%%%%%%%% Rien à modifier avant l'énoncé %%%%%%%%%%%%%%%%
65
 
66
\text{size=50,50}
67
\integer{w=\size[1]+10}
68
\text{couleur=#FFFFCC}
69
\css{<style type="text/css">
70
   .question {background-color: #FFFFCC;margin: 2% 2%;padding: 1%;}
71
   table.tableau {border:solid 1px;
6132 bpr 72
    border-collapse:collapse;margin-left:auto;margin-right:auto;}
4709 bpr 73
    table.tableau td, th {background-color:#FFFFCC;text-align:left;border:solid 1px;width:55px;
74
    padding-left:10px;margin-left:20px;}
3786 bpr 75
   ol li {list-style: upper-alpha; }
76
    table.tableau th { background-color:#CCCFFF;}
12169 mquerol 77
    table.tableau tr > th:first-child {width:100px;}
3786 bpr 78
 </style>}
5724 bpr 79
 \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 80
\if{\file notsametext}{
4416 bpr 81
  \text{file=randitem(\file)}
3786 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
}{
3786 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;]}
3786 bpr 101
}
102
\integer{attribut_cnt=items(\attribut)}
103
\text{Data=}
104
\text{R=}
105
\for{u=1 to \N}{
106
  \for{v=2 to \attribut_cnt+1}{
107
    \integer{uu=(\u-1)*\attribut_cnt + \v -1}
108
    \text{Data=\data[\u;\v]=1? wims(append item \uu to \Data)}
109
  }
110
}
111
\text{C=wims(makelist x for x=1 to \N*\attribut_cnt)}
112
\text{C1=wims(makelist x for x=1 to \N*\attribut_cnt)}
113
\text{nstep=r1}
114
\nextstep{\nstep}
4709 bpr 115
\text{col=1}
4416 bpr 116
\statement{
3786 bpr 117
<div class="question"> \instruction
6132 bpr 118
 
3786 bpr 119
<table class="tableau"><tr> <th></th>
4709 bpr 120
\for{k=1 to \attribut_cnt}{<th colspan="\col">\attribut[\k]</th>}
5287 bpr 121
</tr>
11375 bpr 122
\for{j=1 to \N}{
3786 bpr 123
  <tr><th>\data[\j;1]</th>
124
   \for{k=1 to \attribut_cnt}{
6132 bpr 125
    \if{\step=1}{<td style="color:\couleur">\embed{r1,\C[(\attribut_cnt)*(\j-1)+\k]}</td>}{<td>\C[(\attribut_cnt)*(\j-1)+\k]</td>}
3786 bpr 126
    }
127
  </tr>
128
}
129
</table>
130
</div>
131
}
132
\answer{}{\Data;\C1}{type=checkbox}{option=split noanalyzeprint nonstop}
133
\text{nstep=}
134
\text{C=}
4709 bpr 135
\text{col=2}
136
\text{croix=<span style="color:black; font-size:20pt;font-style:bold;">X</span></td>}
137
\text{nocroix=<span style="color:black; font-size:20pt;font-style:bold;">&nbsp;&nbsp;</span></td>}
138
\text{croix=X}
139
\text{nocroix=}
3786 bpr 140
\for{u=1 to \N}{
141
  \for{v=2 to \attribut_cnt+1}{
142
    \integer{uu=(\u-1)*\attribut_cnt + \v -1}
4709 bpr 143
    \text{C=\uu isitemof \reply1 and \uu isitemof \Data ? wims(append item  \croix <td>\nonoui[1]  to \C)}
144
    \text{C=\uu isitemof \reply1 and \uu notitemof \Data ? wims(append item \croix <td>\nonoui[2]  to \C)}
145
    \text{C=\uu notitemof \reply1 and \uu isitemof \Data ? wims(append item \nocroix <td>\nonoui[2] to \C)}
146
    \text{C=\uu notitemof \reply1 and \uu notitemof \Data ? wims(append item \nocroix <td>\nonoui[1] to \C)}
3786 bpr 147
  }
4709 bpr 148
}
149
 
11375 bpr 150
\feedback{1=1}{\nonoui[1] : bonne réponse, \nonoui[2] : mauvaise réponse
4709 bpr 151
 
11375 bpr 152
}