Rev 5724 | Rev 11375 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
3786 | bpr | 1 | type=datalist |
2 | textarea="data" |
||
3 | |||
4 | :Classer les objets selon leurs propriétés dans un tableau. |
||
5 | |||
6 | On présente une liste d'objets et une liste d'attributs (propriétés). Il faut remplir |
||
7 | un tableau selon que les objets vérifient ou non les propriétés en cochant ou non dans la case. |
||
8 | |||
9 | <p> |
||
10 | Pour construire un exercice avec ce modèle, il suffit d'entrer la liste |
||
11 | des attributs et une liste d'objets en indiquant s'ils vérifient ou non |
||
12 | les propriétés dans le même ordre que les attributs (avec un 0 ou un 1) |
||
13 | <p> |
||
14 | Cet exercice peut facilement être transformé pour être inclus dans un module OEF |
||
15 | si l'on désire mettre les données dans un fichier auxiliaire. |
||
16 | <p> |
||
17 | Auteur du modèle : Bernadette Perrin-Riou <bpr@math.u-psud.fr> |
||
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 | |||
4416 | bpr | 27 | :\title{Tableau à remplir (checkbox)} |
5147 | bpr | 28 | :\author{Bernadette, Perrin-Riou} |
4416 | bpr | 29 | :\email{bpr@math.u-psud.fr} |
6132 | bpr | 30 | :\credits{} |
3786 | bpr | 31 | :Instruction |
32 | \text{instruction= Remplir le tableau.} |
||
33 | |||
34 | :Nombre d'objets tirés au sort |
||
35 | \integer{N=3} |
||
4416 | bpr | 36 | |
3786 | bpr | 37 | :Nom du fichier |
38 | ne remplir que si vous désirez utiliser un fichier de données (dans un module OEF). |
||
39 | \text{file=} |
||
40 | du type |
||
4137 | bpr | 41 | <pre> |
4416 | bpr | 42 | poils,plumes,quatre membres,ailes |
43 | :pie,0,1,1,1 |
||
44 | :boeuf,1,0,1,0 |
||
4137 | bpr | 45 | </pre> |
4416 | bpr | 46 | Dans ce cas, les données suivantes ne seront pas prises en compte. |
47 | Sinon, remplissez les données. |
||
3786 | bpr | 48 | |
49 | :Liste des attributs |
||
50 | \text{attribut=poils,plumes,quatre membres,ailes} |
||
51 | :Données |
||
52 | une ligne par objets. |
||
53 | \text{data=pie,0,1,1,1 |
||
54 | boeuf,1,0,1,0 |
||
55 | chat,1,0,1,0 |
||
56 | moustique,0,0,0,1} |
||
4709 | bpr | 57 | :Texte ou images pour indiquer une bonne ou mauvaise réponse |
58 | ce texte est affiché au moment de la réponse, par défaut des images apparaissent. |
||
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;} |
||
5147 | bpr | 74 | table.tableau tr > th:first-child {width:400px;} |
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> |
3786 | bpr | 119 | \for{j=1 to \N}{ |
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;"> </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 | |||
147 | \feedback{1=1}{\nonoui[1] : bonne réponse, \nonoui[2] : mauvaise réponse |
||
148 | |||
3786 | bpr | 149 | } |