Rev 15404 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
11375 | bpr | 1 | type=classify |
13714 | obado | 2 | textarea="data instruction" |
3 | iEdit="instruction" |
||
11311 | bpr | 4 | |
5 | :Classify the items according to their properties by filling a checkbox in a table. |
||
6 | |||
7 | A list of items with various properties is presented. |
||
8 | The table has to be filled in by clicking on the relevant boxes for each item. |
||
9 | |||
10 | <p> |
||
11 | To make an exercise with this model, type the list of items and a list of properties. |
||
12 | If an item has a property write 1, if it does not, write 0 in the same order as the list of properties. |
||
13 | The properties should be separated by a comma. |
||
13483 | obado | 14 | </p><p> |
11311 | bpr | 15 | This exercise can easily be modified if it is intended to be included in an OEF module and you wish to |
16 | include the data in a separate file. |
||
13483 | obado | 17 | </p><p class="wims_credits"> |
15179 | lemaire | 18 | Author of the model: <a href="mailto:bernadette.m.riou@orange.fr">Bernadette Perrin-Riou</a> |
13477 | obado | 19 | </p> |
11311 | bpr | 20 | :%%%%%%%%%%%%%%%%% ATTENTION %%%%%%%%%%%%%%%%%%%% |
21 | |||
22 | Remove the above header if you destroy the model tags i.e. the lines starting |
||
23 | with a ':'. Otherwise the exercise might not be recognised by Createxo. |
||
24 | |||
25 | :%%%%%%%% Example parameters to be redefined %%%%%%%%%%%%%%%%% |
||
26 | |||
27 | :\title{Classification (table)} |
||
28 | :\author{Csilla, Ducrocq} |
||
29 | :\email{csilla.ducrocq@u-psud.fr} |
||
30 | :\credits{} |
||
13477 | obado | 31 | |
11311 | bpr | 32 | :Instruction |
33 | \text{instruction=Fill in the table.} |
||
34 | |||
35 | :Number of items chosen randomly |
||
36 | \integer{N=3} |
||
37 | |||
38 | :Name of the data file |
||
39 | Only enter a name if you wish to create a separate data file |
||
40 | (in an OEF module) |
||
13205 | bpr | 41 | \text{file=} |
11311 | bpr | 42 | of the following type |
43 | <pre> |
||
44 | fur,feathers,four legs,wings |
||
15071 | lemaire | 45 | :magpie,0,1,0,1 |
11311 | bpr | 46 | :cow,1,0,1,0 |
15071 | lemaire | 47 | </pre> |
13205 | bpr | 48 | |
11311 | bpr | 49 | :List of properties |
50 | \text{attribut=fur,feathers,four feet,wings} |
||
51 | |||
52 | :Main data |
||
53 | each item should be written on a separate line. |
||
15071 | lemaire | 54 | \text{data=magpie,0,1,0,1 |
11311 | bpr | 55 | cow,1,0,1,0 |
56 | cat,1,0,1,0 |
||
57 | mosquito,0,0,0,1 |
||
58 | butterfly,0,0,0,1 |
||
59 | rabbit,1,0,0,0} |
||
60 | |||
15071 | lemaire | 61 | :Text or images to indicate a good or bad answer |
62 | <p>By default, images appear to indicate correct/bad answers.</p> |
||
63 | Instead, you can type here 2 texts, separated by a comma, which will appear as follows |
||
64 | (first for the right answers, second for the wrong ones) |
||
65 | <p>Example: Bravo!, incorrect</p> |
||
66 | <p>N.B. You can also put only one elemen</p>t |
||
67 | \text{nonoui=} |
||
11311 | bpr | 68 | |
69 | :%%%%%%%%%%%%%% Nothing to modify before the statement%%%%%%%%%%%%%%%% |
||
70 | |||
71 | \text{size=50,50} |
||
72 | \integer{w=\size[1]+10} |
||
13714 | obado | 73 | \css{<style> |
13483 | obado | 74 | .big_check{text-align: center} |
13714 | obado | 75 | .cross{color:black; font-size:20pt;} |
13483 | obado | 76 | @supports (zoom:2){ |
77 | .big_check>input{zoom: 1.4;} |
||
78 | } |
||
79 | @supports not (zoom:2){ |
||
80 | .big_check>input{transform: scale(1.4);} |
||
81 | } |
||
82 | .big_check>label{color:transparent;width:1px;height:1px;position: absolute;} |
||
13714 | obado | 83 | </style>} |
17175 | bpr | 84 | \text{nonoui=\nonoui issametext ? <img src="scripts/authors/jm.evers/gifs/ok.gif" width="15" alt="correct response">,<img src="scripts/authors/jm.evers/gifs/nok.gif" width="15" alt="Incorrect response">} |
11311 | bpr | 85 | \if{\file notsametext}{ |
86 | \text{file=randitem(\file)} |
||
87 | \text{attribut=wims(record 0 of \file)} |
||
88 | \integer{datacnt=wims(recordcnt \file)} |
||
89 | \integer{N=min(\N,\datacnt)} |
||
90 | \text{choix=shuffle(\datacnt)} |
||
91 | \text{choix=\choix[1..\N]} |
||
92 | \text{data=} |
||
93 | \for{s in \choix}{ |
||
94 | \text{data=\data |
||
95 | wims(record \s of \file)} |
||
96 | } |
||
97 | \matrix{data=\data} |
||
98 | \text{data=wims(replace internal ;; by ; in \data)} |
||
99 | }{ |
||
100 | \text{objet_cnt=rows(\data)} |
||
101 | \integer{N=min(\N,\objet_cnt)} |
||
102 | \text{bat=shuffle(\objet_cnt)} |
||
103 | \text{bat=\bat[1..\N]} |
||
104 | \matrix{data=\data} |
||
105 | \matrix{data=\data[\bat;]} |
||
106 | } |
||
107 | \integer{attribut_cnt=items(\attribut)} |
||
108 | \text{Data=} |
||
109 | \text{R=} |
||
110 | \for{u=1 to \N}{ |
||
111 | \for{v=2 to \attribut_cnt+1}{ |
||
112 | \integer{uu=(\u-1)*\attribut_cnt + \v -1} |
||
113 | \text{Data=\data[\u;\v]=1? wims(append item \uu to \Data)} |
||
114 | } |
||
115 | } |
||
116 | \text{C=wims(makelist x for x=1 to \N*\attribut_cnt)} |
||
117 | \text{C1=wims(makelist x for x=1 to \N*\attribut_cnt)} |
||
118 | \text{nstep=r1} |
||
119 | \nextstep{\nstep} |
||
13714 | obado | 120 | \text{tab=wims(makelist c for x=1 to \attribut_cnt+1)} |
121 | \text{tab=wims(replace internal , by | in |\tab|)} |
||
122 | \text{latexsrc=\begin{tabular}{\tab}\hline} |
||
123 | \for{lk=1 to \attribut_cnt}{ |
||
124 | \text{latexsrc=\latexsrc&\attribut[\lk]} |
||
125 | } |
||
126 | \text{latexsrc=\latexsrc \\\hline} |
||
15071 | lemaire | 127 | \text{latexsol=\latexsrc} |
13714 | obado | 128 | \for{jl=1 to \N}{ |
129 | \text{latexsrc=\latexsrc |
||
130 | \data[\jl;1]} |
||
15071 | lemaire | 131 | \text{latexsol=\latexsol |
132 | \data[\jl;1]} |
||
13714 | obado | 133 | \for{kl=1 to \attribut_cnt}{ |
15071 | lemaire | 134 | \integer{lkk=(\jl-1)*\attribut_cnt + \kl} |
13714 | obado | 135 | \text{latexsrc=\latexsrc &} |
15071 | lemaire | 136 | \text{latexsol=\latexsol &} |
137 | \if{\lkk isitemof \Data}{\text{latexsol=\latexsol \(\times\) }} |
||
13714 | obado | 138 | } |
139 | \text{latexsrc=\latexsrc \\\hline} |
||
15071 | lemaire | 140 | \text{latexsol=\latexsol \\\hline} |
13714 | obado | 141 | } |
142 | \text{latexsrc=\latexsrc |
||
143 | \end{tabular}} |
||
15071 | lemaire | 144 | \text{latexsol=\latexsol |
145 | \end{tabular}} |
||
13483 | obado | 146 | |
15071 | lemaire | 147 | \text{givegood=slib(oef/env givegood)} |
148 | \text{givegood=\givegood issametext ? 1} |
||
149 | |||
11311 | bpr | 150 | \statement{ |
13483 | obado | 151 | <div class="instruction">\instruction</div> |
152 | <table class="wimstable"> |
||
15071 | lemaire | 153 | <thead> |
13483 | obado | 154 | <tr> |
15071 | lemaire | 155 | <td></td> |
156 | \for{k=1 to \attribut_cnt}{<th scope="col">\attribut[\k]</th>} |
||
13483 | obado | 157 | </tr> |
15071 | lemaire | 158 | </thead> |
159 | <tbody> |
||
13483 | obado | 160 | \for{j=1 to \N}{ |
161 | <tr> |
||
15071 | lemaire | 162 | <th scope="row">\data[\j;1]</th> |
13483 | obado | 163 | \for{k=1 to \attribut_cnt}{ |
164 | \if{\step=1}{ |
||
165 | <td class="big_check">\embed{r1,\C[(\attribut_cnt)*(\j-1)+\k]}</td> |
||
166 | }{ |
||
13714 | obado | 167 | <td class="big_check">\C[(\attribut_cnt)*(\j-1)+\k]</td> |
13483 | obado | 168 | } |
169 | } |
||
170 | </tr> |
||
11311 | bpr | 171 | } |
15071 | lemaire | 172 | </tbody> |
13483 | obado | 173 | </table> |
11311 | bpr | 174 | } |
13483 | obado | 175 | |
11311 | bpr | 176 | \answer{}{\Data;\C1}{type=checkbox}{option=split noanalyzeprint nonstop} |
177 | \text{nstep=} |
||
178 | \text{C=} |
||
15071 | lemaire | 179 | \if{\givegood=0}{ |
180 | \text{feedbackbon=} |
||
181 | \text{feedbackfaux=} |
||
182 | } |
||
183 | { |
||
184 | \text{feedbackbon=<span class="oef_indgood">\nonoui[1]</span>} |
||
185 | \text{feedbackfaux=<span class="oef_indbad">\nonoui[2]</span>} |
||
186 | } |
||
13714 | obado | 187 | \text{croix=<span class="cross">☑</span>} |
188 | \text{nocroix=<span class="cross">☐</span>} |
||
15071 | lemaire | 189 | \text{lignef=} |
11311 | bpr | 190 | \for{u=1 to \N}{ |
191 | \for{v=2 to \attribut_cnt+1}{ |
||
192 | \integer{uu=(\u-1)*\attribut_cnt + \v -1} |
||
15071 | lemaire | 193 | \text{C=\uu isitemof \reply1 and \uu isitemof \Data ? wims(append item \croix \feedbackbon to \C)} |
194 | \if{\uu isitemof \reply1 and \uu notitemof \Data}{ |
||
195 | \text{C= wims(append item \croix \feedbackfaux to \C)} |
||
196 | \text{lignef=wims(append item \u to \lignef)} |
||
197 | } |
||
198 | {\if{\uu notitemof \reply1 and \uu isitemof \Data}{ |
||
15404 | lemaire | 199 | \text{C= wims(append item \nocroix \feedbackfaux to \C)} |
15071 | lemaire | 200 | \text{lignef=wims(append item \u to \lignef)} |
201 | } |
||
202 | } |
||
203 | \text{C=\uu notitemof \reply1 and \uu notitemof \Data ? wims(append item \nocroix \feedbackbon to \C)} |
||
11311 | bpr | 204 | } |
205 | } |
||
206 | |||
15071 | lemaire | 207 | \feedback{\givegood>0}{\nonoui[1] : your answer is correct, \nonoui[2] : your answer is incorrect. |
13714 | obado | 208 | } |
15071 | lemaire | 209 | \integer{nblignef=items(\lignef)} |
210 | \feedback{\givegood=0 and \nblignef>0}{<div class="feedback oef_indbad">\if{\nblignef=1}{ |
||
211 | Row \lignef of the table is not completed}{Rows \lignef[1..-2] and \lignef[-1] of the table are not completed} correctly.</div>} |
||
11311 | bpr | 212 | |
15071 | lemaire | 213 | |
13714 | obado | 214 | \latex{ |
215 | \begin{statement} |
||
216 | \instruction |
||
217 | \newline |
||
218 | \latexsrc |
||
219 | \end{statement} |
||
15071 | lemaire | 220 | \begin{solution}\ |
221 | \begin{center} |
||
222 | \latexsol |
||
223 | \end{center} |
||
224 | \end{solution} |
||
11311 | bpr | 225 | } |