Subversion Repositories wimsdev

Rev

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

type=classify
textarea="data instruction"
iEdit="instruction"

:Clasificar los objetos por sus propiedades en una tabla.

Presentamos una lista de objetos y una lista de atributos (propiedades). Tienes que llenar
una tabla según si los objetos verifican las propiedades o no marcando o no en el recuadro.

<p>
Para construir un ejercicio con este modelo, solo ingrese la lista
de atributos y una lista de objetos donde se indique si verifican o no
propiedades en el mismo orden que los atributos (con un 0 o un 1)
</p><p>
Este ejercicio se puede transformar fácilmente para incluirlo en un módulo OEF
si quieres poner los datos en un archivo auxiliar.
</p><p class="wims_credits">
  Autor del modelo: <a href="mailto:bernadette.m.riou@orange.fr">Bernadette Perrin-Riou</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{Tabla para llenar (checkbox)}
:\author{Bernadette, Perrin-Riou}
:\email{bpr@math.u-psud.fr}
:\credits{}

:Enunciado
\text{instruction= Llena el cuadro.}

:Número de objetos escogidos al azar
\integer{N=3}

:Nombre del fichero
llenar solo si desea usar un archivo de datos (en un módulo OEF).
\text{file=}
del tipo
<pre>
  pelos,plumas,cuatro patas,alas
 :urraca,0,1,0,1
 :buey,1,0,1,0
</pre>
En este caso, los siguientes datos no serán tomados en cuenta.
De lo contrario, complete los datos.

:Lista de atributos
\text{attribut=pelos,plumas,cuatro patas,alas}

:Datos
una línea por objeto
\text{data=urraca,0,1,0,1
buey,1,0,1,0
gato,1,0,1,0
moquito,0,0,0,1}

:Texto o imágenes para indicar una respuesta buena o mala
Este texto se muestra en el momento de la respuesta, por defecto aparecen las imágenes.
\text{nonoui=}

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

\text{size=50,50}
\integer{w=\size[1]+10}
\css{<style>
  .big_check{text-align: center}
  .cross{color:black; font-size:20pt;}
  @supports (zoom:2){
    .big_check>input{zoom: 1.4;}
  }
  @supports not (zoom:2){
    .big_check>input{transform: scale(1.4);}
  }
  .big_check>label{color:transparent;width:1px;height:1px;position: absolute;}
</style>}
\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">}
\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)}
\text{Data=}
\text{R=}
\for{u=1 to \N}{
  \for{v=2 to \attribut_cnt+1}{
    \integer{uu=(\u-1)*\attribut_cnt + \v -1}
    \text{Data=\data[\u;\v]=1? wims(append item \uu to \Data)}
  }
}
\text{C=wims(makelist x for x=1 to \N*\attribut_cnt)}
\text{C1=wims(makelist x for x=1 to \N*\attribut_cnt)}
\text{nstep=r1}
\nextstep{\nstep}
\text{tab=wims(makelist c for x=1 to \attribut_cnt+1)}
\text{tab=wims(replace internal , by | in |\tab|)}
\text{latexsrc=\begin{tabular}{\tab}\hline}
\for{lk=1 to \attribut_cnt}{
  \text{latexsrc=\latexsrc&\attribut[\lk]}
}
\text{latexsrc=\latexsrc \\\hline}
\text{latexsol=\latexsrc}
\for{jl=1 to \N}{
  \text{latexsrc=\latexsrc
  \data[\jl;1]}
  \text{latexsol=\latexsol
  \data[\jl;1]}
  \for{kl=1 to \attribut_cnt}{
    \integer{lkk=(\jl-1)*\attribut_cnt + \kl}
    \text{latexsrc=\latexsrc &}
    \text{latexsol=\latexsol &}
    \if{\lkk isitemof  \Data}{\text{latexsol=\latexsol \(\times\) }}
  }
  \text{latexsrc=\latexsrc \\\hline}
  \text{latexsol=\latexsol \\\hline}
}
\text{latexsrc=\latexsrc
\end{tabular}}
\text{latexsol=\latexsol
\end{tabular}}

\text{givegood=slib(oef/env givegood)}
\text{givegood=\givegood issametext ? 1}

\statement{
  <div class="instruction">\instruction</div>
  <table class="wimstable">
    <thead>
    <tr>
      <td></td>
      \for{k=1 to \attribut_cnt}{<th scope="col">\attribut[\k]</th>}
    </tr>
    </thead>
    <tbody>
    \for{j=1 to \N}{
      <tr>
        <th scope="row">\data[\j;1]</th>
        \for{k=1 to \attribut_cnt}{
          \if{\step=1}{
            <td class="big_check">\embed{r1,\C[(\attribut_cnt)*(\j-1)+\k]}</td>
          }{
            <td class="big_check">\C[(\attribut_cnt)*(\j-1)+\k]</td>
          }
        }
      </tr>
    }
    </tbody>
  </table>
}

\answer{}{\Data;\C1}{type=checkbox}{option=split noanalyzeprint nonstop}
\text{nstep=}
\text{C=}
\if{\givegood=0}{
  \text{feedbackbon=}
  \text{feedbackfaux=}
}
{
  \text{feedbackbon=<span class="oef_indgood">\nonoui[1]</span>}
  \text{feedbackfaux=<span class="oef_indbad">\nonoui[2]</span>}
}
\text{croix=<span class="cross">&#9745;</span>}
\text{nocroix=<span class="cross">&#9744;</span>}
\text{lignef=}
\for{u=1 to \N}{
  \for{v=2 to \attribut_cnt+1}{
    \integer{uu=(\u-1)*\attribut_cnt + \v -1}
    \text{C=\uu isitemof \reply1 and \uu isitemof \Data ? wims(append item  \croix \feedbackbon  to \C)}
    \if{\uu isitemof \reply1 and \uu notitemof \Data}{
      \text{C= wims(append item \croix \feedbackfaux  to \C)}
      \text{lignef=wims(append item \u to \lignef)}
      }
      {\if{\uu notitemof \reply1 and \uu isitemof \Data}{
         \text{C= wims(append item \nocroix \feedbackfaux  to \C)}
         \text{lignef=wims(append item \u to \lignef)}
         }
      }
    \text{C=\uu notitemof \reply1 and \uu notitemof \Data ? wims(append item \nocroix \feedbackbon to \C)}
  }
}

\feedback{\givegood>0}{\nonoui[1] : su respuesta es correcta, \nonoui[2] : su respuesta no es correcta.
}
\integer{nblignef=items(\lignef)}
\feedback{\givegood=0 and \nblignef>0}{<div class="feedback oef_indbad">\if{\nblignef=1}{
No llenaste la línea \lignef del cuadro}{No llenaste las líneas \lignef[1..-2] y \lignef[-1] } correctamente.</div>}


\latex{
\begin{statement}
\instruction
\newline
\latexsrc
\end{statement}
\begin{solution}\
\begin{center}
\latexsol
\end{center}
\end{solution}
}