Subversion Repositories wimsdev

Rev

Rev 15755 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4142 guerimand 1
!! html file to show result of vote
15753 bpr 2
!set joker=___
4142 guerimand 3
 
4338 guerimand 4
!for k in $listjob2
12479 bpr 5
  !if $job2!=$k
6
    !set wims_ref_class=wims_button
7
    !href cmd=reply&job2=$k $(name_show$k)
8
  !endif
4338 guerimand 9
!next k
10
 
11
!if $wims_user=supervisor
12479 bpr 12
  !set wims_ref_class=wims_button
13
  !href cmd=reply&job=csv $wims_name_csv
4338 guerimand 14
!endif
15
 
6229 bpr 16
<br class="spacer" />
4338 guerimand 17
 
4839 reyssat 18
!if $job2=$empty
12479 bpr 19
  !goto end
4839 reyssat 20
!else
12479 bpr 21
  !goto $job2
4839 reyssat 22
!endif
4338 guerimand 23
 
24
:global
5868 bpr 25
 
13607 obado 26
<table class="wimstable blockcenter">
27
<thead>
15753 bpr 28
  $table_hdtr <th style="width:20px">$wims_name_number</th><th style="width:20px">$wims_name_Type</th><th colspan="$max_rep">$name_thisvote_answer</th></tr>
13607 obado 29
</thead>
30
<tbody>
12479 bpr 31
!for k=1 to $parmcnt
15753 bpr 32
  !if $(vote_description[$k;2]) iswordof textarea inputfield
12479 bpr 33
    !set rowspan=1
4203 bpr 34
  !else
12479 bpr 35
    !set rowspan=2
4203 bpr 36
  !endif
4198 guerimand 37
  <tr class="$(table_colors[$k%2+1])">
12479 bpr 38
  !if uservar!=$(vote_description[$k;2])
10103 bpr 39
    <td rowspan="$rowspan">$(vote_description[$k;1])</td>
40
    <td rowspan="$rowspan">$(vote_description[$k;2])</td>
15753 bpr 41
    !if $(vote_description[$k;2]) iswordof textarea inputfield
42
      <td rowspan="$rowspan" colspan="$[$max_rep]" style="text-align:left" valign="top">
43
      !if $(vote_description[$k;2]) iswordof textarea
44
        !set comment_$k = !replace internal --- by $\
6235 bpr 45
  $<br />- in $(comment_$k)
15753 bpr 46
        !set rcnt=!recordcnt $votedir/$(vote)_$k.comments
47
        <ul>
48
        !for j=1 to $rcnt
49
          <li>
50
          !record $j of $votedir/$(vote)_$k.comments
51
          </li>
52
        !next j
53
        </ul>
54
        </td>
55
      !else
56
        !set rcnt=!recordcnt $votedir/$(vote)_$k.comments
57
        !reset tmp_list tmp_number tmp_pos
58
        !for j=1 to $rcnt
59
          !set tmp=!record $j of $votedir/$(vote)_$k.comments
60
          !set tmp=!trim $tmp
61
          !set tmp=!singlespace $tmp
62
          !!!set tmp=!lowercase $tmp
63
          !set tmp=!replace internal $joker by $ $ in $tmp
64
          !set tmp_pos=!positionof item $tmp in $tmp_list
65
          !if $tmp_pos!=$empty and $tmp_pos>0
66
            !set tmp_number=!replace item number $tmp_pos by $[$(tmp_number[$tmp_pos])+1] in $tmp_number
67
          !else
68
            !set tmp_list=!append item $tmp to $tmp_list
69
            !set tmp_number=!append item 1 to $tmp_number
70
          !endif
71
        !next
72
        !set tmp_listcnt=!itemcnt $tmp_number
73
        <ul class="inline">
74
        !for j=1 to $tmp_listcnt
75
          <li>
76
            $(tmp_list[$j]) ($(tmp_number[$j]))
77
          </li>
78
        !next j
79
        </ul>
80
        </td>
81
        </tr>
82
      !endif
4338 guerimand 83
    !else
12479 bpr 84
      !let tmp=!item 3 to -1 of $(vote_description[$k;])
85
      !let nb=!itemcnt $tmp
86
      !for j in $tmp
87
        <td>$j</td>
88
      !next j
89
      !if $nb<$max_rep
90
        <td colspan="$[$max_rep-$nb]" rowspan="2">&nbsp;</td>
91
      !endif
92
      </tr>
93
      <tr class="$(table_colors[$k%2+1])">
94
      !for j=1 to $nb
95
        <td>$(vcnt_$(k)_$(j))</td>
96
      !next j
97
    !endif
4338 guerimand 98
    </tr>
99
  !endif
15753 bpr 100
  </tr>
12479 bpr 101
!next k
13607 obado 102
</tbody>
15753 bpr 103
</table>
4338 guerimand 104
!goto end
105
 
106
:list
4142 guerimand 107
 $table_header
4229 bpr 108
  $table_hdtr <th>$wims_name_number</th><th>$wims_name_Type</th>
4338 guerimand 109
   !items2words $namelist
110
  </tr>
12479 bpr 111
!for k=1 to $parmcnt
112
  !if uservar!=$(vote_description[$k;2])
4338 guerimand 113
    $table_tr
10103 bpr 114
     <td>
4338 guerimand 115
      $name_question
116
     $(vote_description[$k;1])
4142 guerimand 117
     </td>
10103 bpr 118
     <td>$(vote_description[$k;2])</td>
12479 bpr 119
    !for u=1 to $vcnt
15753 bpr 120
      !if $(vote_description[$k;2]) iswordof textarea inputfield
12479 bpr 121
        <td style="max-width:100px;font-size:0.8em;">
15753 bpr 122
        !set tmp=!record $u of $votedir/$(vote)_$(k).comments
123
        !set tmp=!replace internal $joker by $ $ in $tmp
124
        $tmp
4338 guerimand 125
      !else
12479 bpr 126
        <td>
127
        !item $u of $(donvote_$k)
4338 guerimand 128
      !endif
129
      </td>
12479 bpr 130
    !next u
4338 guerimand 131
    </tr>
12479 bpr 132
  !endif
133
!next k
134
$table_end
4338 guerimand 135
!goto end
136
 
137
:listbystudent
6229 bpr 138
 <br class="spacer" />
4229 bpr 139
 $table_header
140
  $table_hdtr
141
  <td></td>
12479 bpr 142
!for k=1 to $parmcnt
143
  !if uservar!=$(vote_description[$k;2])
10103 bpr 144
    <td>$name_question $(vote_description[$k;1])</td>
12479 bpr 145
  !endif
146
!next k
147
</tr>
148
!for u=1 to $vcnt
149
  $table_tr
150
  $(namelist[$u])
4229 bpr 151
  !for k=1 to $parmcnt
12479 bpr 152
    !if uservar!=$(vote_description[$k;2])
15753 bpr 153
      !if $(vote_description[$k;2]) iswordof textarea inputfield
12479 bpr 154
        <td style="max-width:100px;font-size:0.8em;">
15753 bpr 155
        !set tmp=!record $u of $votedir/$(vote)_$(k).comments
156
        !set tmp=!replace internal $joker by $ $ in $tmp
157
        $tmp
158
        !reset tmp
4338 guerimand 159
      !else
12479 bpr 160
        <td>
4338 guerimand 161
        !item $u of $(donvote_$k)
162
      !endif
163
      </td>
12479 bpr 164
    !endif
165
  !next k
166
  </tr>
167
!next u
4229 bpr 168
 $table_end
4142 guerimand 169
!endif
5868 bpr 170
 
4338 guerimand 171
!goto end
172
 
173
:studentbyitem
174
!if $wims_user=supervisor and $vote_option!=anonymous
15753 bpr 175
  <p>$name_details</p>
12479 bpr 176
  !for i=1 to $parmcnt
177
    !for c=1 to $(choices$i)
178
      !if /supervisor/ notin $c/
15753 bpr 179
        <p>$i - $(vote_description[$i;$c+2])</p>
12479 bpr 180
        <pre>
181
        !for u in $(votes_$(i)_$c)
182
          !if $vote_option=nominative
183
            !!##
184
            !set U=!translate internal / to , in $u
185
            !set U1 = !replace internal , by / in $(U[1..-2])
186
            !set U = !nospace $U1,$(U[-1])
187
            !!       $U
188
            !readproc adm/class/userdef classes,$U
189
            !defof user_lastname, user_firstname in $userdef
190
            ($u)
191
          !else
192
            ($u)
193
          !endif
194
        !next u
195
        </pre>
4341 guerimand 196
      !endif
12479 bpr 197
    !next c
198
  !next i
4338 guerimand 199
!endif
200
 
201
:end
15753 bpr 202
!reset noprint
203
<div class="wims_msg info">
204
!read $votedir/$vote.def
205
</div>
206
 
10103 bpr 207
!set wims_menu_items=!append line back2 $vote,1,cmd=reply&job=read&vote=$vote to $wims_menu_items