!distribute items 9,9 into bar_scoreexo_limit, exo_bar_quallimit
!if $wims_theme=default
  !set float=
!else
  !set float=float_right
!endif
!if $wims_read_parm!=$empty
  !set se=$wims_read_parm
!endif
!!## bar
!set require=!getscorerequire sheet=$se
!if I0 isin $(f_$se)
  !set d_=!getscore sheet=$se
!endif
!if I1 isin $(f_$se)
  !set d_=!getscorebest sheet=$se
!endif
!if I2 isin $(f_$se)
  !set d_=!getscorelevel sheet=$se
!endif
!set d_qual=!getscoremean sheet=$se
!set nb_exo=!wordcnt $d_
!set d_=!words2items $d_
!set d_qual=!words2items $d_qual
!set require=!words2items $require
<div class="wims_score_bar $float">
<ol>
!for ii=1 to $nb_exo
  !set exo_try= !word $ii of $try
  !ifval 10*$(d_[$ii])/$(require[$ii]) > $bar_scoreexo_limit
    !if $(d_qual[$ii]) > $exo_bar_quallimit
      !set exo_class=wims_exo_done wims_congratulation, $wims_name_exo_congratulation
    !else
      !set exo_class=wims_exo_done,$wims_name_exo_done
    !endif
  !else
    !if $exo_try >=1
      !set exo_class=wims_exo_undone,$wims_name_exo_undone
    !else
      !set exo_class=wims_exo_untry,$wims_name_exo_untry
    !endif
  !endif
  !let donexo=!record $ii of wimshome/log/classes/$wims_class/sheets/.sheet$se
  !distribute line $donexo into donm,donv,b,b,b,b,b,b,b,b,indiv
  !if $(indivtechval_$se)=$empty or $(indivtechval_$se) isitemof $indiv
    <li class="$(exo_class[1])">
     <a href="wims.cgi?session=$wims_session&+cmd=new&+worksheet=$se&+module=$donm&+$donv"
       title="$wims_name_Exercise $ii: $(exo_class[2])">
       $wims_name_Exercise $ii: $(exo_class[2])
     </a>
    </li>
  !endif
!next ii
</ol>
</div>
!!## bar end
