option:text

!if $lang=fr
  !set name_searchmore=... cherchez un peu plus
!else
  !set name_searchmore=... you should search a little more
!endif

!if $wims_read_parm=nocompare
  !exit
!endif

reply=$(reply$i)
replyurl=$(reply[2;])
reply$i=$(reply[1;])
repclic=$(reply[3;])

!set answer=!lines2rows $(replygood$i)
!set answer=!lines2rows $answer
!set N=!line 3 of $(oef_answer_option$i)
!distribute items $N into ny,nx,width,height
!set nb_im=$[$nx*$ny]
!set test=!line 1 of $(oef_answer_option$i)
!set rep=$(reply$i)
!set good_url=!line 2 of $(oef_answer_option$i)

!set test=!nospace $test
!set rep=!nospace $rep

!set diff=
!for a = 1 to $nb_im
  !if $(test[$a])=$(rep[$a])
    !set diff=!append item 1 to $diff
  !else
    !set diff=!append item 0 to $diff
  !endif
!next
!if $test issametext $rep
  score=1
!else
  score=0
!endif
!set r_out=<table class="wimscenter" style="border-collapse:collapse;border-spacing:0;text-align:center;background-color:lightblue;">
!set g_out=<table class="wimscenter" style="border-collapse:collapse;border-spacing:0;text-align:center;background-color:lightgreen;">
!for y=1 to $ny
  r_out=$r_out <tr style="margin:0;padding:0;line-height:0;">
  g_out=$g_out <tr style="margin:0;padding:0;line-height:0;">
  !for x=1 to $nx
    !set t_=!item $[$x+($y-1)*($nx)] of $replyurl
    !set r_out=$r_out\
    <td style="border:solid 1px;width:$(width)px;height:$(height)px"><div>$t_</div></td>
    !set t=!item $[$x+($y-1)*($nx)] of $good_url
    !set g_out=$g_out\
    <td style="border:solid 1px;width:$(width)px;height:$(height)px"><div>$t</div></td>
  !next x
  r_out=$r_out </tr>
  g_out=$g_out </tr>
!next y
r_out=$r_out </table>
g_out=$g_out </table>
m_reply$i=$diff

reply_$i=$r_out
!if $repclic > 2
  replyGood$i=$g_out
!else
  replyGood$i=&nbsp; $name_searchmore
!endif
reply__$i=&nbsp;
!if $score=1
  diareply$i=good
  !advance freegot
!else
  diareply$i=bad
!endif
