Rev 6428 | Rev 9532 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
!advance prcnt
!if $prcnt>6 and $wims_user!=supervisor
error=too_many_print
!exit
!endif
printmax=40
!reset savedrawcnt print
printing=yes
!if $n<1
!exit
!endif
wims_backslash_insmath=yes
wims_multiexec=pari maxima yacas octave gap
M=0
m_step=1
!if $wims_developer!= or $wims_supervisor!=
latex_exists=0
!readproc oef/latex.proc begin
!else
latex_exists=-1
!endif
!set i=1
!for j=1 to $n
l=!record $j of $data
!distribute lines $l into m_,p_,r_,w_,title_$j,d_
!!! hack for multi-language: the file var.proc of the module is not read -
!!! this means that all other options in this var.proc are not taken in account
!reset oefenv_lang
test_lang=!module translation_language $m_
!if $lang iswordof $test_lang
oefenv_lang=$lang
!endif
!!!
module_$j=$m_
!read imagedir.proc
test=!module category $m_
test2=!filelist $(Class_header)src/*.oef
!if (../classes/ isin ../$m_ or oef isin $test ) and $test2!=$empty
p_=!translate internal +&= to $ \
$ $ in $p_
t_=!linecnt $p_
e=
qnum=
!for k=1 to $t_
l_=!line $k of $p_
!distribute words $l_ into n_,v_
!if $n_=exo
e=!append item $v_ to $e
!endif
!if $n_=qnum
qnum=$v_
!endif
!next k
!default qnum=1
!if $e=$empty
!reset exolist
wims_prefix=
!read $(class_header)Exindex
wims_prefix=$wims_prefix2
e=$exolist
!endif
!if $e!=$empty
e__=!shuffle $e
!endif
!default e__=$e
e_cnt=!itemcnt $e__
!for l=1 to $qnum
module_$i=$(module_$j)
title_$i=$(title_$j)
question_$i=
e_$i=$(e__[$[$l%$e_cnt + 1]])
!reset question testcondition format
thisexo=$(e_$i)
!readproc imagedir.proc
varcnt=!defof varcnt in $(class_header)def/$(e_$i).def
!default varcnt=0
!for v=2 to $varcnt+5
val$v=
!next v
status=prep
wims_prefix=
!! hack for declaring not printable exercise if the commande !getdef (equivalent defof) is used
!! should be better to allow this command as in the printable version outside a class
testgetdef=!sh grep !getdef $(Class_header)def/$(e_$i).def
!if $testgetdef !=
question=
!else
!read $(class_header)def/$(e_$i).def
!endif
wims_prefix=$wims_prefix2
!if $format=html
question_$i=$question
!if __EXECUTED_ isin $question
varcnt_$i=$varcnt
var_$i=$val1
!for v=2 to $varcnt+5
v_=!translate internal $\
$ to $ $ in $(val$v)
var_$i=$(var_$i)\
$v_
!next v
!endif
!ifval $replycnt=0 and $choicecnt=1
rep=!item 1 to 6 of $choicebad1
rep=!append item $choicegood1 to $rep
rep=!listuniq $rep
rep=!sort items $rep
rep=!replace , by </li><li> in <ul style="list-style-type:square;"><li>$rep</li></ul>
chce_$i=$rep
!else
chce_$i=
!endif
rep=
!for k=1 to $choicecnt
!if $(choicename$k)!=
rep=!append line <em>$(choicename$k)</em> : $(choicegood$k) to $rep
!else
rep=!append line $(choicegood$k) to $rep
!endif
!next k
!if $conditioncnt<1
!for k=1 to $replycnt
rg_=$(replygood$k)
!if $(replytype$k) iswordof checkbox click menu radio
rg_=!translate internal ; to $\
$ in $rg_
rg1_=!line 1 of $rg_
rg2_=!line 2 to -1 of $rg_
rg2_=!translate internal $\
$ to ; in $rg2_
rg_=!item $rg1_ of $rg2_
!endif
!if $(replytype$k) iswordof atext wlist nocase case
rg_=!translate internal ;| to $\
\
$ in $rg_
rg_=!line 1 of $rg_
!endif
!if $(replytype$k) iswordof function default equation
rg_=!item 1 of $rg_
!endif
!if $(replytype$k) iswordof imgcomp textcomp compose reorder \
dragfill clickfill
rg_=!translate internal | to $\
$ in $rg_
rg_=!rows2lines $rg_
rg_=!line 1 of $rg_
!if $(replytype$k)=imgcomp
rg_=!item 2 to -1 of $rg_
rg_=!nospace $rg_
rg_=!replace , by " /><img src="$imagedir/ in <img src="$imagedir/$rg_ " />
!else
rg_=!translate , to $ $ in $rg_
!endif
!endif
!if $(replyname$k)$rg_ !=
!if http isin $(replyname$k)$rg_
rep=!append line $name_noprint to $rep
!else
!if $(replyname$k)!=
rep=!append line <em>$(replyname$k)</em> : <span class="tt">$rg_</span> to $rep
!else
rep=!append line <span class="tt">$rg_</span> to $rep
!endif
!endif
!endif
!next k
!endif
rep=!imgrename $rep
ans_$i=!trim $rep
!if $latex_exists>=0
!readproc oef/latex.proc exo
!endif
!if $latex_exists>=1
!readproc oef/latex.proc end
!endif
!endif
!next l
!endif
!set i=$[$i+1]
!next j
!set N=$[$i-1]