Rev 14325 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
23 | reyssat | 1 | |
2 | !if $ucnt>$maxuser |
||
3 | error=too_many_users |
||
4 | method=list |
||
5 | !exit |
||
6 | !endif |
||
7 | |||
8 | !bound cc between integer 1 and $gcnt+1 default $[$gcnt+1] |
||
9 | !bound percent between 0 and 100 default 0 |
||
10 | |||
11 | !if $reg=$empty or $title=$empty |
||
12 | !exit |
||
13 | !endif |
||
14 | |||
15 | !for i=1 to $uucnt |
||
16 | l_=!record $i+1 of wimshome/log/classes/$wims_class/.grades |
||
17 | n_=!item 1 of $l_ |
||
18 | n_=!hex $n_ |
||
19 | g_$n_=$l_ |
||
20 | !next i |
||
21 | |||
22 | title=!translate ,\ |
||
23 | $ to ; $ in $title |
||
24 | weight=$[$weight] |
||
25 | !bound weight between 0 and 1000 default 1 |
||
26 | !if $gcnt<$cc |
||
27 | titles=!append item $title to $titles |
||
28 | weights=!append item $weight to $weights |
||
29 | !else |
||
30 | titles=!replace item number $cc by $title in $titles |
||
31 | weights=!replace item number $cc by $weight in $weights |
||
32 | !endif |
||
33 | |||
34 | !writefile wimshome/log/classes/$wims_class/.grades :$percent\ |
||
35 | title,title,$titles\ |
||
36 | weights,weights,$weights |
||
14341 | guerimand | 37 | !!-- save score for old user |
38 | ltolduser=!listcomplement $ulist in $uulist |
||
39 | !if $ltolduser!=$empty |
||
40 | nb=!itemcnt $ltolduser |
||
41 | !for i=1 to $nb |
||
42 | key=!positionof item $(ltolduser[$i]) in $uulist |
||
43 | li=!record $[$key+1] of wimshome/log/classes/$wims_class/.grades.old |
||
44 | !appendfile wimshome/log/classes/$wims_class/.grades :$li |
||
45 | !next i |
||
46 | !endif |
||
23 | reyssat | 47 | |
48 | !for i=1 to $ucnt |
||
14325 | guerimand | 49 | !! c$i=$[$(c$i)] |
14341 | guerimand | 50 | !bound c$i between 0 and $maxscore default $joker |
23 | reyssat | 51 | n_=!item $i of $ulist |
52 | f_=!item $i of $flist |
||
53 | l_=!item $i of $llist |
||
54 | h_=!hex $n_ |
||
55 | v_=!item 3 to -1 of $(g_$h_) |
||
56 | t_=!itemcnt $v_ |
||
57 | !if $t_<$cc |
||
58 | !for k=$t_ to $cc-2 |
||
59 | v_=!append item $ to $v_ |
||
60 | !next k |
||
61 | v_=!append item $(c$i) to $v_ |
||
62 | !else |
||
63 | v_=!replace item number $cc by $(c$i) in $v_ |
||
64 | !endif |
||
14341 | guerimand | 65 | v_=!replace internal $joker by $empty in $v_ |
23 | reyssat | 66 | !appendfile wimshome/log/classes/$wims_class/.grades :$n_,$f_ $l_,$v_ |
67 | !next i |
||
68 | |||
69 | !read var.init |
||
70 |