Subversion Repositories wimsdev

Rev

Rev 10736 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5235 czzmrn 1
today=!char 1 to 8 of $wims_now
2
thisyear=!char 1 to 4 of $today
7198 bpr 3
!if $class_expiration=$empty
15720 bpr 4
  !defread wimshome/log/classes/$wims_class/.def
5235 czzmrn 5
!endif
6
!if $class_expiration=$empty
15720 bpr 7
  error=bad_class
8
  !exit
5235 czzmrn 9
!endif
10
 
10270 guerimand 11
!! ------------------ keep save data
12
data=!record 1 of $votedir/$vote.data
10736 guerimand 13
codevar=!line 1 of $data
14
po=!positionof item $codevar in $tv_listcode
15
namevar=!item $po of $tv_listname
16
!bound up_codevar within $tv_listlocalcode default $codevar
10270 guerimand 17
 
10736 guerimand 18
!if $po isitemof $tv_listlocal and $codevar=$up_codevar
15720 bpr 19
  data=!line 2 to -1 of $data
20
  listcle=!column 1 of $data
21
  tmp=!line $po of $tv_listtechvar
22
  tmp=!record $(tmp[3]) of wimshome/log/classes/$wims_class/.techvar
23
  listval=!line 2 of $tmp
24
  numsess=!itemcnt $listval
25
  !default mod_numsess=$numsess
26
  !for i=1 to $numsess
27
    p=!positionof item $(listval[$i]) in $listcle
28
    !if $p!=$empty
29
      tdon=!line $p of $data
30
      !default up_nstud$i=$(tdon[2])
31
      !default up_testoextra$i=$(tdon[3])
32
    !endif
33
    nstud$i=$(up_nstud$i)
34
    testoextra$i=$(up_testoextra$i)
35
  !next i
10270 guerimand 36
!else
15720 bpr 37
  data=$empty
10270 guerimand 38
!endif
39
!default up_testointro=!record 2 of $votedir/$vote.data
40
testointro=$up_testointro
5297 czzmrn 41
 
5369 bpr 42
!if $gstep=2
15720 bpr 43
  !! need to check carefully namexevar vs. up_namevar (at some step we seem to
44
  !! be loosing the correction)(?? should this go outside the if $gstep=2)
45
  !if $up_codevar=$empty and $codevar=$empty
46
    error=bad_variable
47
    gstep=1
48
    !exit
49
  !endif
50
  !default codevar=$up_codevar
51
  !if $codevar=$empty
52
    error=no_variable
53
    gstep=1
54
    !exit
55
  !endif
56
  !writefile $votedir/$vote.data :$codevar\
10270 guerimand 57
$data\
58
:$testointro
5369 bpr 59
!endif
10233 guerimand 60
 
61
!if $gstep>=2
15720 bpr 62
  !! get list of value for the technical variable :
10736 guerimand 63
 numvar=!positionof item $codevar in $tv_listcode
15720 bpr 64
  tmp=!line $numvar of $tv_listtechvar
65
  tmp=!record $(tmp[3]) of wimshome/log/classes/$wims_class/.techvar
66
  listval=!line 2 of $tmp
67
  numsess=!itemcnt $listval
10233 guerimand 68
!endif
69
 
70
!if $gstep=3
15720 bpr 71
  !!## need to check $testointro contains no vote primitives
72
  !for i in uservar,menu,list,radio,checkbox,textarea
73
    !set testointro=!replace internal \$i by INVALID in $testointro
74
  !next i
75
  donfile=$codevar
76
  !for i=1 to $numsess
77
    !!## need to check no "," in testoextra
78
    testoextra$i=!replace internal , by . in $(testoextra$i)
79
    nstud$i=$[max(-1,$(nstud$i))]
80
    !if NaN isin $(nstud$i) or . isin $(nstud$i)
81
      nstud$i=-1
82
    !endif
83
    donfile=!append line $(listval[$i]),$(nstud$i),$(testoextra$i) to $donfile
84
  !next i
85
  !writefile $votedir/$vote.data :$donfile\
10233 guerimand 86
:$testointro
87
 
15720 bpr 88
  reg_src=<div>\
10233 guerimand 89
$testointro\
90
</div>\
91
\list{
92
 
15720 bpr 93
  reg_src1=$reg_src
94
  reg_src2=\uservar{$namevar,$empty,
95
  !for i=1 to $numsess
96
    !! writing "0:" gives bad output in the vote page
97
    !if $(nstud$i)=0
98
      reg_src1=$reg_src1\
10555 czzmrn 99
$(testoextra$i),
15720 bpr 100
    !else
101
      reg_src1=$reg_src1\
10233 guerimand 102
$(nstud$i): $(testoextra$i),
15720 bpr 103
    !endif
104
    reg_src2=$reg_src2\
10233 guerimand 105
$(listval[$i]),
15720 bpr 106
  !next i
107
  reg_src=$reg_src1\
10233 guerimand 108
$name_cancellation\
109
}\
110
$reg_src2\
111
$empty\
112
}
113
 
114
!endif