Subversion Repositories wimsdev

Rev

Rev 15179 | Blame | Compare with Previous | Last modification | View Log | RSS feed

type=classify
textarea="data pre post"
iEdit="pre post"

:Clasificar los objetos arrastrándolos y soltándolos.

Presentamos una lista de objetos, y debemos clasificarlos según sus
propiedades, tirando de ellos con el mouse a las cajas provistas.
<p>
Para construir un ejercicio con este modelo, solo ingrese la lista
objetos y sus propiedades.
</p><p>
Con una pequeña modificación, una variante de este modelo puede aceptar
imágenes como objetos.
</p><p class="wims_credits">
Autor del modelo: <a href="mailto:qualite@wimsedu.info">Gang Xiao</a></p>

:%%%%%%%%%%%%%%%%%      ATENCIÓN      %%%%%%%%%%%%%%%%%%%%

Elimina la cabecera anterior si borra las etiquetas para el modelo!
(Son las líneas que comienzan con un ':'.)
En caso contrario el ejercicio puede no funcionar bajo Createxo.

:%%%%%%%% Parámetros del ejemplo a redefinir %%%%%%%%%%%%%%%%%

:\title{Clasificar  por categoría}
:\author{XIAO, Gang}
:\email{qualite@wimsedu.info}
:\credits{}

:Cantidad de objetos para clasificar por ejercicio. Hasta 20
\integer{tot=8}

:La cantidad máxima de objetos presentados que tienen la misma propiedad.
Este número debe ser estrictamente mayor que 1.
\integer{max1=4}

:El número de propiedades a presentar (por defecto, el número de propiedades)
Si el número de propiedades es estrictamente menor que el número de propiedades,
un distractor se seleccionará de las propiedades no mostradas.
\text{prop_cnt=}

:El tamaño de los objetos para arrastrar, en píxeles, x por y.
¡Piensa en las personas que aumentan el tamaño de letra de sus navegadores!
No pongas las cajas demasiado pequeñas.
\text{size1=100x40}

:Lista de propiedades. Hasta 10, separadas por comas.
\text{prop=Insecto,Ave,Mamífero}

:Datos principales
Escriba (uno por línea) los objetos a clasificar, luego su categoría, separados por una coma. <p>
El objeto puede ser una palabra, una oración (sin comas) e incluso una imagen.
Es mejor definir suficientes datos para cada
categoría y al menos dos objetos para cada categoría.</p><p>
¡Tenga cuidado de no introducir errores de tipeo en las propiedades!
De lo contrario, el objeto correspondiente puede provocar un mal funcionamiento del ejercicio.</p>
\matrix{data=abeja,Insecto
águila,Ave
albatros,Ave
alondra,Ave
cucaracha,Insecto
pato,Ave
gato,Mamífero
caballo,Mamífero
perro,Mamífero
cerdo,Mamífero
cuervo,Ave
langosta,Insecto
elefante,Mamífero
halcón,Ave
gaviota,Ave
avispa,Insecto
león,Mamífero
gorrión,Ave
mosca,Insecto
mosquito,Insecto
oveja,Mamífero
ganso,Ave
mariposa,Insecto
paloma,Ave
zorro,Mamífero
ruiseñor,Ave
escorpión,Insecto
mono,Mamífero
tigre,Mamífero
vaca,Mamífero
buitre,Ave
}

:Opciones.
Añadir <ul><li> la palabra <span class="wims_code_words">shuffle</span> si queremos que el orden de las propiedades sea
aleatorio, </li><li> la palabra <span class="wims_code_words">vertical</span>
si quieres una disposición vertical de los campos.
</li></ul>
\text{option=}

:Texto antes de la tabla. Etiquetas HTML permitidas.
\text{pre=Clasifica los siguientes animales de acuerdo a sus categorías.}

:Texto después de la tabla. Etiquetas HTML permitidas.
\text{post=}

:Verbo y artículo para mostrar delante de la categoría clasificada.
\text{estun=es un}

:¿Cómo decir si un objeto no está clasificado?
\text{noclass=no pertenece a ninguna categoría}

:%%%%%%%%%%%%%% Nada que modificar hasta el enunciado %%%%%%%%%%%%%%%%

\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 &#39; 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}