Rev 2255 | Rev 12479 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2255 | Rev 7198 | ||
---|---|---|---|
Line 24... | Line 24... | ||
24 | sep=$(sep_$csvformat) |
24 | sep=$(sep_$csvformat) |
25 | !default sep=$(sep_xls) |
25 | !default sep=$(sep_xls) |
26 | fbase=data-$wims_class-vote-$vote |
26 | fbase=data-$wims_class-vote-$vote |
27 | fbase=!translate internal / to _ in $fbase |
27 | fbase=!translate internal / to _ in $fbase |
28 | fname=wimshome/$wims_sesdir/spreadsheet.$csvformat |
28 | fname=wimshome/$wims_sesdir/spreadsheet.$csvformat |
29 | 29 | ||
30 | tit="$title_vote $vote" |
30 | tit="$title_vote $vote" |
31 | !writefile $fname $tit\ |
31 | !writefile $fname $tit\ |
32 | 32 | ||
33 | !readdef $votedir/$vote.votes |
33 | !readdef $votedir/$vote.votes |
34 | !readdef $votedir/$vote.comments |
34 | !readdef $votedir/$vote.comments |
35 | 35 | ||
36 | !if $vote_option=anonymous or $csvoption=global |
36 | !if $vote_option=anonymous or $csvoption=global |
37 | ### en ligne les questions, en colonne le nombre de votants pour chaque réponse |
37 | ### en ligne les questions, en colonne le nombre de votants pour chaque réponse |
Line 49... | Line 49... | ||
49 | prel=!makelist _ $name_choice x _ for x = 0 to $maxchoice |
49 | prel=!makelist _ $name_choice x _ for x = 0 to $maxchoice |
50 | !next |
50 | !next |
51 | tableau=_,$prel\ |
51 | tableau=_,$prel\ |
52 | $tableau |
52 | $tableau |
53 | !goto end |
53 | !goto end |
54 | !endif |
54 | !endif |
55 | !if $vote_option=trace |
55 | !if $vote_option=trace |
56 | tableau=!makelist x for x = 1 to $vcnt |
56 | tableau=!makelist x for x = 1 to $vcnt |
57 | tableau=!replace internal , by ; in $tableau |
57 | tableau=!replace internal , by ; in $tableau |
58 | tableau=!rows2lines $tableau |
58 | tableau=!rows2lines $tableau |
59 | line=!makelist _0_ for x=1 to $parmcnt |
59 | line=!makelist _0_ for x=1 to $parmcnt |
60 | !for u = 1 to $vcnt |
60 | !for u = 1 to $vcnt |
61 | tableau=!replace line number $u by "$u"_,_$line in $tableau |
61 | tableau=!replace line number $u by "$u"_,_$line in $tableau |
62 | !next |
62 | !next |
63 | !for t = 1 to $parmcnt |
63 | !for t = 1 to $parmcnt |
64 | !if $(type_comment$t)!=yes |
64 | !if $(type_comment$t)!=yes |
65 | !for l = 0 to $[$(choices$t)] |
65 | !for l = 0 to $[$(choices$t)] |
66 | v=$(votes_$(t)_$l) |
66 | v=$(votes_$(t)_$l) |
67 | v1=!itemcnt $v |
67 | v1=!itemcnt $v |
68 | !if $v1>0 |
68 | !if $v1>0 |
69 | !for h = 1 to $v1 |
69 | !for h = 1 to $v1 |
70 | line=!line $(v[$h]) of $tableau |
70 | line=!line $(v[$h]) of $tableau |
71 | line=!replace item number $[$t+1] by _$(l)_ in $line |
71 | line=!replace item number $[$t+1] by _$(l)_ in $line |
72 | tableau=!replace internal line number $(v[$h]) by $line in $tableau |
72 | tableau=!replace internal line number $(v[$h]) by $line in $tableau |
73 | !next |
73 | !next |
74 | !endif |
74 | !endif |
75 | !next |
75 | !next |
Line 118... | Line 118... | ||
118 | !if $(cnt_$u)= |
118 | !if $(cnt_$u)= |
119 | cmp=$[$cmp+1] |
119 | cmp=$[$cmp+1] |
120 | cnt_$u=$cmp |
120 | cnt_$u=$cmp |
121 | item1=$u |
121 | item1=$u |
122 | !endif |
122 | !endif |
123 | line=!line $(cnt_$u) of $tableau |
123 | line=!line $(cnt_$u) of $tableau |
124 | line=!replace item number 1 by $(v[$h])_ in $line |
124 | line=!replace item number 1 by $(v[$h])_ in $line |
125 | line=!replace item number $[$t+1] by _$(l)_ in $line |
125 | line=!replace item number $[$t+1] by _$(l)_ in $line |
126 | tableau=!replace internal line number $(cnt_$u) by $line in $tableau |
126 | tableau=!replace internal line number $(cnt_$u) by $line in $tableau |
127 | !endif |
127 | !endif |
128 | !next |
128 | !next |
Line 133... | Line 133... | ||
133 | entete= !makelist _ Q.x _ for x=1 to $parmcnt |
133 | entete= !makelist _ Q.x _ for x=1 to $parmcnt |
134 | tableau=_,$entete\ |
134 | tableau=_,$entete\ |
135 | $tableau |
135 | $tableau |
136 | !goto end |
136 | !goto end |
137 | !endif |
137 | !endif |
138 | 138 | ||
139 | :end |
139 | :end |
140 | tableau=!replace internal _,_ by $sep in $tableau |
140 | tableau=!replace internal _,_ by $sep in $tableau |
141 | !! !! the following messes up with username containing _ |
141 | !! !! the following messes up with username containing _ |
142 | !! !! testing! |
142 | !! !! testing! |
143 | !!tableau=!replace internal _ by in $tableau |
143 | !!tableau=!replace internal _ by in $tableau |
144 | tableau=!replace internal --- by in $tableau |
144 | tableau=!replace internal --- by in $tableau |
145 | 145 | ||
146 | !appendfile $fname $tableau |
146 | !appendfile $fname $tableau |
147 | 147 | ||
148 | infile=spreadsheet.$csvformat |
148 | infile=spreadsheet.$csvformat |
149 | outfile=$fbase.$csvformat |
149 | outfile=$fbase.$csvformat |
150 | !mexec csv/getprep.sh |
150 | !mexec csv/getprep.sh |