Rev 13711 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
23 | reyssat | 1 | !set ash=$activesh |
2 | !for i=1 to $eactivecnt |
||
3 | tt=!item $i of $activexams |
||
4 | ash=!append item E$tt to $ash |
||
5 | !next i |
||
13711 | bpr | 6 | !! average is on all the sheets and exams |
7 | !reset showsheet |
||
23 | reyssat | 8 | !for j in $ash |
9 | !distribute item 0,0,0,100000 into cnt_$j,per_$j,max_$j,min_$j |
||
10 | !next j |
||
11 | |||
12 | !distribute item 0,0,0 into mean_tea,mean_auto,mean_glob |
||
13 | !distribute item 0,0,0 into tea_cnt,auto_cnt, glob_cnt |
||
14 | !distribute item 0,0,0 into max_tea,max_auto,max_glob |
||
15 | !distribute item 100000,100000,100000 into min_tea,min_auto,min_glob |
||
16 | !for i=1 to $usercnt |
||
12465 | bpr | 17 | uu=!record $i of wimshome/log/classes/$wims_class/.userlist |
18 | uu=!item 3 of $uu |
||
19 | !read adm/class/userscore |
||
20 | mean_auto=$[$mean_auto+$per] |
||
21 | !if $per>0 |
||
22 | max_auto=$[max($max_auto,$per)] |
||
23 | min_auto=$[min($min_auto,$per)] |
||
24 | !advance auto_cnt |
||
23 | reyssat | 25 | !endif |
12465 | bpr | 26 | !if $manual>0 |
27 | !default manual_$uu=0 |
||
28 | glob=$[rint($manual*$(manual_$uu)+(100-$manual)*($per))/100] |
||
29 | !distribute item $[$mean_glob+$glob],$[$mean_tea+$(manual_$uu)] into mean_glob,mean_tea |
||
30 | !if $(manual_$uu)>0 |
||
31 | !distribute item $[max($max_tea,$(manual_$uu))],\ |
||
32 | $[min($min_tea,$(manual_$uu))] into max_tea,min_tea |
||
33 | !advance tea_cnt |
||
34 | !endif |
||
35 | !if $glob>0 |
||
36 | !distribute item $[max($max_glob,$glob)],$[min($min_glob,$glob)] into\ |
||
37 | max_glob,min_glob |
||
38 | !endif |
||
23 | reyssat | 39 | !endif |
12465 | bpr | 40 | !if $per>0 or ($manual>0 and $(manual_$uu)>0) |
41 | !advance glob_cnt |
||
42 | !endif |
||
43 | !for j in $ash |
||
44 | !if E isin $j |
||
45 | k=!char 2 to -1 of $j |
||
46 | p_=$[rint(10*$scoremax*$(es_$k))/100] |
||
23 | reyssat | 47 | !else |
12465 | bpr | 48 | p_=!line $j of $percents |
49 | !distribute words $p_ into p1,p2,p3,p4 |
||
50 | !if $p2!=$empty |
||
51 | !distribute item $[$p1/100],$[$p2/10],$[$p3/100],$[$p4/100] into x0_,y_,x1_,x2_ |
||
52 | !set ff_$j=!mathsubst Q=$y_ in $(f_$j) |
||
53 | !for sev=0 to 2 |
||
54 | !set ff_$j=!mathsubst I$sev=$(x$(sev)_) in $(ff_$j) |
||
55 | !next |
||
56 | p_=$[ceil(100*$scoremax*$(ff_$j))/100] |
||
57 | !else |
||
58 | p_=0 |
||
59 | !endif |
||
23 | reyssat | 60 | !endif |
12465 | bpr | 61 | per_$j=$[$(per_$j)+$p_] |
62 | !if $p_>0 |
||
63 | min_$j=$[min($(min_$j),$p_)] |
||
64 | max_$j=$[max($(max_$j),$p_)] |
||
65 | !advance cnt_$j |
||
66 | !endif |
||
67 | !next j |
||
23 | reyssat | 68 | !next i |
69 | !if $manual<1 |
||
12465 | bpr | 70 | !distribute item $mean_auto,$max_auto,$min_auto,$auto_cnt into\ |
14333 | bpr | 71 | mean_glob,max_glob,min_glob,glob_cnt |
23 | reyssat | 72 | !endif |
73 | |||
74 | !distribute item $[rint(100*$mean_auto/max(1,$auto_cnt))/100],\ |
||
14333 | bpr | 75 | $[rint(100*$mean_tea/max(1,$tea_cnt))/100],\ |
76 | $[rint(100*$mean_glob/max(1,$glob_cnt))/100]\ |
||
77 | into mean_auto,mean_tea,mean_glob |
||
23 | reyssat | 78 | |
79 | t=!translate = to , in $wims_req_time |
||
80 | t=!item -1 of $t |
||
81 | means=$t\ |
||
82 | $min_auto $mean_auto $max_auto $min_tea $mean_tea $max_tea $min_glob $mean_glob $max_glob |
||
83 | |||
84 | !for j in $ash |
||
12465 | bpr | 85 | pp=$[rint(100*$(per_$j)/max(1,$(cnt_$j)))/100] |
86 | means=!append line $j $(min_$j) $pp $(max_$j) to $means |
||
23 | reyssat | 87 | !next j |
88 | |||
89 | !writefile wimshome/log/classes/$wims_class/scoreavg $means |