Back to index

wims  3.65+svn20090927
fill.inc
Go to the documentation of this file.
00001 !default wims_fill_option=$(replyoption$i)
00002 !set inputsize=!translate x to , in $inputsize
00003 !set inputsize=!items2words $inputsize
00004 !distribute words $inputsize into sizeh,sizev,sizei,sizej
00005 !default sizej=1
00006 !bound sizev between integer 5 and 500 default 20
00007 !bound sizeh between integer 5 and 1000 default 80
00008 !bound sizei between integer 1 and 100 default $
00009 !default fill_sx=$sizeh
00010 !default fill_sy=$sizev
00011 !set input_rg=!rows2lines $(replygood$i)
00012 !set input_1=!word 1 of $input_rg
00013 !if $input_1=?analyze
00014  !set input_rg=!line 2 to -1 of $input_rg
00015 !endif
00016 !set input_rg=!translate internal | to $\
00017 $ in $input_rg
00018 !set input_1=!line 1 of $input_rg
00019 !set n=!itemcnt $input_1
00020 !default sizei=$n
00021 !if $fillstarts=$empty
00022  !set filltotal=$sizei
00023  !set fillstarts=0
00024  !reset fillvert fillcutpoints
00025 !else
00026  !set filltotal=$[$filltotal+$sizei]
00027 !endif
00028 !set fillstarts=$fillstarts,$filltotal
00029 !set fillvert=!append item $sizej to $fillvert
00030 !set fillcutpoints=!append item $[ceil($sizei/$sizej)] to $fillcutpoints
00031 !set input_rg=!nonempty lines $input_rg
00032 !if $(replytype$i)=dragfill
00033  !set g_=!line 1 of $input_rg
00034  !set n=!linecnt $input_rg
00035  !for t_=2 to $n
00036   !set l_=!line $t_ of $input_rg
00037   !set l_=!listcomplement $g_ in $l_
00038   !if $l_!=$empty
00039    !set g_=$g_,$l_
00040   !endif
00041  !next t_
00042  !!set input_rg=!listuniq $g_
00043  !set input_rg=$g_
00044 !else
00045  !if keeporder notwordof $wims_fill_option
00046    !set input_rg=!lines2items $input_rg 
00047  !else
00048  !!on vérifie que la bonne réponse est bien dans la liste, si non on la rajoute
00049    !set input_rg2=!lines2items $input_rg
00050    !set input_rg=!line 2 to -1  of $input_rg 
00051    !set l_=!listcomplement $input_rg in $input_rg2
00052    !if $l_!=$empty
00053      !set input_rg=$l_,$input_rg
00054    !endif
00055  !endif
00056 !endif
00057 !set wims_fill_list=!append item $input_rg to $wims_fill_list
00058 !set dynapi_fill_fields=!append item $i to $dynapi_fill_fields
00059 
00060 !if $wims_read_parm=noshow
00061  !exit
00062 !endif
00063 
00064 !default fillcnt=0
00065 !increase fillcnt
00066 !if $wims_read_parm!=noprompt
00067  <tr><td align=right>$(replyname$i)<td>
00068 !endif
00069 
00070 !set sup1=&nbsp;<sup>
00071 !if $sizev>=20
00072  !set sup1=<sup>$sup1
00073  !if $sizev>=30
00074   !set sup1=<sup>$sup1
00075   !if $sizev>=40
00076    !set sup1=<sup>$sup1
00077    !if $sizev>=50
00078     !set sup1=<sup>$sup1
00079    !endif
00080   !endif
00081  !endif
00082 !endif
00083 !set sup2=!replace <sup> by </sup> in $sup1
00084 !set sup2=!replace &nbsp; by $ in $sup2
00085 !set fill_namelist=!append item $fillcnt to $fill_namelist
00086 $sup1<img width=1 height=$[$fill_sy+4] src="gifs/transparent.gif" alt="transparent"
00087 border=0 vspace=0 hspace=0 align=top><a name=fill$fillcnt id=fill$fillcnt><img
00088 width=$[ceil($sizei/$sizej)*$fill_sx] height=$[($fill_sy*$sizej)+4] src="gifs/transparent.gif" alt="transparent"
00089 border=0 vspace=0 hspace=0 align=top></a>$sup2
00090 <input type=hidden name=reply$i value="">
00091 !reset inputsize