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

###################
\title{Sentence stress : practice}
\author{Csilla Ducrocq}
\email{csilla.ducrocq@u-psud.fr}
\language{fr}
\computeanswer{no}
\format{html}
\text{file=sentence_stress_practice}
\text{notepad=slib(utilities/notepad Notepad,small)}
\text{instruction=asis(Click on the words that should be stressed in the dialogue.)}
\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=30}
\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: #FFFFCC;	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=no}
\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)}
     \integer{coupure=17}

\matrix{question=}
\matrix{explication=}
\text{juste=}
\matrix{numero=}
\matrix{analyse=}
\text{cnt=}
\text{texte=wims(record \battage[1] of \file0)}
 \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:}
 \text{texte=\test_inst=1 ? wims(line 2 to -1 of \texte)}
\if{\N >=2}{
  \for{i= 2 to \N}{
  \text{texte1= wims(record \battage[\i] of \file0)}
  \text{preliminaire_test=row(1,\texte1)}
  \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{texte1=\test_inst=1 ? wims(line 2 to -1 of \texte1)}
  \text{texte = \texte <p> \texte1</p>}
 }
}
\text{texte=wims(embraced randitem \texte)}
\text{texte=wims(replace internal ??| by ??&nbsp;| in \texte)}
\text{texte=wims(replace internal ?? | by ??&nbsp;| in \texte)}
\matrix{texte=slib(text/markgroup \texte)}
\matrix{numero=\texte[1..-4;]}
\text{traduction=\texte[-2;]}
\text{traduction=wims(replace internal || by | in \traduction)}
\text{cnt_mot = rows(\numero)}
\text{Numero = wims(rows2lines \numero)}
\text{Numero = wims(lines2items \Numero)}
\text{prem_numero=wims(column 1 of \numero)}
\text{texte = \texte[-3;]}
\text{cnt = items(\texte)}
\text{Texte=wims(items2words \texte)}

    
\text{rep_compose = }
\for{ i = 1 to \cnt_mot}{
 \text{nom_compose= \texte[\numero[\i;]]}
 \text{nom_compose =wims(items2words \nom_compose)}
\text{rep_compose = \rep_compose,\nom_compose}
}
\text{rep_compose= wims(nonempty items \rep_compose)}

\text{STEP = wims(makelist r x for x = 2 to \cnt_mot+1)}
\text{position=}
\integer{a=0}
\for{t = 1 to \cnt}{
  \if{\t isitemof \prem_numero}{
    \integer{a =\a+1}
    \text{position=\position,\a}
  }{
    \text{position=\position,0}
  }
 }
\text{position=wims(nonempty items \position)}

\text{STEP1=\first_step=1?r1}
\text{STEP1=\second_step issametext yes ? \STEP1
\STEP
}

\steps{\STEP1}


\integer{reste=\cnt%\coupure}
\integer{quo=(\cnt-\reste)/\coupure}
\integer{quo=\reste=0? \quo-1}
\text{nombre=wims(makelist x for x = 1 to \cnt)}
%%%%%%%%%%%

\statement{\nopaste\style <p>\instruction</p>
\preliminaire
  \if{\reading notsametext }{\special{help reading,[à lire]}}
  \if{\image notsametext }{\special{help image,[à regarder]}}
  \audio\video
  \if{\step=\first_step}{
    <div class="question">
    \for{h=1 to \cnt}{
      \embed{reply 1,\h} 
    }
    </div>
   }
 \if{\step >=1+\first_step}{
   \if{\pos_rep=outside}{
     <div class="reponse">
     \for{s = 1 to \cnt}{
      \if{\s notitemof \Numero}{\texte[\s]}{
      \if{\s isitemof \Numero}{
      <font size=+1 color=blue>\texte[\s]</font>}
      }
    }
    </div>
     <p>\instruction2</p>
    <div class="question">
   \for{s= 1 to \cnt_mot}{
         <br> \rep_compose[\s] : \embed{reply \STEP[\s],\size
         \autocompletion}  
   }
   </div>
 }
 \if{\pos_rep=inside}{
    <p>\instruction2</p>
    <div class="question">
    \for{s = 1 to \cnt}{
      \if{\s notitemof \Numero}{\texte[\s]}{
      \if{\s isitemof \prem_numero}{
      \embed{\STEP[\position[\s]], \size
      \autocompletion}
      }
      <font size=-1 color=red>\texte[\s]</font>}
    }
   </div>
  }
  \if{\pos_rep=under}{
    <div class="question">
    \for{u = 0 to \quo}{<table border=0>
    <tr>
    \for{ v = 1 to \coupure}{<td align="center">
      \if{\nombre[\coupure*\u+\v] isitemof \prem_numero 
         or \nombre[\coupure*\u+\v] notitemof \Numero}{}
       \if{\coupure*\u+\v <= \cnt}{ 
         \if{\nombre[\coupure*\u+\v] isitemof \Numero}{<font color=blue>}
           \texte[\coupure*\u+\v]}{&nbsp;}
          \if{\nombre[\coupure*\u+\v] isitemof \Numero}{</font>}
       </td>
      }
     </tr><tr>
     \for{ v = 1 to \coupure}{
      \if{\nombre[\coupure*\u+\v] isitemof \prem_numero 
         or \nombre[\coupure*\u+\v] notitemof \Numero}{}
        <td align="center">
      \if{\nombre[\coupure*\u+\v] isitemof \prem_numero}{ 
         \embed{\STEP[\position[\nombre[\coupure*\u+\v]]], \size
         \autocompletion}
      }{&nbsp;}
      </td>
     }
    </tr><tr><td colspan=\coupure><hr></td></tr>
       </table> }

   </div>
  }
 }
}

\answer{}{\Numero;\texte}{type=mark}{option=\partialscore}
\answer{\rep_compose[1]}{\traduction[1];\choix}{type=\format}
\answer{\rep_compose[2]}{\traduction[2]}{type=\format}{option=\option_reaccent}
\answer{\rep_compose[3]}{\traduction[3]}{type=\format}{option=\option_reaccent}
\answer{\rep_compose[4]}{\traduction[4]}{type=\format}{option=\option_reaccent}
\answer{\rep_compose[5]}{\traduction[5]}{type=\format}{option=\option_reaccent}
\answer{\rep_compose[6]}{\traduction[6]}{type=\format}{option=\option_reaccent}
\answer{\rep_compose[7]}{\traduction[7]}{type=\format}{option=\option_reaccent}
\answer{\rep_compose[8]}{\traduction[8]}{type=\format}{option=\option_reaccent}
\answer{\rep_compose[9]}{\traduction[9]}{type=\format}{option=\option_reaccent}
\answer{\rep_compose[10]}{\traduction[10]}{type=\format}{option=\option_reaccent}
\answer{\rep_compose[11]}{\traduction[11]}{type=\format}{option=\option_reaccent}
\answer{\rep_compose[12]}{\traduction[12]}{type=\format}{option=\option_reaccent}
\answer{\rep_compose[13]}{\traduction[13]}{type=\format}{option=\option_reaccent}
\answer{\rep_compose[14]}{\traduction[14]}{type=\format}{option=\option_reaccent}
\answer{\rep_compose[15]}{\traduction[15]}{type=\format}{option=\option_reaccent}
\answer{\rep_compose[16]}{\traduction[16]}{type=\format}{option=\option_reaccent}
\answer{\rep_compose[17]}{\traduction[17]}{type=\format}{option=\option_reaccent}
\answer{\rep_compose[18]}{\traduction[18]}{type=\format}{option=\option_reaccent}
\answer{\rep_compose[19]}{\traduction[19]}{type=\format}{option=\option_reaccent}
\answer{\rep_compose[20]}{\traduction[20]}{type=\format}{option=\option_reaccent}
     
