Rev 10535 | Rev 10702 | 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) |
||
10535 | czzmrn | 96 | nstud$i=$[max(-1,$(nstud$i))] |
97 | !if NaN isin $(nstud$i) or . isin $(nstud$i) |
||
98 | nstud$i=-1 |
||
99 | !endif |
||
10273 | guerimand | 100 | !for v in bday,bmonth,byear,bhour,bmin,ehour,emin |
101 | !if NaN isin $[$($v$i)*1] |
||
102 | $v$i=$empty |
||
103 | !endif |
||
104 | !next v |
||
10241 | guerimand | 105 | |
10273 | guerimand | 106 | ligne=$(listval[$i]) |
107 | !for var in $listvar |
||
108 | ligne=!append item $($var$i) to $ligne |
||
109 | !next var |
||
110 | donfile=!append line $ligne to $donfile |
||
111 | !next i |
||
112 | !writefile $votedir/$vote.data :$donfile\ |
||
10241 | guerimand | 113 | :$testointro |
10273 | guerimand | 114 | |
10241 | guerimand | 115 | !set reg_src=<div>\ |
116 | $testointro\ |
||
117 | </div>\ |
||
118 | \list{ |
||
119 | |||
120 | reg_src1=$reg_src |
||
121 | reg_src2=\uservar{$namevar,$empty, |
||
122 | !for i=1 to $numsess |
||
123 | mese$i=!item $(bmonth$i) of $months |
||
124 | bmonth$i=!char 2,3 of $[abs(floor($(bmonth$i)))+100] |
||
125 | byear$i=!char -4 to -1 of $[abs(floor($(byear$i)))+100000] |
||
126 | bmin$i=!char 2,3 of $[abs(floor($(bmin$i)))+100] |
||
127 | emin$i=!char 2,3 of $[abs(floor($(emin$i)))+100] |
||
128 | bday$i=!char 2,3 of $[abs(floor($(bday$i)))+100] |
||
129 | bhour$i=!char 2,3 of $[abs(floor($(bhour$i)))+100] |
||
130 | ehour$i=!char 2,3 of $[abs(floor($(ehour$i)))+100] |
||
10536 | czzmrn | 131 | !! |
132 | !! ??? (MC) for vote "0" means "no limit", but maybe when a teacher |
||
133 | !! writes "0" here he/she means really "0" so we should change |
||
134 | !! $(nstud$i) to "-1"? |
||
135 | !! |
||
136 | !! writing "0:" gives bad output in the vote page |
||
137 | !if $(nstud$i)=0 |
||
10241 | guerimand | 138 | reg_src1=$reg_src1\ |
10536 | czzmrn | 139 | $(bday$i) $(mese$i) $(byear$i) - $(bhour$i).$(bmin$i) / $(ehour$i).$(emin$i)$ $(testoextra$i), |
140 | !else |
||
141 | reg_src1=$reg_src1\ |
||
10241 | guerimand | 142 | $(nstud$i): $(bday$i) $(mese$i) $(byear$i) - $(bhour$i).$(bmin$i) / $(ehour$i).$(emin$i)$ $(testoextra$i), |
10536 | czzmrn | 143 | !endif |
10241 | guerimand | 144 | techvartable=$techvartable\ |
10305 | guerimand | 145 | !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 | 146 | reg_src2=$reg_src2\ |
147 | $(listval[$i]), |
||
148 | !next i |
||
149 | |||
150 | reg_src=$reg_src1\ |
||
151 | $name_cancellation\ |
||
152 | }\ |
||
153 | $reg_src2\ |
||
154 | $empty\ |
||
155 | } |
||
156 | !sh mkdir $wims_home/log/classes/$wims_class/techvar |
||
157 | !writefile wimshome/log/classes/$wims_class/techvar/$(classid2)_$num $techvartable |
||
5369 | bpr | 158 | !endif |