Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
5235 czzmrn 1
 
5369 bpr 2
 
5235 czzmrn 3
today=!char 1 to 8 of $wims_now
4
thisyear=!char 1 to 4 of $today
7198 bpr 5
!if $class_expiration=$empty
5235 czzmrn 6
 !defread wimshome/log/classes/$wims_class/.def
7
!endif
8
!if $class_expiration=$empty
9
 error=bad_class
10
 !exit
11
!endif
12
 
10273 guerimand 13
data=!record 1 of $votedir/$vote.data
14
namevar=!line 1 of $data
15
!default up_defconnip=!line 2 of $data
16
po=!positionof item $namevar in $tv_listname
17
!bound up_namevar within $listlocalname default $namevar
18
 
19
listvar=bday,bmonth,byear,bhour,bmin,ehour,emin,nstud,testoextra,exconnip
20
!if $po isitemof $tv_listlocal and $namevar=$up_namevar
21
 data=!line 3 to -1 of $data
22
 listcle=!column 1 of $data
23
 tmp=!line $po of $tv_listtechvar
24
 tmp=!record $(tmp[3]) of wimshome/log/classes/$wims_class/.techvar
25
 listval=!line 2 of $tmp
26
 numsess=!itemcnt $listval
27
 !default mod_numsess=$numsess
28
 !for i=1 to $numsess
29
   p=!positionof item $(listval[$i]) in $listcle
30
   !if $p!=$empty
31
    tdon=!line $p of $data
32
    !for v=1 to 10
33
     !default up_$(listvar[$v])$i=$(tdon[$v+1])
34
    !next v
35
   !endif
36
   !for var in $listvar
37
    $(var)$i=$(up_$(var)$i)
10241 guerimand 38
   !next var
39
 !next i
10273 guerimand 40
!else
41
 data=$empty
42
!endif
43
!default up_testointro=!record 2 of $votedir/$vote.data
44
testointro=$up_testointro
45
!for var in testointro,defconnip
5369 bpr 46
    !default up_$var=$($var)
47
    !set $var=$(up_$var)
10233 guerimand 48
!next var
5297 czzmrn 49
 
5369 bpr 50
!if $gstep=2
7198 bpr 51
!! need to check carefully namexevar vs. up_namevar (at some step we seem to
5369 bpr 52
!! be loosing the correction)(?? should this go outside the if $gstep=2)
10241 guerimand 53
 !bound up_namevar within $listlocalname
54
 !if $up_namevar=$empty and $namevar=$empty
5369 bpr 55
   error=bad_variable
10241 guerimand 56
   gstep=1
57
   !exit
5369 bpr 58
 !endif
10241 guerimand 59
 !default namevar=$up_namevar
60
 !if $namevar=$empty
5369 bpr 61
  error=no_variable
10241 guerimand 62
  gstep=1
63
  !exit
5369 bpr 64
 !endif
10273 guerimand 65
 !writefile $votedir/$vote.data :$namevar\
66
$defconnip\
67
$data\
68
:$testointro
10241 guerimand 69
!endif
70
 
71
!if $gstep>=2
72
!! get list of value for the technical variable :
73
 tmp=!positionof item $namevar in $tv_listname
74
 tmp=!line $tmp of $tv_listtechvar
75
 !distribute item $tmp into bb,classid,num
76
 don=!record $num of wimshome/log/classes/$wims_class/.techvar
77
 listval=!line 2 of $don
78
 numsess=!itemcnt $listval
79
!endif
80
 
81
!if $gstep=3
82
!!## need to check $testointro contains no vote primitives
10273 guerimand 83
 !for i in uservar,menu,list,radio,checkbox,textarea
84
   testointro=!replace internal \$i by INVALID in $testointro
85
 !next i
86
 donfile=$namevar\
87
$defconnip
10241 guerimand 88
 
10273 guerimand 89
 techvartable=techvar $namevar $(classid)_$num\
10241 guerimand 90
,>$class_expiration
10273 guerimand 91
 !for i=1 to $numsess
92
  !!## need to check no "," in exconnip/testoextra and numerical for date variable.
93
  exconnip$i=!replace internal , by . in $(exconnip$i)
94
  testoextra$i=!replace internal , by . in $(testoextra$i)
95
  !for v in bday,bmonth,byear,bhour,bmin,ehour,emin
96
   !if NaN isin $[$($v$i)*1]
97
	$v$i=$empty
98
   !endif
99
  !next v
10241 guerimand 100
 
10273 guerimand 101
  ligne=$(listval[$i])
102
  !for var in $listvar
103
   ligne=!append item $($var$i) to $ligne
104
  !next var
105
  donfile=!append line $ligne to $donfile
106
 !next i
107
 !writefile $votedir/$vote.data :$donfile\
10241 guerimand 108
:$testointro
10273 guerimand 109
 
10241 guerimand 110
!set reg_src=<div>\
111
$testointro\
112
</div>\
113
\list{
114
 
115
 reg_src1=$reg_src
116
 reg_src2=\uservar{$namevar,$empty,
117
 !for i=1 to $numsess
118
  mese$i=!item $(bmonth$i) of $months
119
  bmonth$i=!char 2,3 of $[abs(floor($(bmonth$i)))+100]
120
  byear$i=!char -4 to -1 of $[abs(floor($(byear$i)))+100000]
121
  bmin$i=!char 2,3 of $[abs(floor($(bmin$i)))+100]
122
  emin$i=!char 2,3 of $[abs(floor($(emin$i)))+100]
123
  bday$i=!char 2,3 of $[abs(floor($(bday$i)))+100]
124
  bhour$i=!char 2,3 of $[abs(floor($(bhour$i)))+100]
125
  ehour$i=!char 2,3 of $[abs(floor($(ehour$i)))+100]
126
  reg_src1=$reg_src1\
127
$(nstud$i): $(bday$i) $(mese$i) $(byear$i) - $(bhour$i).$(bmin$i) / $(ehour$i).$(emin$i)$ $(testoextra$i),
128
  techvartable=$techvartable\
129
$(listval[$i]),>$(byear$i)$(bmonth$i)$(bday$i).$(bhour$i):$(bmin$i) <$(byear$i)$(bmonth$i)$(bday$i).$(ehour$i):$(emin$i) $(exconnip$i),
130
  reg_src2=$reg_src2\
131
$(listval[$i]),
132
 !next i
133
 
134
 reg_src=$reg_src1\
135
$name_cancellation\
136
}\
137
$reg_src2\
138
$empty\
139
}
140
 !sh mkdir $wims_home/log/classes/$wims_class/techvar
141
 !writefile wimshome/log/classes/$wims_class/techvar/$(classid2)_$num $techvartable
5369 bpr 142
!endif