Rev 13488 | Rev 14822 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
type=classify
textarea="data pre post"
iEdit="pre post"
:Classificar objectes arrossegant-los i deixant-los anar.
Presentem una llista d'objectes, i hem de classificar segons els seus
propietats, llençant-les als quadres proveïts amb el ratolí.
<p>
Per construir un exercici amb aquest model, només cal que introduïu la llista
d'objectes i les seves propietats.
</p><p>
Amb una petita modificació, es pot acceptar una variant d'aquest model
amb imatges com a objectes.</p>
$image_help
<p class="wims_credits">Autor del model: Gang Xiao <qualite@wimsedu.info></p>
:%%%%%%%%%%%%%%%%% 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{Classificar per categoria}
:\author{XIAO, Gang}
:\email{qualite@wimsedu.info}
:\credits{}
:Nombre d'objectes a classificar per exercici. Fins a 20.
\integer{tot=8}
:La màxima quantitat d'objectes presentats tenint la mateixa propietat.
Aquest número ha de ser estrictament superior a 1.
\integer{max1=4}
:El nombre de propietats a presentar (per defecte el nombre de propietats)
Si el nombre de propietats és estrictament inferior al nombre de propietats,
un distractor serà seleccionat de propietats no mostrades.
\text{prop_cnt=}
:La mida dels objectes per arrossegar, en píxels, x per y.
Penseu en les persones que augmenten la grandària de la font dels navegadors.
No deixeu que les caixes siguin massa petites.
\text{size1=100x40}
:Llista de propietats. Fins a 10, separades per comes.
\text{prop=Insecte,Oiseau,Mammifère}
:Dades principals.
Escriviu (un per línia) els objectes a classificar, després la seva categoria, separats per una coma. <p>
L'objecte pot ser una paraula, una frase (sense comes) i fins i tot una imatge.
És millor definir moltes dades per a cada
categoria i almenys dos objectes per a cada categoria.</p> <p>
Aneu amb compte de no introduir errors d'escriptura a les propietats.
En cas contrari, l'objecte corresponent pot causar un mal funcionament de l'exercici.</p>
\matrix{data=
L'abeille,Insecte
L'aigle,Oiseau
L'albatros,Oiseau
L'alouette,Oiseau
La blatte,Insecte
Le canard,Oiseau
Le chat,Mammifère
Le cheval,Mammifère
Le chien,Mammifère
Le cochon,Mammifère
Le corbeau,Oiseau
Le criquet,Insecte
L'éléphant,Mammifère
Le faucon,Oiseau
Le goéland,Oiseau
La guêpe,Insecte
Le lion,Mammifère
Le moineau,Oiseau
La mouche,Insecte
Le moustique,Insecte
Le mouton,Mammifère
L'oie,Oiseau
Le papillon,Insecte
Le pigeon,Oiseau
Le renard,Mammifère
Le rossignol,Oiseau
Le scorpion,Insecte
Le singe,Mammifère
Le tigre,Mammifère
La vache,Mammifère
Le vautour,Oiseau
}
:Opcions.
Afegir <ul><li> la paraula <span class="wims_code_words">shuffle</span> si volem que l'ordre de les propietats sigui
aleatori, </li><li>la paraula <span class="wims_code_words">vertical</span>
si voleu un arranjament vertical dels camps.
</li></ul>
\text{option=}
:Text abans de la taula. Es permeten etiquetes HTML.
\text{pre=Classez les animaux ci-dessous selon leurs catégories.}
:Text després de la taula. Es permeten etiquetes HTML.
\text{post=}
:Verb i article per mostrar davant de la categoria classificada.
\text{estun=est un}
:Com dir si un objecte no està classificat?
\text{noclass=n'appartient à aucune catégorie}
:%%%%%%%%%%%%%% Rien à modifier avant l'énoncé %%%%%%%%%%%%%%%%
\integer{pcnt=items(\prop)}
\integer{prop_cnt=\prop_cnt=? \pcnt}
\integer{prop_cnt=min(\prop_cnt,\pcnt)}
\integer{datacnt=rows(\data)}
\integer{max2=\max1+1}
\integer{tot=\tot<\pcnt?\pcnt}
\text{prop=\pcnt>1 and shuffle iswordof \option?shuffle(\prop)}
\text{first=}
\text{firsti=}
\text{second=}
\text{secondi=}
\text{dist=}
\text{disti=}
\for{i=1 to \prop_cnt}{
\text{t=shuffle(column(1,wims(select \data where column 2 issametext \prop[\i])))}
\integer{s=min(\max1,items(\t))}
\text{first=wims(append item \t[1] to \first)}
\text{firsti=wims(append item \i to \firsti)}
\if{\s > 1}{
\text{second=wims(append item \t[2..\s] to \second)}
\text{secondi=wims(append item wims(makelist \i for x=2 to \s) to \secondi)}
}
}
distracteur
\if{\prop_cnt<\pcnt}{
\text{t=shuffle(column(1,wims(select \data where column 2 issametext \prop[\prop_cnt+1])))}
\integer{s=min(\max1,items(\t))}
\text{dist=wims(append item \t[1] to \dist)}
\text{disti=wims(append item \i to \disti)}
}
\if{\tot>\prop_cnt}{
\integer{scnt=items(\second)}
\integer{secnt=min(\tot-\prop_cnt,\scnt)}
\integer{tot=\prop_cnt+\secnt}
\text{sh2=shuffle(\scnt)}
\text{sh2=\sh2[1..\secnt]}
\text{second=item(\sh2,\second)}
\text{secondi=item(\sh2,\secondi)}
\text{all=\first,\second}
\text{alli=\firsti,\secondi}
}{
\text{all=\first}
\text{alli=\firsti}
}
\text{all=wims(nonempty items \all)}
\text{all=wims(listuniq \all)}
\integer{acnt=items(\all)}
\text{sh=shuffle(\acnt)}
\text{all=item(\sh,\all)}
\text{alli=item(\sh,\alli)}
\text{prop=\prop[1..\prop_cnt]}
\text{props=wims(tolower \prop)}
\text{alls=wims(tolower \all)}
\text{size=\size1 x \max2}
\text{sizev=\size x \max2}
\text{rep=item(1..\prop_cnt,wims(makelist r x for x=1 to 10))}
\steps{\rep}
\integer{distc=\dist!= ? 1 : 0}
\conditions{wims(makelist x for x=1 to \acnt + \distc)}
:%%%%%%%%%%%%% Maintenant l'énoncé en code html. %%%%%%%%%%%%%%%%%%%%
::La commande pour afficher le champ de réponse numéro 3 par exemple,
c'est \embed{reply 3,\size} <p>
Et le nom de la propriété numéro 4, c'est \prop[4] avec la première lettre
en majuscule, ou \props[4] tout en minuscule.
\statement{<div class="instruction">
\pre
</div>
<table class="wimsnoborder">
\if{vertical iswordof \option}{
<tr>\for{k=1 to \prop_cnt}{<th>\prop[\k]</th>}</tr>
<tr>\for{k=1 to \prop_cnt}{
<td style="text-align:left;vertical-align:top">\embed{reply \k, \sizev}</td>}
</tr>
}{
\for{k=1 to \prop_cnt}{
<tr>
<th>\prop[\k]</th>
<td style="text-align:left">\embed{reply \k, \size}</td>
</tr>
}
}
</table>
\post
}
:%%%%%%%%%%%%% Rien à modifier ci-après. %%%%%%%%%%%%%%%%%5
\answer{\prop[1]}{\r1;\all,\dist}{type=dragfill}
\answer{\prop[2]}{\r2}{type=dragfill}
\answer{\prop[3]}{\r3}{type=dragfill}
\answer{\prop[4]}{\r4}{type=dragfill}
\answer{\prop[5]}{\r5}{type=dragfill}
\answer{\prop[6]}{\r6}{type=dragfill}
\answer{\prop[7]}{\r7}{type=dragfill}
\answer{\prop[8]}{\r8}{type=dragfill}
\answer{\prop[9]}{\r9}{type=dragfill}
\answer{\prop[10]}{\r10}{type=dragfill}
\text{totans=item(1..\prop_cnt,
wims(items2words \r1),
wims(items2words \r2),
wims(items2words \r3),
wims(items2words \r4),
wims(items2words \r5),
wims(items2words \r6),
wims(items2words \r7),
wims(items2words \r8),
wims(items2words \r9),
wims(items2words \r10))}
text{totans=wims(replace internal ' to ' in \totans)}
\text{clean=}
\text{check=}
\for{t=1 to \acnt}{
\integer{cat=0}
\for{r=1 to \prop_cnt}{
\integer{cat=\all[\t] iswordof \totans[\r]?\r}
}
\if{\cat > 0}{
\text{clean=\clean \estun \props[\cat],}
\text{check=\alli[\t]=\cat?\check 1,:\check 0,}
}{
\text{clean=\clean \noclass,}
\text{check=\check 0,}
}
}
\if{\dist!=}{
\for{t=1 to 1}{
\integer{cat=0}
\for{r=1 to \prop_cnt}{
\integer{cat=\dist[\t] iswordof \totans[\r]?\r}
}
\if{\cat = 0}{
\text{clean=\clean \dist[\t] \noclass,}
\text{check=\check 1,}
}{
\text{clean=\clean \dist[\t] \estun \props[\cat],}
\text{check=\check 0,}
}
}
}
\condition{\all[1] \clean[1]}{\check[1]=1}
\condition{\all[2] \clean[2]}{\check[2]=1}
\condition{\all[3] \clean[3]}{\check[3]=1}
\condition{\all[4] \clean[4]}{\check[4]=1}
\condition{\all[5] \clean[5]}{\check[5]=1}
\condition{\all[6] \clean[6]}{\check[6]=1}
\condition{\all[7] \clean[7]}{\check[7]=1}
\condition{\all[8] \clean[8]}{\check[8]=1}
\condition{\all[9] \clean[9]}{\check[9]=1}
\condition{\all[10] \clean[10]}{\check[10]=1}
\condition{\all[11] \clean[11]}{\check[11]=1}
\condition{\all[12] \clean[12]}{\check[12]=1}
\condition{\all[13] \clean[13]}{\check[13]=1}
\condition{\all[14] \clean[14]}{\check[14]=1}
\condition{\all[15] \clean[15]}{\check[15]=1}
\condition{\all[16] \clean[16]}{\check[16]=1}
\condition{\all[17] \clean[17]}{\check[17]=1}
\condition{\all[18] \clean[18]}{\check[18]=1}
\condition{\all[19] \clean[19]}{\check[19]=1}
\condition{\all[20] \clean[20]}{\check[20]=1}