Rev 10305 | Rev 10535 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5235 | czzmrn | 1 | |
2 | today=!char 1 to 8 of $wims_now |
||
3 | thisyear=!char 1 to 4 of $today |
||
7198 | bpr | 4 | !if $class_expiration=$empty |
5235 | czzmrn | 5 | !defread wimshome/log/classes/$wims_class/.def |
6 | !endif |
||
7 | !if $class_expiration=$empty |
||
8 | error=bad_class |
||
9 | !exit |
||
10 | !endif |
||
11 | |||
10273 | guerimand | 12 | data=!record 1 of $votedir/$vote.data |
13 | namevar=!line 1 of $data |
||
14 | !default up_defconnip=!line 2 of $data |
||
15 | po=!positionof item $namevar in $tv_listname |
||
10471 | guerimand | 16 | |
10273 | guerimand | 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 |
||
10471 | guerimand | 45 | !for var in testointro,defconnip,namevar |
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) |
10471 | guerimand | 53 | !bound up_namevar within $listlocalname default $namevar |
10241 | guerimand | 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 | |
10305 | guerimand | 89 | classid2=!replace internal / by A in $classid |
90 | techvartable=\$(classid2)_$num\ |
||
91 | !set techvar_EMPTY=>$class_expiration |
||
10273 | guerimand | 92 | !for i=1 to $numsess |
93 | !!## need to check no "," in exconnip/testoextra and numerical for date variable. |
||
94 | exconnip$i=!replace internal , by . in $(exconnip$i) |
||
95 | testoextra$i=!replace internal , by . in $(testoextra$i) |
||
96 | !for v in bday,bmonth,byear,bhour,bmin,ehour,emin |
||
97 | !if NaN isin $[$($v$i)*1] |
||
98 | $v$i=$empty |
||
99 | !endif |
||
100 | !next v |
||
10241 | guerimand | 101 | |
10273 | guerimand | 102 | ligne=$(listval[$i]) |
103 | !for var in $listvar |
||
104 | ligne=!append item $($var$i) to $ligne |
||
105 | !next var |
||
106 | donfile=!append line $ligne to $donfile |
||
107 | !next i |
||
108 | !writefile $votedir/$vote.data :$donfile\ |
||
10241 | guerimand | 109 | :$testointro |
10273 | guerimand | 110 | |
10241 | guerimand | 111 | !set reg_src=<div>\ |
112 | $testointro\ |
||
113 | </div>\ |
||
114 | \list{ |
||
115 | |||
116 | reg_src1=$reg_src |
||
117 | reg_src2=\uservar{$namevar,$empty, |
||
118 | !for i=1 to $numsess |
||
119 | mese$i=!item $(bmonth$i) of $months |
||
120 | bmonth$i=!char 2,3 of $[abs(floor($(bmonth$i)))+100] |
||
121 | byear$i=!char -4 to -1 of $[abs(floor($(byear$i)))+100000] |
||
122 | bmin$i=!char 2,3 of $[abs(floor($(bmin$i)))+100] |
||
123 | emin$i=!char 2,3 of $[abs(floor($(emin$i)))+100] |
||
124 | bday$i=!char 2,3 of $[abs(floor($(bday$i)))+100] |
||
125 | bhour$i=!char 2,3 of $[abs(floor($(bhour$i)))+100] |
||
126 | ehour$i=!char 2,3 of $[abs(floor($(ehour$i)))+100] |
||
127 | reg_src1=$reg_src1\ |
||
128 | $(nstud$i): $(bday$i) $(mese$i) $(byear$i) - $(bhour$i).$(bmin$i) / $(ehour$i).$(emin$i)$ $(testoextra$i), |
||
129 | techvartable=$techvartable\ |
||
10305 | guerimand | 130 | !set techvar_$(listval[$i])=>$(byear$i)$(bmonth$i)$(bday$i).$(bhour$i):$(bmin$i) <$(byear$i)$(bmonth$i)$(bday$i).$(ehour$i):$(emin$i) $(exconnip$i) |
10241 | guerimand | 131 | reg_src2=$reg_src2\ |
132 | $(listval[$i]), |
||
133 | !next i |
||
134 | |||
135 | reg_src=$reg_src1\ |
||
136 | $name_cancellation\ |
||
137 | }\ |
||
138 | $reg_src2\ |
||
139 | $empty\ |
||
140 | } |
||
141 | !sh mkdir $wims_home/log/classes/$wims_class/techvar |
||
142 | !writefile wimshome/log/classes/$wims_class/techvar/$(classid2)_$num $techvartable |
||
5369 | bpr | 143 | !endif |