Subversion Repositories wimsdev

Rev

Rev 11375 | Rev 13476 | 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)
3786 bpr 13
<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.
3786 bpr 16
<p>
12169 mquerol 17
Autor del model: Bernadette Perrin-Riou <bpr@math.u-psud.fr>
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{}
12169 mquerol 31
:Enunciat
3786 bpr 32
\text{instruction= Remplir le tableau.}
33
 
12169 mquerol 34
:Nombre d'objectes triats a l'atzar
3786 bpr 35
\integer{N=3}
4416 bpr 36
 
12169 mquerol 37
:Nom del fitxer
38
Ompliu només si voleu utilitzar un fitxer de dades (en un mòdul OEF).
3786 bpr 39
\text{file=}
12169 mquerol 40
del tipus
4137 bpr 41
<pre>
12169 mquerol 42
 poils,plumes,quatre pattes,ailes
43
 :pie,0,1,0,1
4416 bpr 44
 :boeuf,1,0,1,0
4137 bpr 45
</pre>
12169 mquerol 46
En aquest cas, no es tindrà en compte les dades següents.
47
En cas contrari, ompliu les dades.
3786 bpr 48
 
12169 mquerol 49
:Llista d'atributs
50
\text{attribut=poils,plumes,quatre pattes,ailes}
51
:Dades
52
Una línia per objecte.
53
\text{data=pie,0,1,0,1
3786 bpr 54
boeuf,1,0,1,0
55
chat,1,0,1,0
56
moustique,0,0,0,1}
12169 mquerol 57
:Text o imatges per indicar una resposta bona o dolenta
58
Aquest text es mostra al moment de la resposta, per defecte apareixen les imatges.
4709 bpr 59
\text{nonoui=}
3786 bpr 60
 
61
:%%%%%%%%%%%%%% Rien à modifier avant l'énoncé %%%%%%%%%%%%%%%%
62
 
63
\text{size=50,50}
64
\integer{w=\size[1]+10}
65
\text{couleur=#FFFFCC}
66
\css{<style type="text/css">
67
   .question {background-color: #FFFFCC;margin: 2% 2%;padding: 1%;}
68
   table.tableau {border:solid 1px;
6132 bpr 69
    border-collapse:collapse;margin-left:auto;margin-right:auto;}
4709 bpr 70
    table.tableau td, th {background-color:#FFFFCC;text-align:left;border:solid 1px;width:55px;
71
    padding-left:10px;margin-left:20px;}
3786 bpr 72
   ol li {list-style: upper-alpha; }
73
    table.tableau th { background-color:#CCCFFF;}
12169 mquerol 74
    table.tableau tr > th:first-child {width:100px;}
3786 bpr 75
 </style>}
5724 bpr 76
 \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 77
\if{\file notsametext}{
4416 bpr 78
  \text{file=randitem(\file)}
3786 bpr 79
  \text{attribut=wims(record 0 of \file)}
80
  \integer{datacnt=wims(recordcnt \file)}
81
  \integer{N=min(\N,\datacnt)}
82
  \text{choix=shuffle(\datacnt)}
83
  \text{choix=\choix[1..\N]}
84
  \text{data=}
85
  \for{s in \choix}{
86
    \text{data=\data
87
wims(record \s of \file)}
4416 bpr 88
  }
89
  \matrix{data=\data}
90
  \text{data=wims(replace internal ;; by ; in \data)}
91
}{
3786 bpr 92
  \text{objet_cnt=rows(\data)}
93
  \integer{N=min(\N,\objet_cnt)}
4416 bpr 94
  \text{bat=shuffle(\objet_cnt)}
95
  \text{bat=\bat[1..\N]}
96
  \matrix{data=\data}
97
  \matrix{data=\data[\bat;]}
3786 bpr 98
}
99
\integer{attribut_cnt=items(\attribut)}
100
\text{Data=}
101
\text{R=}
102
\for{u=1 to \N}{
103
  \for{v=2 to \attribut_cnt+1}{
104
    \integer{uu=(\u-1)*\attribut_cnt + \v -1}
105
    \text{Data=\data[\u;\v]=1? wims(append item \uu to \Data)}
106
  }
107
}
108
\text{C=wims(makelist x for x=1 to \N*\attribut_cnt)}
109
\text{C1=wims(makelist x for x=1 to \N*\attribut_cnt)}
110
\text{nstep=r1}
111
\nextstep{\nstep}
4709 bpr 112
\text{col=1}
4416 bpr 113
\statement{
3786 bpr 114
<div class="question"> \instruction
6132 bpr 115
 
3786 bpr 116
<table class="tableau"><tr> <th></th>
4709 bpr 117
\for{k=1 to \attribut_cnt}{<th colspan="\col">\attribut[\k]</th>}
5287 bpr 118
</tr>
11375 bpr 119
\for{j=1 to \N}{
3786 bpr 120
  <tr><th>\data[\j;1]</th>
121
   \for{k=1 to \attribut_cnt}{
6132 bpr 122
    \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 123
    }
124
  </tr>
125
}
126
</table>
127
</div>
128
}
129
\answer{}{\Data;\C1}{type=checkbox}{option=split noanalyzeprint nonstop}
130
\text{nstep=}
131
\text{C=}
4709 bpr 132
\text{col=2}
133
\text{croix=<span style="color:black; font-size:20pt;font-style:bold;">X</span></td>}
134
\text{nocroix=<span style="color:black; font-size:20pt;font-style:bold;">&nbsp;&nbsp;</span></td>}
135
\text{croix=X}
136
\text{nocroix=}
3786 bpr 137
\for{u=1 to \N}{
138
  \for{v=2 to \attribut_cnt+1}{
139
    \integer{uu=(\u-1)*\attribut_cnt + \v -1}
4709 bpr 140
    \text{C=\uu isitemof \reply1 and \uu isitemof \Data ? wims(append item  \croix <td>\nonoui[1]  to \C)}
141
    \text{C=\uu isitemof \reply1 and \uu notitemof \Data ? wims(append item \croix <td>\nonoui[2]  to \C)}
142
    \text{C=\uu notitemof \reply1 and \uu isitemof \Data ? wims(append item \nocroix <td>\nonoui[2] to \C)}
143
    \text{C=\uu notitemof \reply1 and \uu notitemof \Data ? wims(append item \nocroix <td>\nonoui[1] to \C)}
3786 bpr 144
  }
4709 bpr 145
}
146
 
11375 bpr 147
\feedback{1=1}{\nonoui[1] : bonne réponse, \nonoui[2] : mauvaise réponse
4709 bpr 148
 
11375 bpr 149
}