Subversion Repositories wimsdev

Rev

Rev 14335 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 14335 Rev 15753
Line -... Line 1...
-
 
1
!! use to replace space if necessary
-
 
2
!set joker=___
-
 
3
 
1
!if $vote_status!=1
4
!if $vote_status!=1
2
  error=bad_vote
5
  error=bad_vote
3
  job=home
6
  job=home
4
  !changeto home.proc
7
  !changeto home.proc
5
!endif
8
!endif
Line 30... Line 33...
30
  voteset=vcnt=$vcnt
33
  voteset=vcnt=$vcnt
31
!endif
34
!endif
32
 
35
 
33
# on récupère le nombre de votes déjà exprimés
36
# on récupère le nombre de votes déjà exprimés
34
nbvotes=$vcnt
37
nbvotes=$vcnt
35
 
-
 
-
 
38
!!__ is to keep trace of single space
36
!for t=1 to $parmcnt
39
!for t=1 to $parmcnt
37
  !if $(vote_description[$t;2])=textarea
40
  !if ($(vote_description[$t;2])=textarea and $vote_option!=nominative) \
38
    !if $vote_option!=nominative
41
      or $(vote_description[$t;2]) iswordof inputfield
39
      tt = !singlespace $(parm$t)
42
    tt =!singlespace $(parm$t)
-
 
43
    tt =!singlespace $tt
-
 
44
    tt=!trim $tt
-
 
45
    !if $(vote_description[$t;2]) iswordof inputfield
40
      tt = !char 1 to $limit_textarea of $tt
46
      tt=!replace internal $ $ by $joker in $tt
41
      !appendfile $votedir/$(vote)_$t.comments :$tt
47
      tt=!replace internal , by . in $tt
42
    !endif
48
    !endif
-
 
49
    tt = !char 1 to $limit_textarea of $tt
-
 
50
    !appendfile $votedir/$(vote)_$t.comments :$tt
43
  !else
51
  !else
44
    !for k=0 to $(choices$t)
52
    !for k=0 to $(choices$t)
45
      vc_$k=$(vcnt_$(t)_$k)
53
      vc_$k=$(vcnt_$(t)_$k)
46
    !next k
54
    !next k
47
    tmp=!values v for v=1 to $(choices$t)
55
    tmp=!values v for v=1 to $(choices$t)
48
    parm$t=!nospace $(parm$t)
56
    parm$t=!nospace $(parm$t)
49
    parm$t=!listintersect $(parm$t) and $tmp
57
    parm$t=!listintersect $(parm$t) and $tmp
50
    !for k in $(parm$t)
58
    !for k in $(parm$t)
51
      !default vc_$k=0
59
      !default vc_$k=0
52
      !advance vc_$k
60
      !advance vc_$k
53
    !next k
61
    !next k
54
    old=!item $t of $(user_vote_$Vote)
62
    old=!item $t of $(user_vote_$Vote)
55
    old=!words2items $old
63
    old=!words2items $old
56
    !for v in $old
64
    !for v in $old
57
      vc_$v=$[max(0,$(vc_$v)-1)]
65
      vc_$v=$[max(0,$(vc_$v)-1)]
58
    !next v
66
    !next v
Line 62... Line 70...
62
        voteset=!append line vcnt_$(t)_$k=$(vc_$k) to $voteset
70
        voteset=!append line vcnt_$(t)_$k=$(vc_$k) to $voteset
63
      !endif
71
      !endif
64
    !next k
72
    !next k
65
  !endif
73
  !endif
66
!next t
74
!next t
67
 
-
 
68
 
75
 
69
# paramcnt: nombre de questions
76
# paramcnt: nombre de questions
70
 
-
 
71
 
77
 
72
!if $vote_option=anonymous
78
!if $vote_option=anonymous
73
  user_vote_$Vote=yes
79
  user_vote_$Vote=yes
74
!else
80
!else
75
  # nouvelle option pour le tracage des reponses.
81
  # nouvelle option pour le tracage des reponses.
Line 90... Line 96...
90
    option=$nbvotes
96
    option=$nbvotes
91
  !endif
97
  !endif
92
 
98
 
93
  tt=$empty
99
  tt=$empty
94
  !for t=1 to $parmcnt
100
  !for t=1 to $parmcnt
95
    !if $(vote_description[$t;2])!=textarea
101
    !if $(vote_description[$t;2]) notwordof textarea inputfield
96
      !if $vote_option=nominative
102
      !if $vote_option=nominative
97
        !! erase old vote. allowed only with vote_option=nominative
103
        !! erase old vote. allowed only with vote_option=nominative
98
        old=!item $t of $(user_vote_$Vote)
104
        old=!item $t of $(user_vote_$Vote)
99
        old=!words2items $old
105
        old=!words2items $old
100
        !for v in $old
106
        !for v in $old