!if $gcnt<=0
 $name_nomanual
 !set wims_ref_class=wims_button
 !href cmd=reply&method=column&cc=1 $wims_name_addmanual
!set wims_menu_items=!append line addmanual,1,cmd=reply&method=column&cc=1\
to $wims_menu_items
 !exit
!endif

$table_header
$table_hdtr<th>$wims_name_name</th><th class="small">$name_average</th>
!for g=1 to $gcnt
 <th class="small">
 !set t_=!item $g of $titles
 !if $ucnt<=$maxuser
  !href cmd=reply&method=column&cc=$g $t_
 !else
  $t_
 !endif
 </th>
!next g
</tr>
$table_hdtr
  <td class="bold">$name_weight</td>
  <td>--</td>
  !for g=1 to $gcnt
    !set w_=!item $g of $weights
    !default w_=1
    <td class="bold">$w_</td>
  !next g
 </tr>
!for u=1 to $ucnt
 !set n_=!item $u of $ulist
 !set f_=!item $u of $flist
 !set l_=!item $u of $llist
 $table_tr
  <td>
     !href cmd=reply&method=user&un=$n_ $l_, $f_
  </td>
  !set t_=!positionof item $n_ in $uulist
  !if $t_!=
    !set v_=!record $t_+1 of wimshome/log/classes/$wims_class/.grades
  !else
    !set v_=!makelist $joker for x=1 to $gcnt
    !set v_=$n_,$f_,$v_
  !endif
  !set a_=0
  !set usertotweight=0
  !for g=1 to $gcnt
    !set G$g=!item $g+2 of $v_
    !if $(G$g)!=$empty
      !set w_=!item $g of $weights
      !set a_=$[$a_+($w_)*$(G$g)]
      !set usertotweight=$usertotweight+$w_
    !endif
  !next g
  !if $joker isin $(v_[3..-1])
    !set a_=NaN
  !endif
  !if $a_!=NaN
    !set a_=$[rint(100*$a_/($usertotweight))/100]
  !endif
  <td><b>
    !if $a_!=NaN
      $a_
    !else
      $joker
    !endif
  </b></td>
  !for g=1 to $gcnt
    <td>
      !if $(G$g)!=$joker
        $(G$g)
      !endif
    </td>
  !next g
 </tr>
!next u
$table_end

<p>$name_modify
!if $gcnt<$maxcol
$wims_name_or
 !href cmd=reply&method=column&cc=$[$gcnt+1] $wims_name_addmanual
.
 !set wims_menu_items=!append line addmanual,1,cmd=reply&method=column&cc=$[$gcnt+1]\
to $wims_menu_items
!else
.
!endif
!if $gcnt>0
<p>
$name_can_also
!href cmd=reply&method=raw $wims_name_raw
 $name_can_also2 (
 !href module=adm/class/userscore&cmd=new&job=csv $wims_name_csv
).
 !set wims_menu_items=!append line raw,1,cmd=reply&method=raw\
 csv,1,module=adm/class/userscore&cmd=new&job=csv\
to $wims_menu_items
!endif

