Subversion Repositories wimsdev

Rev

Rev 6132 | Rev 11375 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

type=datalist
textarea="data"

:Classer les objets selon leurs propriétés dans un tableau.

On présente une liste d'objets et une liste d'attributs (propriétés). Il faut remplir 
un tableau selon que les objets vérifient ou non les propriétés en remplissant une case.

<p>
Pour construire un exercice avec ce modèle, il suffit d'entrer la liste
des attributs et une liste d'objets en indiquant s'ils vérifient ou non
les propriétés dans le même ordre que les attributs (avec un 0 ou un 1)
<p>
Cet exercice peut facilement être transformé pour être inclus dans un module OEF
si l'on désire mettre les données dans un fichier auxiliaire. Pour cela,
il suffit de remplir le champ \text{file=} en mettant le nom du fichier
(une fois l'exercice transféré dans un module OEF d'un compte Modtool).
<p>
Auteur du modèle : Bernadette Perrin-Riou <bpr@math.u-psud.fr>

:%%%%%%%%%%%%%%%%%      ATTENTION      %%%%%%%%%%%%%%%%%%%%

Enlevez l'en-tête ci-dessus si vous détruisez les balises pour le modèle !
(Ce sont les lignes qui commencent par un ':'.)
Sinon l'exercice risque de ne pas pouvoir repasser sous Createxo.

:%%%%%%%% Paramètres d'exemples à redéfinir %%%%%%%%%%%%%%%%%

:\title{Tableau à remplir (fill)}
:\author{Bernadette, Perrin-Riou}
:\email{bpr@math.u-psud.fr}
:\credits{}
:Instruction
\text{instruction= Remplir le tableau.}

:Nombre d'objets tirés au sort
\integer{N=3}

:Nom du fichier
Ne remplissez que si vous désirez transférer le source de cet exercice dans un compte Modtool 
et utiliser un fichier de données (dans un module OEF)
du type
<pre>
 poils,plumes,quatre membres,ailes
 :pie,0,1,1,1
 :boeuf,1,0,1,0
</pre>
Dans ce cas, les données suivantes ne seront pas prises en compte. 
Sinon, remplissez les données.

\text{file=}
:Liste des attributs
\text{attribut=poils,plumes,quatre membres,ailes}
:Données
une ligne par objets.
\text{data=pie,0,1,1,1
boeuf,1,0,1,0
chat,1,0,1,0
moustique,0,0,0,1}
:Code pour les étiquettes à insérer dans le tableau
Mettre le nom des objets suivi par les nombres 0 ou 1 solon que l'attribut est vrai ou faux,
un objet par ligne.
\text{nonoui=--,X}

:%%%%%%%%%%%%%% Rien à modifier avant l'énoncé %%%%%%%%%%%%%%%%
maximum 40 cases à remplir

\integer{w=\size[1]+10}

\css{<style type="text/css">
   .question {background-color: #FFFFCC;margin: 2% 2%;padding: 1%;}
   table.tableau {border:solid 1px;margin-left:auto;margin-right:auto;
    border-collapse:collapse;}
    table.tableau td, th {text-align:center;border:solid 1px;min-width:50px;}
   ol li {list-style: upper-alpha; }
    table.tableau th { background-color:#CCCFFF;}
 </style>}
\if{\file notsametext}{
  \text{file=randitem(\file)}
  \text{attribut=wims(record 0 of \file)}
  \integer{datacnt=wims(recordcnt \file)}
  \integer{N=min(\N,\datacnt)}
  \text{choix=shuffle(\datacnt)}
  \text{choix=\choix[1..\N]}
  \text{data=}
  \for{s in \choix}{
    \text{data=\data
wims(record \s of \file)}
  }
  \matrix{data=\data}
  \text{data=wims(replace internal ;; by ; in \data)}
}{
  \text{objet_cnt=rows(\data)}
  \integer{N=min(\N,\objet_cnt)}
  \text{bat=shuffle(\objet_cnt)}
  \text{bat=\bat[1..\N]}
  \matrix{data=\data}
  \matrix{data=\data[\bat;]}
}
\integer{attribut_cnt=items(\attribut)}
\integer{ch_cnt=items(\nonoui)}
\text{Data=}
\text{STEP=}
\for{u=1 to \N}{
  \text{STEP=\STEP
   wims(makelist r x for x = (\u-1)*\attribut_cnt + 1  to  (\u)*\attribut_cnt)}
  \text{Data=wims(append item \data[\u;2..-1] to \Data)}
  \for{c=0 to \ch_cnt-1}{
  \text{Data=wims(replace internal \c by \nonoui[\c+1] in \Data)}
  }
}
\matrix{STEP=\STEP}
\text{STEP1=wims(replace internal ; by , in \STEP)}
\text{STEP1=wims(nonempty items \STEP1)}
\steps{\STEP1}
\statement{<div class="question">\instruction

<table class="tableau"><tr><th></th>
\for{k=1 to \attribut_cnt}{<th>\attribut[\k]</th>}
<tr>
\for{j=1 to \N}{ 
  <tr><th>\data[\j;1]</th>
   \for{k=1 to \attribut_cnt}{
     <td>\embed{\STEP[\j;\k], \size[1] x \size[2]}</td>
    }
  </tr>
}
</table>

</div>
}
\answer{}{\Data[1]}{type=clickfill}
\answer{}{\Data[2]}{type=clickfill}
\answer{}{\Data[3]}{type=clickfill}
\answer{}{\Data[4]}{type=clickfill}
\answer{}{\Data[5]}{type=clickfill}
\answer{}{\Data[6]}{type=clickfill}
\answer{}{\Data[7]}{type=clickfill}
\answer{}{\Data[8]}{type=clickfill}
\answer{}{\Data[9]}{type=clickfill}
\answer{}{\Data[10]}{type=clickfill}
\answer{}{\Data[11]}{type=clickfill}
\answer{}{\Data[12]}{type=clickfill}
\answer{}{\Data[13]}{type=clickfill}
\answer{}{\Data[14]}{type=clickfill}
\answer{}{\Data[15]}{type=clickfill}
\answer{}{\Data[16]}{type=clickfill}
\answer{}{\Data[17]}{type=clickfill}
\answer{}{\Data[18]}{type=clickfill}
\answer{}{\Data[19]}{type=clickfill}
\answer{}{\Data[20]}{type=clickfill}
\answer{}{\Data[21]}{type=clickfill}
\answer{}{\Data[22]}{type=clickfill}
\answer{}{\Data[23]}{type=clickfill}
\answer{}{\Data[24]}{type=clickfill}
\answer{}{\Data[25]}{type=clickfill}
\answer{}{\Data[26]}{type=clickfill}
\answer{}{\Data[27]}{type=clickfill}
\answer{}{\Data[28]}{type=clickfill}
\answer{}{\Data[30]}{type=clickfill}
\answer{}{\Data[31]}{type=clickfill}
\answer{}{\Data[32]}{type=clickfill}
\answer{}{\Data[33]}{type=clickfill}
\answer{}{\Data[34]}{type=clickfill}
\answer{}{\Data[35]}{type=clickfill}
\answer{}{\Data[36]}{type=clickfill}
\answer{}{\Data[37]}{type=clickfill}
\answer{}{\Data[38]}{type=clickfill}
\answer{}{\Data[39]}{type=clickfill}
\answer{}{\Data[40]}{type=clickfill}