Subversion Repositories wimsdev

Rev

Rev 15756 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. !! html file to show result of vote
  2. !set joker=___
  3.  
  4. !for k in $listjob2
  5.   !if $job2!=$k
  6.     !set wims_ref_class=wims_button
  7.     !href cmd=reply&job2=$k $(name_show$k)
  8.   !endif
  9. !next k
  10.  
  11. !if $wims_user=supervisor
  12.   !set wims_ref_class=wims_button
  13.   !href cmd=reply&job=csv $wims_name_csv
  14. !endif
  15.  
  16. <br class="spacer">
  17.  
  18. !if $job2=$empty
  19.   !goto end
  20. !else
  21.   !goto $job2
  22. !endif
  23.  
  24. :global
  25.  
  26. <table class="wimstable blockcenter">
  27. <thead>
  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>
  29. </thead>
  30. <tbody>
  31. !for k=1 to $parmcnt
  32.   !if $(vote_description[$k;2]) iswordof textarea inputfield
  33.     !set rowspan=1
  34.   !else
  35.     !set rowspan=2
  36.   !endif
  37.   <tr class="$(table_colors[$k%2+1])">
  38.   !if uservar!=$(vote_description[$k;2])
  39.     <td rowspan="$rowspan">$(vote_description[$k;1])</td>
  40.     <td rowspan="$rowspan">$(vote_description[$k;2])</td>
  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 $\
  45.   $<br>- in $(comment_$k)
  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
  83.     !else
  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
  98.     </tr>
  99.   !endif
  100.   </tr>
  101. !next k
  102. </tbody>
  103. </table>
  104. !goto end
  105.  
  106. :list
  107.  $table_header
  108.   $table_hdtr <th>$wims_name_number</th><th>$wims_name_Type</th>
  109.    !items2words $namelist
  110.   </tr>
  111. !for k=1 to $parmcnt
  112.   !if uservar!=$(vote_description[$k;2])
  113.     $table_tr
  114.      <td>
  115.       $name_question
  116.      $(vote_description[$k;1])
  117.      </td>
  118.      <td>$(vote_description[$k;2])</td>
  119.     !for u=1 to $vcnt
  120.       !if $(vote_description[$k;2]) iswordof textarea inputfield
  121.         <td style="max-width:100px;font-size:0.8em;">
  122.         !set tmp=!record $u of $votedir/$(vote)_$(k).comments
  123.         !set tmp=!replace internal $joker by $ $ in $tmp
  124.         $tmp
  125.       !else
  126.         <td>
  127.         !item $u of $(donvote_$k)
  128.       !endif
  129.       </td>
  130.     !next u
  131.     </tr>
  132.   !endif
  133. !next k
  134. $table_end
  135. !goto end
  136.  
  137. :listbystudent
  138.  <br class="spacer">
  139.  $table_header
  140.   $table_hdtr
  141.   <td></td>
  142. !for k=1 to $parmcnt
  143.   !if uservar!=$(vote_description[$k;2])
  144.     <td>$name_question $(vote_description[$k;1])</td>
  145.   !endif
  146. !next k
  147. </tr>
  148. !for u=1 to $vcnt
  149.   $table_tr
  150.   $(namelist[$u])
  151.   !for k=1 to $parmcnt
  152.     !if uservar!=$(vote_description[$k;2])
  153.       !if $(vote_description[$k;2]) iswordof textarea inputfield
  154.         <td style="max-width:100px;font-size:0.8em;">
  155.         !set tmp=!record $u of $votedir/$(vote)_$(k).comments
  156.         !set tmp=!replace internal $joker by $ $ in $tmp
  157.         $tmp
  158.         !reset tmp
  159.       !else
  160.         <td>
  161.         !item $u of $(donvote_$k)
  162.       !endif
  163.       </td>
  164.     !endif
  165.   !next k
  166.   </tr>
  167. !next u
  168.  $table_end
  169. !endif
  170.  
  171. !goto end
  172.  
  173. :studentbyitem
  174. !if $wims_user=supervisor and $vote_option!=anonymous
  175.   <p>$name_details</p>
  176.   !for i=1 to $parmcnt
  177.     !for c=1 to $(choices$i)
  178.       !if /supervisor/ notin $c/
  179.         <p>$i - $(vote_description[$i;$c+2])</p>
  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>
  196.       !endif
  197.     !next c
  198.   !next i
  199. !endif
  200.  
  201. :end
  202. !reset noprint
  203. <div class="wims_msg info">
  204. !read $votedir/$vote.def
  205. </div>
  206.  
  207. !set wims_menu_items=!append line back2 $vote,1,cmd=reply&job=read&vote=$vote to $wims_menu_items
  208.