Rev 12479 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4142 | guerimand | 1 | !! process file to show result of vote |
2 | |||
4251 | guerimand | 3 | !if $vote_status=$empty or ($wims_user!=supervisor and $vote_status notwordof 1 2 ) |
12479 | bpr | 4 | error=bad_vote |
5 | job=home |
||
6 | !changeto home.proc |
||
4142 | guerimand | 7 | !endif |
8 | |||
4186 | guerimand | 9 | !if anonymous!=$vote_option |
12479 | bpr | 10 | listjob2=global,list,listbystudent |
11 | !if supervisor=$wims_user |
||
12 | listjob2=$listjob2,studentbyitem |
||
13 | !endif |
||
4142 | guerimand | 14 | !else |
12479 | bpr | 15 | job2=global |
4142 | guerimand | 16 | !endif |
17 | |||
4338 | guerimand | 18 | !bound job2 within $listjob2 default global |
19 | |||
4142 | guerimand | 20 | wims_multiexec=pari maxima yacas |
21 | insmath_rawmath=yes |
||
22 | wims_backslash_insmath=yes |
||
23 | parmcnt=0 |
||
24 | !reset uvname, uvval, uvcnt |
||
25 | !readdef $userfile |
||
26 | !readdef $votedir/$vote.votes |
||
27 | !default vcnt=0 |
||
28 | |||
4251 | guerimand | 29 | !if $wims_user!=supervisor and $(user_vote_$Vote)=$empty |
12479 | bpr | 30 | error=no_vote |
31 | job=read |
||
32 | !changeto read.proc |
||
4251 | guerimand | 33 | !endif |
34 | |||
4142 | guerimand | 35 | !if $wims_user!=supervisor and $vote_show=0 |
12479 | bpr | 36 | job=home |
37 | !changeto home.proc |
||
4142 | guerimand | 38 | !endif |
39 | !if $vote>0 |
||
15718 | bpr | 40 | !if $choices1=$empty |
41 | !readproc primitives/getlimit.proc parms |
||
42 | !endif |
||
12479 | bpr | 43 | !if $choices1!=$empty |
44 | noprint=yes |
||
45 | !endif |
||
46 | vote_description=$empty |
||
47 | !read $votedir/$vote.def |
||
4142 | guerimand | 48 | !endif |
49 | max_rep=0 |
||
50 | !for k=1 to $parmcnt |
||
12479 | bpr | 51 | t=!itemcnt $(vote_description[$k;]) |
52 | max_rep=$[max($max_rep,$t-2)] |
||
4186 | guerimand | 53 | !next k |
54 | |||
55 | !if $vote_option=anonymous |
||
12479 | bpr | 56 | !exit |
4186 | guerimand | 57 | !endif |
58 | !if $vote_option=trace |
||
12479 | bpr | 59 | listkey=!values v for v=1 to $vcnt |
60 | namelist=!makelist <th>$name_votants v</th> for v=1 to $vcnt |
||
4186 | guerimand | 61 | !else |
12479 | bpr | 62 | listkey=$empty |
63 | namelist=$empty |
||
4186 | guerimand | 64 | !endif |
65 | |||
66 | !for k=1 to $parmcnt |
||
12479 | bpr | 67 | !if textarea!=$(vote_description[$k;2]) |
68 | donvote_$k=!makelist -- for v=1 to $vcnt |
||
69 | nbch=!itemcnt $(vote_description[$k;]) |
||
70 | !for l=3 to $nbch |
||
71 | !for m in $(votes_$(k)_$[$(l)-2]) |
||
72 | !if $m notitemof $listkey |
||
73 | listkey=!append item $m to $listkey |
||
74 | !if $vote_option=nominative |
||
75 | tmp=!replace internal / by , in $m |
||
76 | tmp=!defof user_firstname\ |
||
4186 | guerimand | 77 | user_lastname in wimshome/log/classes/$wims_superclass/.users/$(tmp[-1]) |
12479 | bpr | 78 | tmp=!lines2words $tmp |
79 | namelist=!append item <th>$tmp</th> to $namelist |
||
80 | !endif |
||
81 | !endif |
||
82 | mkey=!positionof item $m in $listkey |
||
83 | newval=!item $mkey of $(donvote_$k) |
||
84 | !if $newval!=-- |
||
85 | newval=$newval ; $(vote_description[$k;$l]) |
||
86 | !else |
||
87 | newval=$(vote_description[$k;$l]) |
||
88 | !endif |
||
89 | donvote_$k=!replace item number $mkey by $newval in $(donvote_$k) |
||
90 | !next m |
||
91 | !next l |
||
92 | !endif |
||
4186 | guerimand | 93 | !next k |