Subversion Repositories wimsdev

Rev

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
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
10270 guerimand 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)
10233 guerimand 35
 !next i
10270 guerimand 36
!else
37
 data=$empty
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
7198 bpr 43
!! need to check carefully namexevar vs. up_namevar (at some step we seem to
5369 bpr 44
!! be loosing the correction)(?? should this go outside the if $gstep=2)
10736 guerimand 45
 !if $up_codevar=$empty and $codevar=$empty
5369 bpr 46
   error=bad_variable
10233 guerimand 47
   gstep=1
48
   !exit
5369 bpr 49
 !endif
10736 guerimand 50
 !default codevar=$up_codevar
51
 !if $codevar=$empty
5369 bpr 52
  error=no_variable
10233 guerimand 53
  gstep=1
54
  !exit
5369 bpr 55
 !endif
10736 guerimand 56
 !writefile $votedir/$vote.data :$codevar\
10270 guerimand 57
$data\
58
:$testointro
5369 bpr 59
!endif
10233 guerimand 60
 
61
!if $gstep>=2
62
!! get list of value for the technical variable :
10736 guerimand 63
 numvar=!positionof item $codevar in $tv_listcode
10702 guerimand 64
 tmp=!line $numvar of $tv_listtechvar
10233 guerimand 65
 tmp=!record $(tmp[3]) of wimshome/log/classes/$wims_class/.techvar
66
 listval=!line 2 of $tmp
67
 numsess=!itemcnt $listval
68
!endif
69
 
70
!if $gstep=3
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
10736 guerimand 75
 donfile=$codevar
10233 guerimand 76
 !for i=1 to $numsess
77
!!## need to check no "," in testoextra
10270 guerimand 78
  testoextra$i=!replace internal , by . in $(testoextra$i)
10517 guerimand 79
  nstud$i=$[max(-1,$(nstud$i))]
80
  !if NaN isin $(nstud$i) or . isin $(nstud$i)
81
    nstud$i=-1
10233 guerimand 82
  !endif
10270 guerimand 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
 
88
 reg_src=<div>\
89
$testointro\
90
</div>\
91
\list{
92
 
93
 reg_src1=$reg_src
94
 reg_src2=\uservar{$namevar,$empty,
95
 !for i=1 to $numsess
10555 czzmrn 96
!! writing "0:" gives bad output in the vote page
97
!if $(nstud$i)=0
10233 guerimand 98
  reg_src1=$reg_src1\
10555 czzmrn 99
$(testoextra$i),
100
!else
101
  reg_src1=$reg_src1\
10233 guerimand 102
$(nstud$i): $(testoextra$i),
10555 czzmrn 103
!endif
10233 guerimand 104
  reg_src2=$reg_src2\
105
$(listval[$i]),
106
 !next i
107
 reg_src=$reg_src1\
108
$name_cancellation\
109
}\
110
$reg_src2\
111
$empty\
112
}
113
 
114
!endif
115