Rev 15236 | Blame | Compare with Previous | Last modification | View Log | RSS feed
\text{option=\option noanalyzeprint}
\text{cnt_file=items(\file)}
\text{texte=}
\for{i = 2 to \cnt_file}{
\integer{cnt= wims(recordcnt \file[\i])}
\text{ v= shuffle(\cnt)}
\matrix{battage=\battage
\v[1..\N]}
}
\for{i = 1 to \N}{
\if{\alea=no}{\text{image_test=wims(record \i of \file0)}}{
\text{image_test=wims(record \battage[\i] of \file0)}}
\text{preliminaire_test=wims(\image_test)}
\text{preliminaire_test=row(1,\preliminaire_test)}
\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)}
\integer{test_inst=\inst_audio\inst_image\inst_title\inst_intro notsametext ? 1 : 0}
\text{rab_inst=}
\text{rab_inst=\inst_title notsametext ?\rab_inst<div class="wimscenter">\inst_title</div>}
\text{rab_inst=\inst_intro notsametext ?\rab_inst \inst_intro}
\text{rab_inst=\inst_image notsametext ? \rab_inst <div class="wimscenter"><img src="\imagedir/\inst_image" alt=""></div>}
\if{\inst_audio notsametext }{
\text{rab_inst1= . isin \inst_audio or \packs= ?
slib(media/audio \imagedir/\inst_audio,\player_option,player=\player):slib(lang/swac \inst_audio,\packs,player=\player,\player_option)}
\text{rab_inst=\rab_inst <div class="wimscenter">\rab_inst1[1;1]</div>}
}
\if{\test_inst=1}{
\text{texte= \texte \rab_inst}
\text{image_test=wims(line 2 to -1 of \image_test)}
}
\text{texte=\texte <div> \image_test </div>}
\text{texte=\texte <br class="spacer">}
}
\text{texte=wims(embraced randitem \texte)}
\text{texte = slib(text/cutchoice2 \texte)}
\text{texte = wims(replace internal || by | in \texte)}
\text{cntrow=rows(\texte)}
\integer{cntQ=(\cntrow-\cntrow%2)/2}
\matrix{trou=}
\matrix{trouV=}
\text{listeCNT=}
\matrix{rep=}
\matrix{specialhelp1=}
\matrix{specialhelp2=}
\matrix{specialhelp3=}
\matrix{specialhelp4=}
\for{i = 1 to \cntQ}{
\text{trou0=\texte[2*\i;]}
\text{trou0=wims(replace internal // by ; in \trou0)}
\text{sp_help= wims(embraced randitem wims(getopt help in \trou0[2;]))}
\text{trou0=\trou0[1;]}
\integer{cnt = items(\trou0)}
\matrix{trou=\trou
\trou0[1]}
\text{trou1=\trou0[1]}
%%%%%%%%%% ce qui suit sert pour l'aide
\text{trouitem=wims(replace internal | by , in \trou1)}
\text{trouitem_audio=\trouitem[1]}
\text{trouitem=wims(words2items \trouitem[1])} on aide avec la première possibilité
\text{cnt_word=items(\trouitem)}
\text{spec1=}
\text{spec2=}
\text{spec3=}
\if{1 isitemof \specialhelp or 2 isitemof \specialhelp}{
\for{w = 1 to \cnt_word}{
\text{mot=\trouitem[\w]}
\text{specnt=wims(charcnt \mot)}
\text{spe=wims(makelist - for x = 1 to \specnt)}
\text{spe1=wims(nospace wims(items2words \spe))}
\integer{cnt_rand=min(\specnt/2,3)}
\text{rand=shuffle(\specnt)}
\text{spe2=\spe}
\for{ra =1 to \cnt_rand}{
\integer{v=\rand[\ra]}
\text{spe2=wims(replace item number \v by wims(char \v of \mot) in \spe2)}
}
\text{spe2=wims(nospace wims(items2words \spe2))}
\text{spec1=\spec1 \spe1}
\text{spec2=\spec2 \spe2}
}
}
\if{3 isitemof \specialhelp}{
\text{spe3=slib(lang/swac \trouitem_audio,\packs,player=\player)}
\text{spec3=\spec3 \spe3[1;1]}}
\matrix{specialhelp1=\specialhelp1,\spec1}
\matrix{specialhelp2=\specialhelp2,\spec2}
\matrix{specialhelp3=\specialhelp3,\spec3}
\if{4 isitemof \specialhelp}{
\text{sp_help=\sp_help= ? no help}
\text{sp_help=wims(replace internal , by , in \sp_help)}
\text{specialhelp4=wims(append item \sp_help to \specialhelp4)}
}
%%%%%%%%% fin pour l'aide
\text{trou0= wims(listuniq wims(singlespace \trou0,\choix))}
\if{\format notwordof mark menu}{
\matrix{trouV=\trouV
\trou0}
\matrix{rep =\rep
\trou1}
}
{\text{trou2=wims(replace internal | by , in \trou1)}
\text{trou3=\format iswordof menu ? \trou2[1],\trou0[2..-1] : wims(listuniq wims(replace internal | by , in \trou0))}
\integer{cnt=items(\trou3)}
\matrix{trouV=\trouV
\trou3}
\text{t=}
\integer{tc=items(\trou2)}
\for{v=1 to \tc}{\text{t=\t, position(\trou2[\v],\trou3)}}
\matrix{rep =\rep
wims(nonempty items \t)}
}
\text{listeCNT = \listeCNT,\cnt}
}
\if{\format iswordof menu mark }{
\text{choix = \common issametext yes ? \choix,wims(lines2items wims(rows2lines \trouV))}
\text{choix=wims(listuniq \choix)}
\text{listeCNT =}
\matrix{trouV1=}
\matrix{rep1=} il faut aussi refaire la matrice de réponse
\for{ f = 1 to \cntQ}{
\text{tmp=wims(listuniq \trouV[\f;],\choix)}
\text{tmp=shuffle(\tmp)}
\matrix{trouV1 = \trouV1
\tmp}
\text{t=}
\integer{tc=items(\trouV[\f;])}
\for{h=1 to \tc}{\text{t=\t,position(\trouV[\f;\rep[\f;\h]],\tmp)}}
\matrix{rep1 =\rep1
wims(nonempty items \t)}
\text{cnt = items(\trouV1[\f;])}
\text{listeCNT = \listeCNT,\cnt}
}
\matrix{trouV = \trouV1}
\matrix{rep=\rep1}
}
\text{listeCNT=wims(nonempty items \listeCNT)}
\text{specialhelp1=wims(nonempty items \specialhelp1) }
\text{specialhelp2=wims(nonempty items \specialhelp2) }
\text{specialhelp3=wims(nonempty items \specialhelp3) }
\text{specialhelp4=wims(nonempty items \specialhelp4) }
\matrix{Specialhelp=\specialhelp1
\specialhelp2
\specialhelp3
\specialhelp4}
\matrix{rep=\format iswordof clickfill dragfill raw case nocase ? \trou}
\matrix{rep=\format iswordof case nocase raw? wims(replace internal , by , in \rep)}
\if{\format=menu}{
\text{trouV=slib(oef/blank _, ,\trouV)}
\text{rep=slib(oef/blank _, ,\rep)}
}
\text{choix=\choix notsametext ? wims(append item wims(replace internal ; by , in \trou) to \choix)}
\text{choix= wims(replace internal | by , in \choix)}
\text{choix=wims(listuniq \choix)}
\integer{cntQ=rows(\rep)}
\text{STEP=wims(makelist r x for x=1 to \cntQ)}
\text{nstep=\STEP}
\nextstep{\nstep}
\text{screply=}
\text{repl=}
\matrix{rep1=wims(replace internal | by , in \rep)}
\text{trouV=\format iswordof case nocase raw? }
\text{symb=\format iswordof case nocase raw ? :;}
\statement{\nopaste <div class="instruction">\instruction</div>
\if{\reading notsametext }{\special{help reading,READING}}
\if{\image notsametext }{\special{help image,IMAGES}}
\audio\video
<div class="question">
\if{\format iswordof case nocase raw dragfill clickfill}{
\for{k = 1 to \cntQ}{
\texte[2*\k-1;] \if{r \k isitemof \nstep}{
\embed{\STEP[\k],\size
\autocompletion}
\if{\specialhelp[\step] iswordof 5}{
\special{tooltip [\helpprompt],,\rep1[\k;1]}
}
\if{\specialhelp[\step] iswordof 1 2 4}{
\special{tooltip [\helpprompt],,\Specialhelp[\specialhelp[\step];\k]}}
\if{\specialhelp[\step]=3}{\Specialhelp[3;\k]}
}{
\if{\screply[\k]=1}{
\if{\answer_given=yes}{<span class="oef_indgood">\repl[\k;]</span>}
{<span class="oef_indneutral">\repl[\k;]</span>}
}{
\if{\presentgood=1}{<span class="oef_indgood">\rep1[\k;1]</span>}
\if{\answer_given=yes}{<span class="oef_indbad"><del>\repl[\k;]</del></span>}
{<span class="oef_indneutral">\repl[\k;]</span>}
}
}
}
\texte[2*\cntQ+1;]
}
\if{\format iswordof menu}{
\for{k = 1 to \cntQ}{
\texte[2*\k-1;]
\if{r \k isitemof \nstep}{\embed{\STEP[\k]}}{
\if{\screply[\k]=1}{
\if{\answer_given=yes}{<span class="oef_indgood">\repl[\k;]</span>}
{<span class="oef_indneutral">\repl[\k;]</span>}
}{
\if{\presentgood=1}{<span class="oef_indgood">\trouV[\k;\rep[\k;1]]</span>}
\if{\answer_given=yes}{<span class="oef_indbad"><del>\repl[\k;]</del></span>}
{<span class="oef_indneutral">\repl[\k;]</span>}
}
}
}
\texte[2*\cntQ+1;]
}
\if{\format iswordof mark}{
\for{k = 1 to \cntQ}{
\texte[2*\k-1;]
\if{r \k isitemof \nstep}{/
\for{K = 1 to \listeCNT[\k]}{ \embed{\STEP[\k],\K}/}
}{
\if{\screply[\k]=1}{
\if{\answer_given=yes}{<span class="oef_indgood">\repl[\k;]</span>}
{<span class="oef_indneutral">\repl[\k;]</span>}
}{
\if{\presentgood=1}{<span class="oef_indgood">\trouV[\k;\rep[\k;1]]</span>}
\if{\answer_given=yes}{<span class="oef_indbad"><del>\repl[\k;]</del></span>}
{<span class="oef_indneutral">\repl[\k;]</span>}
}
}
}
\texte[2*\cntQ+1;]
}
</div>
\if{\choix notsametext and \format iswordof case nocase}{<div class="reponse">\choix</div>}
}
\answer{}{\rep[1;]\symb\trouV[1;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[2;]\symb\trouV[2;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[3;]\symb\trouV[3;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[4;]\symb\trouV[4;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[5;]\symb\trouV[5;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[6;]\symb\trouV[6;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[7;]\symb\trouV[7;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[8;]\symb\trouV[8;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[9;]\symb\trouV[9;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[10;]\symb\trouV[10;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[11;]\symb\trouV[11;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[12;]\symb\trouV[12;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[13;]\symb\trouV[13;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[14;]\symb\trouV[14;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[15;]\symb\trouV[15;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[16;]\symb\trouV[16;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[17;]\symb\trouV[17;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[18;]\symb\trouV[18;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[19;]\symb\trouV[19;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[20;]\symb\trouV[20;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[21;]\symb\trouV[21;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[22;]\symb\trouV[22;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[23;]\symb\trouV[23;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[24;]\symb\trouV[24;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[25;]\symb\trouV[25;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[26;]\symb\trouV[26;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[27;]\symb\trouV[27;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[28;]\symb\trouV[28;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[29;]\symb\trouV[29;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[30;]\symb\trouV[30;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[31;]\symb\trouV[31;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[32;]\symb\trouV[32;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[33;]\symb\trouV[33;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[34;]\symb\trouV[34;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[35;]\symb\trouV[35;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[36;]\symb\trouV[36;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[37;]\symb\trouV[37;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[38;]\symb\trouV[38;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[39;]\symb\trouV[39;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\answer{}{\rep[40;]\symb\trouV[40;]}{type=\format}{option=shuffle \option_reaccent nonstop}
\text{presentgood=slib(oef/env presentgood)}
\text{answer_given=\presentgood>0? yes}
\text{screply=\sc_reply1,\sc_reply2,\sc_reply3,\sc_reply4,\sc_reply5,\sc_reply6,\sc_reply7,\sc_reply8,\sc_reply9,
\sc_reply10,\sc_reply11,\sc_reply12,\sc_reply13,\sc_reply14,\sc_reply15,\sc_reply16,\sc_reply17,\sc_reply18,\sc_reply19,
\sc_reply20,\sc_reply21,\sc_reply22,\sc_reply23,\sc_reply24,\sc_reply25,\sc_reply26,\sc_reply27,\sc_reply28,\sc_reply29,
\sc_reply30,\sc_reply31,\sc_reply32,\sc_reply33,\sc_reply34,\sc_reply35,\sc_reply36,\sc_reply37,\sc_reply38,\sc_reply39,
\sc_reply40}
\matrix{repl=\reply1
\reply2
\reply3
\reply4
\reply5
\reply6
\reply7
\reply8
\reply9
\reply10
\reply11
\reply12
\reply13
\reply14
\reply15
\reply16
\reply17
\reply18
\reply19
\reply20
\reply21
\reply22
\reply23
\reply24
\reply25
\reply26
\reply27
\reply28
\reply29
\reply30
\reply31
\reply32
\reply33
\reply34
\reply35
\reply36
\reply37
\reply38
\reply39
\reply40
}
\text{nstep=}
\if{\step<=\try}{
\for{i=1 to \cntQ}{\text{nstep= \screply[\i]!=1 ? wims(append item r \i to \nstep)}}
}
\integer{step1=\step-1}
\feedback{1=1}{\if{\try > 1}{Vous avez eu besoin de \step1
\if{\step1=1}{essai.}{essais.}}
}