Skip to content
Snippets Groups Projects
Forked from Nicolas Thiery / wims-info
Loading
etat_civil.def 6.25 KiB
!set title=tat civil
!if $wims_read_parm!=$empty
 !goto $wims_read_parm
!endif
oef2wims_version=3.22
language=fr
author=Mathieu Clment-Ziza
email=clementm@necker.fr

ansorder=r
varcnt=38
prevarcnt=37
postvarcnt=0
replycnt=1
choicecnt=0
conditioncnt=0
feedbackcnt=0
format=html

val1=$imagedir
val2=$confparm1
val3=$confparm2
val4=$confparm3
val5=$confparm4

!if $testcondition=yes
 !goto test
!endif
!if $status=waiting
 !exit
!endif

val6=C_etat_civil
tmp=!nonempty items celibataire, marie

tmp0=!randitem $tmp
val7=$(tmp0)

!ifval $val7 issametext celibataire 
val8= Mademoiselle 
!else
val8= Madame
!endif

!ifval $val7 issametext celibataire 
val9= Madame 
!else
val9= Mademoiselle
!endif
tmp=!nonempty items Oui,OUI

tmp0=!randitem $tmp
val10=$(tmp0)

!ifval $val10 issamecase Oui 
val11= OUI 
!else
val11= Oui
!endif
tmp=!nonempty items Oui,OUI

tmp0=!randitem $tmp
val12=$(tmp0)
tmp=!nonempty items Trucmuche,Trucmachin

tmp0=!randitem $tmp
val13=$(tmp0)
val14=<pre style="background-color:#F0FFFF; color:red;">	#include&#60;stdio.h>	#include&#60;string.h>		int main(void)	{	   char reponse1[4];	   char reponse2[4];	   char etat[14];	   char nom[30];	   printf("tes vous de sexe masculin ? ");	   scanf("%s",reponse1);	   if (strcmp(reponse1,"oui") == 0 || strcmp(reponse1,"$val10") == 0)	      strcpy(etat,"Monsieur");	   else	   {	      printf("tes-vous $val7 ? ");	      scanf("%s",reponse2);	      if (strcmp(reponse2,"oui")==0 || strcmp(reponse2,"$val12")==0)	         strcpy(etat,"$val8");	      else	         strcpy(etat,"$val9");	   }	   printf("Bonjour %s\n",etat);	   printf("Quel est votre nom ? ");	   scanf("%s",nom);	   printf("Au revoir %s ",etat);	   puts(nom);	   return 0;	}	</pre>	
val15=<pre style="background-color:#F0FFFF; color:red;">	#include&#60;iostream>	#include&#60;string>	using namespace std;		int main(void) {	    string reponse1;	    string reponse2;	    string etat;	    string nom;	    cout << "tes vous de sexe masculin ? ";	    cin >> reponse1;	    if (reponse1 == "oui" or reponse1 == "$val10") {	        etat = "Monsieur";	    } else {	        cout << "tes-vous $val7 ? ";	        cin >> reponse2;	        if ( reponse2 == "oui" or reponse2 == "$val12")	            etat = "$val8";	        else	            etat = "$val9";	    }	    cout << "Bonjour: " << etat << endl;	    cout << "Quel est votre nom ? ";	    cin >> nom;	    cout << "Au revoir " << etat << " " nom << endl;	    return 0;	}	</pre>	
val16=<pre style="background-color:#F0FFFF; color:red">		<b>DEBUT DE PROGRAMME</b>		     Afficher ("tes vous de sexe masculin")	   <b>SI</b> reponse est "oui" OU "$val10"	     Copier la chane "Monsieur" dans etat	   <b>SINON</b>	       Afficher ("tes-vous $val7 ? ")	       <b>SI</b> rponse est "oui" OU "$val12"	         Copier la chane "$val8" dans etat	       <b>SINON </b>	         Copier la chane "$val9" dans etat	   <b>Fin SINON</b>		   Afficher ("Bonjour [etat]")	   Afficher ("Quel est votre nom ?")	   Afficher ("Au revoir [etat] [nom]")		<b>FIN DE PROGRAMME</b>	</pre>	
tmp=!trim non,non,$val13	non,NON,$val13	non,oui,$val13	non,Oui,$val13	non,OUI,$val13	NON,non,$val13	NON,NON,$val13	NON,oui,$val13	NON,Oui,$val13	NON,OUI,$val13	$val10,$val13,0	oui,$val13,0	$val11,non,$val13	$val11,NON,$val13	$val11,oui,$val13	$val11,Oui,$val13	$val11,OUI,$val13
val17=!translate internal $	\
$ to ;; in $tmp
tmp=!translate internal $	$ to ; in $val17

tmp0=!rowcnt $tmp
tmp1=!shuffle $(tmp0)

val18=$(tmp1)
tmp=!trim $(val17[$(val18[1]);])
val19=!translate internal $	\
$ to ;; in $tmp
tmp0=!exec bioinfo  $val6 $val10 $val12  $val8 $val9 $val7 $(val19[1;1]) $(val19[1;2]) $(val19[1;3]) 

tmp=!trim $(tmp0)
val20=!translate internal $	\
$ to ;; in $tmp
val21=0
val22=2
!while $val21 < 1 
tmp=!trim $(val17[$(val18[$val22]);])
val23=!translate internal $	\
$ to ;; in $tmp
tmp0=!exec bioinfo  $val6 $val10 $val12 $val8 $val9 $val7 $(val23[1;1]) $(val23[1;2]) $(val23[1;3]) 

val24=$(tmp0)
!if $val24 notsametext $(val20[1;]) 
val21=$[rint($val21+1)]
tmp=!trim $(val20[1;]);$val24
val20=!translate internal $	\
$ to ;; in $tmp
tmp=!trim $(val19[1;]);$(val23[1;])
val19=!translate internal $	\
$ to ;; in $tmp
!endif
val22=$[rint($val22+1)]
!endwhile
val21=0
!while $val21 < 1 
tmp=!trim $(val17[$(val18[$val22]);])
val23=!translate internal $	\
$ to ;; in $tmp
tmp0=!exec bioinfo  $val6 $val10 $val12 $val8 $val9 $val7 $(val23[1;1]) $(val23[1;2]) $(val23[1;3]) 

val24=$(tmp0)
!if $val24 notsametext $(val20[1;]) and $val24 <> $(val20[2;]) 
val21=$[rint($val21+1)]
tmp=!trim $(val20[1;]);$(val20[2;]);$val24
val20=!translate internal $	\
$ to ;; in $tmp
tmp=!trim $(val19[1;]);$(val19[2;]);$(val23[1;])
val19=!translate internal $	\
$ to ;; in $tmp
!endif
val22=$[rint($val22+1)]
!endwhile
tmp0=!randint 1, 3

val25=$[rint($(tmp0))]
val26=<b>$(val19[$val25;1])</b>
val26=$val26 puis <b>$(val19[$val25;2])</b>

!ifval $(val19[$val25;3])!=0 
val26= $val26 et enfin <b>$(val19[$val25;3])</b>
!endif

!ifval $val3 issametext algo
val27=$val16
!else
tmp=!nonempty items $val16,$val14

tmp0=!randitem $tmp
val27=$(tmp0)
!endif

!ifval $val3 issametext code
val27=$val14
!endif

!ifval $val3 issametext code_cpp
val27=$val15
!endif
replytype1=click
replyname1=
replygood1=$val25;A,B,C
question=__EXECUTED_1692754_EXERCISE__

!goto stat

!exit

:question
$()	<!-- Enonc-->	<p>Lors de l'excution de ce programme, par saisie clavier,	l'utilisateur a rpondu successivement $val26.	Quels seront les affichages  l'cran?		<!-- Tableau :  gauche le code C,  droite le QCM -->	</p>	 <table border="0" align="center">	  <tr>	   <td>	    <!-- Affichage du Code C -->	     
!read oef/special.phtml expandlines $val27 
$()	   </td>		    <!-- Mis en forme html du QCM -->	   <td>	    <table align="center" border="1">	     <tr>	      <td>	        
!read oef/embed.phtml reply1,1 
$()	      </td>	      <td>	       <pre>$(val20[1;])</pre>	      </td>	     </tr>		     <tr>	      <td>	        
!read oef/embed.phtml reply1,2 
$()	      </td>	      <td>	       <pre>$(val20[2;])</pre>	      </td>	     </tr>		     <tr>	      <td>	        
!read oef/embed.phtml reply1,3 
$()	      </td>	      <td>	       <pre>$(val20[3;])</pre>	      </td>	     </tr>	    </table>	   </td>		  </tr>	 </table>	
$()
!exit

:hint
$()
$()
!exit

:help
$()
$()
!exit

:solution
$()
$()
!exit

:latex
$()
$()
!exit

:feedback

!exit

:test

!exit

:stat
vsavelist=20,26,27
embedcnt=4