Subversion Repositories wimsdev

Rev

Rev 13476 | Rev 13716 | 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
\css{<style type="text/css">
13483 obado 69
  .big_check{text-align: center}
70
  @supports (zoom:2){
71
    .big_check>input{zoom: 1.4;}
72
  }
73
  @supports not (zoom:2){
74
    .big_check>input{transform: scale(1.4);}
75
  }
76
  .big_check>label{color:transparent;width:1px;height:1px;position: absolute;}
3786 bpr 77
 </style>}
13483 obado 78
\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 79
\if{\file notsametext}{
4416 bpr 80
  \text{file=randitem(\file)}
3786 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
}{
3786 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;]}
3786 bpr 100
}
101
\integer{attribut_cnt=items(\attribut)}
102
\text{Data=}
103
\text{R=}
104
\for{u=1 to \N}{
105
  \for{v=2 to \attribut_cnt+1}{
106
    \integer{uu=(\u-1)*\attribut_cnt + \v -1}
107
    \text{Data=\data[\u;\v]=1? wims(append item \uu to \Data)}
108
  }
109
}
110
\text{C=wims(makelist x for x=1 to \N*\attribut_cnt)}
111
\text{C1=wims(makelist x for x=1 to \N*\attribut_cnt)}
112
\text{nstep=r1}
113
\nextstep{\nstep}
4709 bpr 114
\text{col=1}
13483 obado 115
 
4416 bpr 116
\statement{
13483 obado 117
  <div class="instruction">\instruction</div>
118
  <table class="wimstable">
119
    <tr>
120
      <th></th>
121
      \for{k=1 to \attribut_cnt}{<th colspan="\col">\attribut[\k]</th>}
122
    </tr>
123
    \for{j=1 to \N}{
124
      <tr>
125
        <th>\data[\j;1]</th>
126
        \for{k=1 to \attribut_cnt}{
127
          \if{\step=1}{
128
            <td class="big_check">\embed{r1,\C[(\attribut_cnt)*(\j-1)+\k]}</td>
129
          }{
130
            <td>\C[(\attribut_cnt)*(\j-1)+\k]</td>
131
          }
132
        }
133
      </tr>
3786 bpr 134
    }
13483 obado 135
  </table>
3786 bpr 136
}
13483 obado 137
 
3786 bpr 138
\answer{}{\Data;\C1}{type=checkbox}{option=split noanalyzeprint nonstop}
139
\text{nstep=}
140
\text{C=}
4709 bpr 141
\text{col=2}
142
\text{croix=<span style="color:black; font-size:20pt;font-style:bold;">X</span></td>}
143
\text{nocroix=<span style="color:black; font-size:20pt;font-style:bold;">&nbsp;&nbsp;</span></td>}
144
\text{croix=X}
145
\text{nocroix=}
3786 bpr 146
\for{u=1 to \N}{
147
  \for{v=2 to \attribut_cnt+1}{
148
    \integer{uu=(\u-1)*\attribut_cnt + \v -1}
4709 bpr 149
    \text{C=\uu isitemof \reply1 and \uu isitemof \Data ? wims(append item  \croix <td>\nonoui[1]  to \C)}
150
    \text{C=\uu isitemof \reply1 and \uu notitemof \Data ? wims(append item \croix <td>\nonoui[2]  to \C)}
151
    \text{C=\uu notitemof \reply1 and \uu isitemof \Data ? wims(append item \nocroix <td>\nonoui[2] to \C)}
152
    \text{C=\uu notitemof \reply1 and \uu notitemof \Data ? wims(append item \nocroix <td>\nonoui[1] to \C)}
3786 bpr 153
  }
4709 bpr 154
}
155
 
11375 bpr 156
\feedback{1=1}{\nonoui[1] : bonne réponse, \nonoui[2] : mauvaise réponse
4709 bpr 157
 
11375 bpr 158
}