Rev 13714 | 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" |
||
3788 | bpr | 4 | |
4416 | bpr | 5 | :Classify the items according to their properties by filling in a table. |
3788 | bpr | 6 | |
8512 | bpr | 7 | A list of items with various properties is presented. |
4416 | bpr | 8 | The table has to be filled in by filling on the relevant boxes for each item. |
3788 | bpr | 9 | |
10 | <p> |
||
4416 | bpr | 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. |
||
13477 | obado | 14 | </p><p> |
8512 | bpr | 15 | This exercise can easily be modified if it is intended to be included in an OEF module and you wish to |
4416 | bpr | 16 | include the data in a separate file. |
13477 | 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> |
3788 | bpr | 20 | :%%%%%%%%%%%%%%%%% ATTENTION %%%%%%%%%%%%%%%%%%%% |
21 | |||
4416 | bpr | 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. |
||
3788 | bpr | 24 | |
4416 | bpr | 25 | :%%%%%%%% Example parameters to be redefined %%%%%%%%%%%%%%%%% |
3788 | bpr | 26 | |
4416 | bpr | 27 | :\title{Classification (table to fill)} |
5147 | bpr | 28 | :\author{Csilla, Ducrocq} |
4416 | bpr | 29 | :\email{csilla.ducrocq@u-psud.fr} |
5724 | bpr | 30 | :\credits{} |
13477 | obado | 31 | |
3788 | bpr | 32 | :Instruction |
4416 | bpr | 33 | \text{instruction=Fill in the table.} |
3788 | bpr | 34 | |
4416 | bpr | 35 | :Number of items chosen randomly |
3788 | bpr | 36 | \integer{N=3} |
4416 | bpr | 37 | |
38 | :Name of the data file |
||
39 | Only enter a name if you wish to create a separate data file |
||
4425 | bpr | 40 | (in an OEF module) |
4416 | bpr | 41 | of the following type |
4049 | bpr | 42 | <pre> |
4416 | bpr | 43 | fur,feathers,four legs,wings |
6582 | bpr | 44 | :magpie,0,1,1,1 |
45 | :cow,1,0,1,0 |
||
46 | </pre> |
||
13714 | obado | 47 | In this case, the following data will not be taken into account. |
48 | Otherwise, fill in the data. |
||
3788 | bpr | 49 | |
6582 | bpr | 50 | \text{file=} |
13477 | obado | 51 | |
13714 | obado | 52 | :List of attributes |
53 | \text{attribut=fur,feathers,four legs,wings} |
||
13477 | obado | 54 | |
55 | :Data |
||
13714 | obado | 56 | a line by objects. |
57 | \text{data=magpie,0,1,1,1 |
||
58 | beef,1,0,1,0 |
||
59 | cat,1,0,1,0 |
||
60 | mosquito,0,0,0,1} |
||
13477 | obado | 61 | |
13714 | obado | 62 | :Texts for the answer |
63 | put the texts corresponding to the numbers 0,1, ... in the data of the attributes |
||
3788 | bpr | 64 | \text{nonoui=--,X} |
65 | |||
4416 | bpr | 66 | :%%%%%%%%%%%%%% Nothing to modify before the statement%%%%%%%%%%%%%%%% |
67 | maximum 40 cases |
||
3788 | bpr | 68 | \integer{w=\size[1]+10} |
69 | |||
13714 | obado | 70 | \css{<style> |
13489 | obado | 71 | .question {margin: 2% 2%;padding: 1%;} |
72 | .wimstable td, th {text-align:center;min-width:50px;} |
||
73 | </style>} |
||
74 | |||
3788 | bpr | 75 | \if{\file notsametext}{ |
4416 | bpr | 76 | \text{file=randitem(\file)} |
3788 | bpr | 77 | \text{attribut=wims(record 0 of \file)} |
78 | \integer{datacnt=wims(recordcnt \file)} |
||
79 | \integer{N=min(\N,\datacnt)} |
||
80 | \text{choix=shuffle(\datacnt)} |
||
81 | \text{choix=\choix[1..\N]} |
||
82 | \text{data=} |
||
83 | \for{s in \choix}{ |
||
84 | \text{data=\data |
||
85 | wims(record \s of \file)} |
||
4416 | bpr | 86 | } |
87 | \matrix{data=\data} |
||
88 | \text{data=wims(replace internal ;; by ; in \data)} |
||
89 | }{ |
||
3788 | bpr | 90 | \text{objet_cnt=rows(\data)} |
91 | \integer{N=min(\N,\objet_cnt)} |
||
4416 | bpr | 92 | \text{bat=shuffle(\objet_cnt)} |
93 | \text{bat=\bat[1..\N]} |
||
94 | \matrix{data=\data} |
||
95 | \matrix{data=\data[\bat;]} |
||
3788 | bpr | 96 | } |
97 | \integer{attribut_cnt=items(\attribut)} |
||
98 | \integer{ch_cnt=items(\nonoui)} |
||
99 | \text{Data=} |
||
100 | \text{STEP=} |
||
101 | \for{u=1 to \N}{ |
||
102 | \text{STEP=\STEP |
||
103 | wims(makelist r x for x = (\u-1)*\attribut_cnt + 1 to (\u)*\attribut_cnt)} |
||
104 | \text{Data=wims(append item \data[\u;2..-1] to \Data)} |
||
6582 | bpr | 105 | \for{c=0 to \ch_cnt-1}{ |
5147 | bpr | 106 | \text{Data=wims(replace internal \c by \nonoui[\c+1] in \Data)} |
6582 | bpr | 107 | } |
5147 | bpr | 108 | } |
3788 | bpr | 109 | \matrix{STEP=\STEP} |
110 | \text{STEP1=wims(replace internal ; by , in \STEP)} |
||
111 | \text{STEP1=wims(nonempty items \STEP1)} |
||
112 | \steps{\STEP1} |
||
6132 | bpr | 113 | |
13489 | obado | 114 | \statement{ |
13714 | obado | 115 | <div class="instruction">\instruction</div> |
116 | <table class="wimstable"> |
||
117 | <tr> |
||
118 | <th></th> |
||
119 | \for{k=1 to \attribut_cnt}{<th>\attribut[\k]</th>} |
||
120 | </tr> |
||
121 | \for{j=1 to \N}{ |
||
13489 | obado | 122 | <tr> |
13714 | obado | 123 | <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 | } |
||
13489 | obado | 127 | </tr> |
13714 | obado | 128 | } |
129 | </table> |
||
3788 | bpr | 130 | } |
6132 | bpr | 131 | |
3788 | bpr | 132 | \answer{}{\Data[1]}{type=clickfill} |
133 | \answer{}{\Data[2]}{type=clickfill} |
||
134 | \answer{}{\Data[3]}{type=clickfill} |
||
135 | \answer{}{\Data[4]}{type=clickfill} |
||
136 | \answer{}{\Data[5]}{type=clickfill} |
||
137 | \answer{}{\Data[6]}{type=clickfill} |
||
138 | \answer{}{\Data[7]}{type=clickfill} |
||
139 | \answer{}{\Data[8]}{type=clickfill} |
||
140 | \answer{}{\Data[9]}{type=clickfill} |
||
141 | \answer{}{\Data[10]}{type=clickfill} |
||
142 | \answer{}{\Data[11]}{type=clickfill} |
||
143 | \answer{}{\Data[12]}{type=clickfill} |
||
144 | \answer{}{\Data[13]}{type=clickfill} |
||
145 | \answer{}{\Data[14]}{type=clickfill} |
||
146 | \answer{}{\Data[15]}{type=clickfill} |
||
147 | \answer{}{\Data[16]}{type=clickfill} |
||
148 | \answer{}{\Data[17]}{type=clickfill} |
||
149 | \answer{}{\Data[18]}{type=clickfill} |
||
150 | \answer{}{\Data[19]}{type=clickfill} |
||
151 | \answer{}{\Data[20]}{type=clickfill} |
||
152 | \answer{}{\Data[21]}{type=clickfill} |
||
153 | \answer{}{\Data[22]}{type=clickfill} |
||
154 | \answer{}{\Data[23]}{type=clickfill} |
||
155 | \answer{}{\Data[24]}{type=clickfill} |
||
156 | \answer{}{\Data[25]}{type=clickfill} |
||
157 | \answer{}{\Data[26]}{type=clickfill} |
||
158 | \answer{}{\Data[27]}{type=clickfill} |
||
159 | \answer{}{\Data[28]}{type=clickfill} |
||
160 | \answer{}{\Data[30]}{type=clickfill} |
||
161 | \answer{}{\Data[31]}{type=clickfill} |
||
162 | \answer{}{\Data[32]}{type=clickfill} |
||
163 | \answer{}{\Data[33]}{type=clickfill} |
||
164 | \answer{}{\Data[34]}{type=clickfill} |
||
165 | \answer{}{\Data[35]}{type=clickfill} |
||
166 | \answer{}{\Data[36]}{type=clickfill} |
||
167 | \answer{}{\Data[37]}{type=clickfill} |
||
168 | \answer{}{\Data[38]}{type=clickfill} |
||
169 | \answer{}{\Data[39]}{type=clickfill} |
||
170 | \answer{}{\Data[40]}{type=clickfill} |
||
171 |