reply=$(reply$i)
replygood=$(replygood$i)

script=!line 1 to -2 of $(oef_answer_option$i)
script=!item 2 to -1 of $script
script1=$script
liste_variable=!line -1 of $(oef_answer_option$i)
cnt_variable=!itemcnt $liste_variable
!for j = 1 to $cnt_variable
  !if $(reply[$j;2])=$empty
    !set script=!replace internal $(liste_variable[$j]) by $(reply[$j;]) in $script
  !else
     !set script=!replace internal $(liste_variable[$j]) by [$(reply[$j;])] in $script
  !endif
  !if \ notin $(replygood[$j;])
    !set script1=!replace internal $(liste_variable[$j]) by [$(replygood[$j;])] in $script1
  !endif
!next
!set jbox=!item 2 of $(oef_answer_option$i)
!set your_brd=!item 1 of $(oef_answer_option$i)

script1=!replace internal $jbox by new$jbox in $script1
!if free isin $reply
  free_var=$(reply[-1;])
  free_var=!getopt free in $free_var
  free_var_cnt=!itemcnt $free_var
  !for j = 1 to $[$free_var_cnt/2]
    script=!append line $(your_brd).create('point',[$(free_var[2*$j-1]) , $(free_var[2*$j])],{size: 1,showInfobox: false,name:''}) ; to $script
  !next
!endif
precision=!getopt precision in $(replyoption$i)
!default precision=10

!readproc slib/geo2D/jsxgraph $script; $(your_brd).suspendUpdate() ;

reply_$i=$slib_out
!! bonne reponse
!!!readproc slib/geo2D/jsxgraph $script1; $(your_brd).suspendUpdate() ;
!!reply_$i=$(reply_$i) $slib_out

!! if empty, take the value of reply_$i
!! enlever le ; de la fin
reply$i=!nonempty lines $(reply$i)
reply$i=!nonempty rows $(reply$i)
reply$i=!replace internal free= by in $(reply$i)
m_reply$i=$(reply$i)
reply__$i=&nbsp;

!if $wims_read_parm=nocompare
  !exit
!endif

!! on analyse numeriquement la reponse


!reset cnt_rep sc
!set replygood=!lines2rows $(replygood$i)

!for j= 1 to $cnt_variable
  !if \ notin $(replygood[$j;]) and $(replygood[$j;]) != $empty
   !increase cnt_rep
   !set c=!itemcnt $(replygood[$j;])
   !for u=1 to $c
     good_=$(replygood[$j;$u])
     !ifval abs($good_ - $(reply$i[$j;$u])) < 1/$precision
       sc=$sc 1/$c
     !else
       sc=$sc 0
     !endif
     !if $u < $c
      sc=$sc,
     !endif
   !next
  !endif
  sc=$sc;
!next
sc=!nonempty rows $sc
sc=!nonempty items $sc

score=!replace internal ; by , in $sc
score=!replace internal , by + in $score

score=$[($score)/$cnt_rep]
freegot=$[$freegot+$score]

!if $score=1
 diareply$i=good
!else
 !if $score > 0.3
   partialgood$i=yes
   diareply$i=good
 !else
   diareply$i=bad
 !endif
!endif
