%%Le source de cet exercice a été créé à l'aide de Quicktool
%%Le type de l'exercice est QUIFAITQUOI.
%% Vous pouvez le modifier si vous désirez l'adapter.
%% Sun Aug 24 20:19:15 2008

###################
\title{Eurogestures : Qui fait quoi}
\author{Csilla Ducrocq}
\email{csilla.ducrocq@u-psud.fr}
\language{fr}
\computeanswer{no}
\format{html}
\text{file=eurogestures_quifaitquoi}
\text{notepad=slib(utilities/notepad Notepad,small)}
\text{instruction=asis(Après avoir lu le texte, dire qui fait quoi.)}
\text{instruction2=asis()}
\text{choice=}
\text{common=}
\text{audio_file=no}
\text{reading_file=eurogestures}
\text{image_file=no}
\text{video_file=no}
\text{alea=yes}
\text{size=}
\text{partialscore=split}
\text{percent=1}
\text{aucune=aucune de ces possibilités}
\text{format=clickfill}
\text{specialhelp1=}
\text{specialhelp2=}
\text{specialhelp3=}
\text{helpprompt=}
\text{reaccent=}
\text{style_question=background-color: #99FFFF;	margin: 2% 5%;	padding: 2%;}
\text{style_reponse=background-color: #FFCC99;	color: black;	margin: 2% 5%;	padding: 2%;}
\text{style_oef=}
\text{style_css=ol li {list-style: upper-alpha; }}
\text{paste=yes}
\text{pos_rep=inside}
\text{second_step=yes}
\text{first_step=1}
\text{answer_given=}
\text{try=}
\text{packs=}
\text{player=---}
#####################

\text{file0=randitem(\file)}
\integer{cnt_question= wims(recordcnt \file0)}

################
\text{MAX=1}
\text{N=1}
\text{M=3}
################
\text{autocompletion=\format iswordof case ? autocomplete=off}
\text{player=wims(replace internal - by in \player)}
\text{specialhelp=\specialhelp1,\specialhelp2,\specialhelp3}
\text{helpprompt=\helpprompt = ?++>}
\integer{first_step=\first_step notwordof 0 ? 1}
\text{option_reaccent=\reaccent!=yes ? noreaccent:}
\text{nopaste=\paste issametext no ? slib(utilities/nopaste )}

\text{instruction=\instruction issametext ? wims(getdef instruction in \file0)}
\text{instruction2=\instruction2 issametext ? wims(getdef instruction2 in \file0)}
\text{size=\size issametext ? wims(getdef size in \file0)}
\text{reading_file=\reading_file issametext ? wims(getdef reading_file in \file0)}
\text{reading = wims(record 0 of \reading_file)}

\text{audio_file = \audio_file issametext ? wims(getdef audio_file in \file0)}
\text{audio=\audio_file notsametext  and  \audio_file notsametext no? 
<p align="center">slib(media/audio \imagedir/\audio_file,player=\player)</p>}

\text{image_file=\image_file issametext ? wims(getdef image_file in \file0)}
\text{image=\image_file notsametext  and  \image_file notsametext no? 
wims(makelist <img src=\imagedir/x> for x in \image_file)}

\text{video_file=\video_file issametext ? wims(getdef video_file in \file0)}
\if{\video_file notsametext  and  \video_file notsametext no}{ 
  \text{video_file=http notin \video_file ? \imagedir/\video_file}
\text{video=\video_file notsametext ? <a wims_target=external href="\video_file">[video] </a></p>}
}
\text{choix=\choice issametext ? wims(getdef choice in \file0):\choice}

\text{style = <style type="text/css">
 .question {\style_question}
 .reponse {\style_reponse}
 .oefstatement{\style_oef}
 \style_css
 </style>
 }

\text{try =\try notwordof 1 2 3 4 5 6 7 8 9 10 ? 1}
\text{size=\format iswordof dragfill clickfill ? \size x 1}
\integer{N = min(\cnt_question,\N)}
\integer{MAX=min(\N*\MAX,\cnt_question)}
\text{battage=\alea issametext yes ? shuffle(\cnt_question) :
wims(makelist x for x = 1 to \cnt_question)}
     \text{aucune=\aucune issametext ? aucune de ces possibilités}
\text{texte=wims(randrecord \file)}
\text{texte=wims(embraced randitem \texte)}
\text{bat=shuffle(\cnt_qual)}
\text{sens=}
\text{preliminaire_test=row(1,\texte)}
\text{inst_audio=wims(getopt audio in \preliminaire_test)}
\text{inst_image=wims(getopt image in \preliminaire_test)}
\text{inst_title=wims(getopt title in \preliminaire_test)}
\text{inst_intro=wims(getopt intro in \preliminaire_test)}
\text{test_inst=\inst_audio\inst_image\inst_title\inst_intro  notsametext ? 1 : 0}
\text{rab_inst=}
\text{rab_inst=\inst_title notsametext ?\rab_inst<p align="center">\inst_title</p>}
\text{rab_inst=\inst_intro notsametext ?\rab_inst \inst_intro}
\text{rab_inst=\inst_image notsametext ? \rab_inst <p align="center"><img src=\imagedir/\inst_image></p>}
\if{\inst_audio notsametext }{
     \text{rab_inst1= . isin \inst_audio or \packs= ? 
       slib(media/audio \imagedir/\inst_audio,player=\player):slib(lang/swac \inst_audio,\packs,player=\player)}
     \text{rab_inst=\rab_inst <p align="center">\rab_inst1[1;1]</p>}
   }
\text{preliminaire=\test_inst=1  ? \rab_inst:}
\matrix{texte=\test_inst=1 ? wims(line 2 to -1 of \texte)}
\text{premiereligne=\texte[1;]}
\text{test=wims(text remove 1234567890 in \premiereligne)}
\if{\test issametext }{
  \integer{nombre= \premiereligne+1}
  \text{commentaire=wims(rows2lines \texte[\nombre+1..-1;])}
  \matrix{texte=\texte[2..\nombre;]}
}
{
  \integer{nombre= \texte[2;]+2}
  \text{choix=\texte[1;]}
  \text{commentaire=wims(rows2lines \texte[\nombre+1..-1;])}
  \matrix{texte=\texte[3..\nombre;]}
}


\integer{sens=\sens notwordof 1 2 ? randint(1..2)}

\text{qual=\texte[;1]}
\text{qual=\sens=1?\qual,\aucune}
\text{liste=\sens=1 ? \choix:\qual}

\text{qual=\sens=2?\choix:\qual}
\text{qual=wims(nonempty items \qual)}
\text{cnt_qual=items(\qual)}
\text{cnt_qual1=\sens=1?\cnt_qual-1:\cnt_qual}

\text{cnt_liste=items(\liste)}
\matrix{R = \texte[;2..-1]}

\if{\sens=1}{reponse pour chaque personne : 
\matrix{reponse=}
\for{ i= 1 to \cnt_liste}{
  \text{rep=}
  \for{ j = 1 to  \cnt_qual1}{
    \if{\i isitemof \R[\j;]}{
     \text{rep =\rep, \j}
    }
   }
    \text{rep=wims(nonempty items \rep)}
   \text{rep= \rep issametext ? \cnt_qual}
  \matrix{reponse=\reponse
  \rep}
}
}
{\text{reponse=\R}}

\text{STEP=wims(makelist r x for x = 1 to \cnt_liste)}

\steps{\STEP}
\statement{
\style \instruction
\preliminaire

\if{\commentaire notsametext }{
 <div class="question">\commentaire</div>
}
  \if{\reading notsametext }{\special{help reading,reading}}
  \if{\image notsametext }{\special{help image,[à regarder]}}
  \audio\video

<ol>
\for{u = 1 to \cnt_liste}{ 
<li> \liste[\u] : <ol>
 \for{ v = 1 to \cnt_qual}{
 <li>
   \embed{reply \u , \v }
</li>
  }
   </ol>
 }
 </ol>
 }
 \answer{}{\reponse[1;];\qual}{type=checkbox}
 \answer{}{\reponse[2;];\qual}{type=checkbox}
 \answer{}{\reponse[3;];\qual}{type=checkbox}
 \answer{}{\reponse[4;];\qual}{type=checkbox}
 \answer{}{\reponse[5;];\qual}{type=checkbox}
 \answer{}{\reponse[6;];\qual}{type=checkbox}
 \answer{}{\reponse[7;];\qual}{type=checkbox}
 \answer{}{\reponse[8;];\qual}{type=checkbox}
 \answer{}{\reponse[9;];\qual}{type=checkbox}
 \answer{}{\reponse[10;];\qual}{type=checkbox}
 \answer{}{\reponse[11;];\qual}{type=checkbox}
 \answer{}{\reponse[12;];\qual}{type=checkbox}
 \answer{}{\reponse[13;];\qual}{type=checkbox}
 \answer{}{\reponse[14;];\qual}{type=checkbox}    
\help{\nopaste\if{\help_subject issametext reading or
\help_subject issametext image
or  \help_subject issametext }{
\reading

\image}
} 
