Subversion Repositories wimsdev

Rev

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