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

###################
\title{Question word order compose}
\author{Csilla Ducrocq}
\email{csilla.ducrocq@u-psud.fr}
\language{fr}
\computeanswer{no}
\format{html}
\text{file=question_word_order_compose}
\text{notepad=slib(utilities/notepad Notepad,small)}
\text{instruction=asis(Put the words in the correct order to form questions.)}
\text{instruction2=asis()}
\text{choice=}
\text{common=}
\text{audio_file=no}
\text{reading_file=no}
\text{image_file=no}
\text{video_file=no}
\text{alea=yes}
\text{size=10}
\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=4}
################
\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)}
     \matrix{PHRASE=}
\matrix{PRELIMINAIRE=}
\for{i=1 to \MAX}{
 \text{phrase=wims(randrecord randitem(\file))}
 \text{phrase=wims(embraced randitem \phrase)}
 \text{preliminaire_test=\phrase}
 \text{preliminaire_test=row(1,\phrase)}
 \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>}
 \text{rab_inst=\inst_audio notsametext ? \rab_inst<p align="center">slib(media/audio \imagedir/\inst_audio,player=\player)</p>}
 \text{preliminaire=\test_inst=1  ? \rab_inst:}
 \text{phrase=\test_inst=1 ? wims(line 2 of \phrase)}
 \text{phrase=wims(replace internal / by , in  \phrase)}
 \matrix{PHRASE=\PHRASE
 \phrase}
 \matrix{PRELIMINAIRE=\PRELIMINAIRE
 \preliminaire}
}

\text{STEP = wims(makelist r x for x = 1 to \MAX)}
\text{U = pari(divrem(\MAX,\N)~)}
\integer{cnt_step = \U[1] + 1}
\matrix{STEPS = }
\for{ u = 1 to \cnt_step -1}{
   \matrix{STEPS =\STEPS
wims(makelist r x for x = (\u -1)*\N +1 to \N*\u)}
}
\matrix{STEPS = \STEPS
 wims(makelist r x  for x = \N*(\cnt_step-1)+1 to \MAX)}
\steps{\STEPS}


\statement{\nopaste\style \instruction  
  \if{\reading notsametext }{\special{help reading,[à lire]}}
  \if{\image notsametext }{\special{help image,[à regarder]}}
  \audio\video
  \for{ h = 1 to  \N}{
  \if{\PRELIMINAIRE[\h;] notsametext}{<div class="reponse">\PRELIMINAIRE[\h;]</div>}
  
  <div class="question"> \embed{reply \STEPS[\step; \h],\size} </div>

  }
}

\answer{}{\PHRASE[1;]}{type=compose}
\answer{}{\PHRASE[2;]}{type=compose}
\answer{}{\PHRASE[3;]}{type=compose}
\answer{}{\PHRASE[4;]}{type=compose}
\answer{}{\PHRASE[5;]}{type=compose}
\answer{}{\PHRASE[6;]}{type=compose}
\answer{}{\PHRASE[7;]}{type=compose}
\answer{}{\PHRASE[8;]}{type=compose}
\answer{}{\PHRASE[9;]}{type=compose}
\answer{}{\PHRASE[10;]}{type=compose}
\answer{}{\PHRASE[11;]}{type=compose}
\answer{}{\PHRASE[12;]}{type=compose}
\answer{}{\PHRASE[13;]}{type=compose}
\answer{}{\PHRASE[14;]}{type=compose}
\answer{}{\PHRASE[15;]}{type=compose}
\answer{}{\PHRASE[16;]}{type=compose}
\answer{}{\PHRASE[17;]}{type=compose}
\answer{}{\PHRASE[18;]}{type=compose}
\answer{}{\PHRASE[19;]}{type=compose}
\answer{}{\PHRASE[20;]}{type=compose}
\answer{}{\PHRASE[21;]}{type=compose}
\answer{}{\PHRASE[22;]}{type=compose}
\answer{}{\PHRASE[23;]}{type=compose}
\answer{}{\PHRASE[24;]}{type=compose}
\answer{}{\PHRASE[25;]}{type=compose}
\answer{}{\PHRASE[26;]}{type=compose}
\answer{}{\PHRASE[27;]}{type=compose}
\answer{}{\PHRASE[28;]}{type=compose}
\answer{}{\PHRASE[29;]}{type=compose}
     
