Répondre à : type=set, fset et aset. C'est quoi au juste ?

Accueil Forums Programmation WIMS Programmation d’exercices OEF type=set, fset et aset. C'est quoi au juste ? Répondre à : type=set, fset et aset. C'est quoi au juste ?

#2834
david bergeon
Participant
Up
0
Down
::

Pas de besoin immédiat pour moi, j’ai contourné le truc avec un exercice à étapes en demandant d’abord le nombre de réponses, puis en proposant une case \embed{} par réponse, et ensuite un test des réponses derrière.

ca donne le code mis en bas.

C’est sûr que ça aurait été vraiment mieux avec un type=aset, mais trop tard, c’est fait.

Pour info, première étape, faut mettre 1 si ce sont les 2 mêmes molécules, et 4 si elles sont différentes.

\title{09.3 - Nom des dipeptides.}
\language{fr}
\range{-5..5}
\author{David Bergeon}
\email{david.bergeon@yahoo.fr}
\computeanswer{no}
\format{html}

\text{spc= }

\text{list=Ala,alanine,l'
Cys,cystéine,la\spc
Asp,acide aspartique,l'
Glu,acide glutamique,l'
Phe,phénylalanine,la\spc
Gly,glycine,la\spc
His,histidine,l'
Lys,lysine,la\spc
Leu,leucine,la\spc
Met,méthionine,la\spc
Asn,asparagine,l'
Pyl,pyrrolysine,la\spc
Pro,proline,la\spc
Gln,glutamine,la\spc
Arg,arginine,l'
Ser,sérine,la\spc
Thr,thréonine,la\spc
Sec,sélénocystéine,la\spc
Val,valine,la\spc
Trp,tryptophane,la\spc
Tyr,tyrosine,la\spc}

Ile,isoleucine,l' -> enlevé car I et l trop ressemblants

-------------------------------------------------------
liste de 3 acides alpha aminés aaa

\integer{n=rows(\list)}
\text{ordre=shuffle(\n)}
\integer{i=\ordre[1]}
\integer{j=\ordre[2]}
\integer{k=\ordre[3]}

\text{aaa1=row(\i,\list)}
\text{aaa2=row(\j,\list)}
\text{aaa3=row(\k,\list)}

-------------------------------------------------------
on change l'ordre des aaa pour les questions

\text{ordre=shuffle(3)}
\integer{i=\ordre[1]}
\integer{j=\ordre[2]}
\integer{k=\ordre[3]}

\text{listaaa=\aaa1
\aaa2
\aaa3}

\text{a1=row(\i,\listaaa)}  a1 et a2 seront mélangés
\text{a2=row(\j,\listaaa)}
\text{a3=row(\k,\listaaa)}  a3 réagira seul
-------------------------------------------------------
On choisit quelle question on demande en premier :

\integer{q=randint(1..2)}
q=1 -> a1 avec a2, puis a3 avec a3
q=2 -> a3 avec a3, puis a1 avec a2

-------------------------------------------------------
Réponses 2,3 et 4

\if{\q=1}{\integer{rep2=4} \integer{rep3=1}}
\if{\q=2}{\integer{rep2=1} \integer{rep3=4}}

\text{rep4=\a3[1]-\a3[1]}  <-- a3 avec a3

-------------------------------------------------------
On construit les noms des dipeptides

\text{m=-}

\text{RR1=\a1[1]-\a1[1]}
\text{RR1=wims(lower \RR1) }
\text{RR2=\a2[1]-\a2[1]}
\text{RR2=wims(lower \RR2) }
\text{RR3=\a1[1]-\a2[1]}
\text{RR3=wims(lower \RR3) }
\text{RR4=\a2[1]-\a1[1]}
\text{RR4=wims(lower \RR4) }
-------------------------------------------------------
Déf des 2 étapes

\nextstep{ reply1,reply2,reply3
reply4,reply5,reply6,reply7,reply8}
-------------------------------------------------------

\statement{
<font color=red size=4><u>/!\</u> Attention, exercice en 2 étapes</font><br>
Il faut avoir bon aux 3 réponses pour passer à la deuxième étape.<p>

On considère les <u><b>acides \alpha-aminés</b></u> suivants :<br>
- \aaa1[3]<font color=blue><b>\aaa1[2] (\aaa1[1])</b></font><br>
- \aaa2[3]<font color=blue><b>\aaa2[2] (\aaa2[1])</b></font><br>
- \aaa3[3]<font color=blue><b>\aaa3[2] (\aaa3[1])</b></font><p>

1 - En faisant réagir 2 acides \alpha-aminés, on obtient un \embed{r1,10}<p>
2 - La réaction entre \if{\q=1}{<font color=blue><b>\a1[3]\a1[2]</b></font> et <font color=blue><b>\a2[3]\a2[2]</b></font>}{<font color=blue><b>\a3[3]\a3[2]</b></font> et <font color=blue><b>\a3[3]\a3[2]</b></font>} peut former \embed{r2,3} produit(s) différent(s)<p>
3 - La réaction entre \if{\q=2}{<font color=blue><b>\a1[3]\a1[2]</b></font> et <font color=blue><b>\a2[3]\a2[2]</b></font>}{<font color=blue><b>\a3[3]\a3[2]</b></font> et <font color=blue><b>\a3[3]\a3[2]</b></font>} peut former \embed{r3,3} produit(s) différent(s)<p>

\if{\step>=2}{
  \if{\q=2}{4 - Comment s'appelle le dipeptide formé à partir de <font color=blue><b>\a3[3]\a3[2]</b></font> seule ?<br> \embed{r4,10}<br>}
  \if{\q=1}{4}{5} - Comment s'appellent les 4 dipeptides formés à partir de <font color=blue><b>\a1[3]\a1[2]</b></font> et de <font color=blue><b>\a2[3]\a2[2]</b></font> <br>
  \embed{r5,10}, \embed{r6,10}, \embed{r7,10} et \embed{r8,10}<br>
  \if{\q=1}{5 - Comment s'appelle le dipeptide formé à partir de <font color=blue><b>\a3[3]\a3[2]</b></font> seule ?<br> \embed{r4,10}<br>}

  }
}

\answer{}{dipeptide}{type=atext}
\answer{}{\rep2}{type=numeric}
\answer{}{\rep3}{type=numeric}
\answer{}{\rep4}{type=raw}{option=nocase}
\answer{}{\rep5}{type=raw}{option=nocase}
\answer{}{\rep6}{type=raw}{option=nocase}
\answer{}{\rep7}{type=raw}{option=nocase}
\answer{}{\rep8}{type=raw}{option=nocase}

\condition{1}{\reply5 issametext \RR1 or \reply5 issametext \RR2 or \reply5 issametext \RR3 or \reply5 issametext \RR4}
\condition{2}{(\reply6 issametext \RR1 or \reply6 issametext \RR2 or \reply6 issametext \RR3 or \reply6 issametext \RR4) and (\reply6 notsametext \reply5)}
\condition{3}{(\reply7 issametext \RR1 or \reply7 issametext \RR2 or \reply7 issametext \RR3 or \reply7 issametext \RR4) and (\reply7 notsametext \reply5) and (\reply7 notsametext \reply6)}
\condition{4}{(\reply8 issametext \RR1 or \reply8 issametext \RR2 or \reply8 issametext \RR3 or \reply8 issametext \RR4) and (\reply8 notsametext \reply5) and (\reply8 notsametext \reply6) and (\reply8 notsametext \reply7)}

\feedback{1=1}{Les 4 dipeptides qui peuvent être formés sont : \a1[1]-\a1[1], \a2[1]-\a2[1], \a1[1]-\a2[1] et \a2[1]-\a1[1]}