liste à ordonner ( exercice oef )

Accueil Forums Programmation WIMS Programmation d’exercices OEF liste à ordonner ( exercice oef )

Vous lisez 2 fils de discussion
  • Auteur
    Messages
    • #6791
      Lionel Verbecq
      Participant
      Up
      0
      Down
      ::

      Bonjour,
      Je veux faire ordonner une liste d’objets mais dans cette liste des objets se répètent. Comment faire en sorte qu’il y ait juste le nombre d’objets distincts et laisser la possibilité de choisir plusieurs fois le même objet ? Merci.

      voici un extrait de mon source :
      \integer{tot=15}
      \text{size=80×40}
      \text{explain=<p>Compléter la formule de double distributivité suivante : \({(a+b)(c+d)=})</p>}

      :La liste d’objets à réordonner
      \text{data=a,\(\times),c,+,a,\(\times),d,+,b,\(\times),c,+,b,\(\times),d}

      :Mise en aléatoire par des accolades emboitables
      help
      \text{accolade=item(1,1 oui, 2 non)}

      :%%%%%%%%%%%%%% Rien à modifier avant l’énoncé %%%%%%%%%%%%%%%%
      \text{data=randomrow(\data)}
      \text{accolade=wims(word 1 of \accolade)}
      \text{data=\accolade=1 ? wims(embraced randitem \data)}
      \integer{datacnt=items(\data)}
      \integer{tot=min(20,min(\tot,\datacnt))}
      \if{\tot<\datacnt}{
      \text{sh=shuffle(\datacnt)}
      \text{sh=wims(sort numeric items \sh[1..\tot])}
      \text{data=item(\sh,\data)}
      }

      \text{st=wims(makelist r x for x=1 to \tot)}
      \text{datatext = slib(data/random \tot, item, \data)}
      \steps{\st}

      :%%%%%%%%%%%%% Maintenant l’énoncé en code html. %%%%%%%%%%%%%%%%%%%%

      ::Vous n’avez pas besoin de modifier ceci en général.
      \statement{

      \explain

      \for{k=1 to \tot}{

      \embed{r\k,\size}

      }}

      :%%%%%%%%%%%%% Rien à modifier ci-après. %%%%%%%%%%%%%%%%%5

      \answer{1}{\data[1]}{type=dragfill}
      \answer{2}{\data[2]}{type=dragfill}
      \answer{3}{\data[3]}{type=dragfill}
      \answer{4}{\data[4]}{type=dragfill}
      \answer{5}{\data[5]}{type=dragfill}
      \answer{6}{\data[6]}{type=dragfill}
      \answer{7}{\data[7]}{type=dragfill}
      \answer{8}{\data[8]}{type=dragfill}
      \answer{9}{\data[9]}{type=dragfill}
      \answer{10}{\data[10]}{type=dragfill}
      \answer{11}{\data[11]}{type=dragfill}
      \answer{12}{\data[12]}{type=dragfill}
      \answer{13}{\data[13]}{type=dragfill}
      \answer{14}{\data[14]}{type=dragfill}
      \answer{15}{\data[15]}{type=dragfill}
      \answer{16}{\data[16]}{type=dragfill}
      \answer{17}{\data[17]}{type=dragfill}
      \answer{18}{\data[18]}{type=dragfill}
      \answer{19}{\data[19]}{type=dragfill}
      \answer{20}{\data[20]}{type=dragfill}

      \latex{
      \begin{statement}
      \explain \newline
      \listchoice{\datatext}
      \end{statement}
      \begin{solution}
      \data
      \end{solution}
      }

    • #6792
      byache
      Participant
      Up
      0
      Down
      ::

      Pour éliminer les doublons il y a :
      wims(listuniq taliste)

      Pour pouvoir utiliser plusieurs fois une étiquette, il y a le type de réponse clickfill

      Est ce que ces infos te suffisent ?

    • #6793
      Lionel Verbecq
      Participant
      Up
      0
      Down
      ::

      Oui merci car avec un peu de recherche sur clickfill et l’aide de Fabrice Guerimand, j’ai obtenu ce que je voulais faire.
      Cela a donné :
      \title{Compléter la formule de la double distribuivité}
      \text{fois=\(\times)}
      \text{rep=(a,\fois,c,+,a, \fois,d,+,b,\fois,c,+, b, \fois,d)}
      \statement{Compléter la formule de la double distributivité.\((a+b)(c+d)=)
      \embed{r1,30×30}}
      \answer{\((a+b)(c+d)=)}{a,\fois,c,+,a, \fois,d,+,b,\fois,c,+, b, \fois,d|-,\(\div)}{type=clickfill}

Vous lisez 2 fils de discussion
  • Vous devez être connecté pour répondre à ce sujet.