Subversion Repositories wimsdev

Rev

Rev 13711 | Blame | Compare with Previous | Last modification | View Log | RSS feed

!set ash=$activesh
!for i=1 to $eactivecnt
  tt=!item $i of $activexams
  ash=!append item E$tt to $ash
!next i
!! average is on all the sheets and exams
!reset showsheet
!for j in $ash
 !distribute item 0,0,0,100000 into cnt_$j,per_$j,max_$j,min_$j
!next j

!distribute item 0,0,0 into mean_tea,mean_auto,mean_glob
!distribute item 0,0,0 into tea_cnt,auto_cnt, glob_cnt
!distribute item 0,0,0 into max_tea,max_auto,max_glob
!distribute item 100000,100000,100000 into min_tea,min_auto,min_glob
!for i=1 to $usercnt
  uu=!record $i of wimshome/log/classes/$wims_class/.userlist
  uu=!item 3 of $uu
  !read adm/class/userscore
  mean_auto=$[$mean_auto+$per]
  !if $per>0
    max_auto=$[max($max_auto,$per)]
    min_auto=$[min($min_auto,$per)]
    !advance auto_cnt
  !endif
  !if $manual>0
    !default manual_$uu=0
    glob=$[rint($manual*$(manual_$uu)+(100-$manual)*($per))/100]
    !distribute item $[$mean_glob+$glob],$[$mean_tea+$(manual_$uu)] into mean_glob,mean_tea
    !if $(manual_$uu)>0
      !distribute item $[max($max_tea,$(manual_$uu))],\
  $[min($min_tea,$(manual_$uu))] into max_tea,min_tea
      !advance tea_cnt
    !endif
    !if $glob>0
      !distribute item $[max($max_glob,$glob)],$[min($min_glob,$glob)] into\
  max_glob,min_glob
    !endif
  !endif
  !if $per>0 or ($manual>0 and $(manual_$uu)>0)
    !advance glob_cnt
  !endif
  !for j in $ash
    !if E isin $j
      k=!char 2 to -1 of $j
      p_=$[rint(10*$scoremax*$(es_$k))/100]
    !else
      p_=!line $j of $percents
      !distribute words $p_ into p1,p2,p3,p4
      !if $p2!=$empty
        !distribute item $[$p1/100],$[$p2/10],$[$p3/100],$[$p4/100] into x0_,y_,x1_,x2_
        !set ff_$j=!mathsubst Q=$y_ in $(f_$j)
        !for sev=0 to 2
          !set ff_$j=!mathsubst I$sev=$(x$(sev)_) in $(ff_$j)
        !next
        p_=$[ceil(100*$scoremax*$(ff_$j))/100]
      !else
        p_=0
      !endif
    !endif
    per_$j=$[$(per_$j)+$p_]
    !if $p_>0
      min_$j=$[min($(min_$j),$p_)]
      max_$j=$[max($(max_$j),$p_)]
      !advance cnt_$j
    !endif
  !next j
!next i
!if $manual<1
    !distribute item $mean_auto,$max_auto,$min_auto,$auto_cnt into\
      mean_glob,max_glob,min_glob,glob_cnt
!endif

!distribute item $[rint(100*$mean_auto/max(1,$auto_cnt))/100],\
  $[rint(100*$mean_tea/max(1,$tea_cnt))/100],\
  $[rint(100*$mean_glob/max(1,$glob_cnt))/100]\
  into mean_auto,mean_tea,mean_glob

t=!translate = to , in $wims_req_time
t=!item -1 of $t
means=$t\
$min_auto $mean_auto $max_auto $min_tea $mean_tea $max_tea $min_glob $mean_glob $max_glob

!for j in $ash
  pp=$[rint(100*$(per_$j)/max(1,$(cnt_$j)))/100]
  means=!append line $j $(min_$j) $pp $(max_$j) to $means
!next j

!writefile wimshome/log/classes/$wims_class/scoreavg $means