Rev 10736 | Rev 14348 | 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 |
10736 | guerimand | 13 | codevar=!line 1 of $data |
10273 | guerimand | 14 | !default up_defconnip=!line 2 of $data |
10736 | guerimand | 15 | po=!positionof item $codevar in $tv_listcode |
16 | namevar=!item $po of $tv_listname |
||
10471 | guerimand | 17 | |
10736 | guerimand | 18 | !bound up_codevar within $tv_listlocalcode default $codevar |
10273 | guerimand | 19 | |
20 | listvar=bday,bmonth,byear,bhour,bmin,ehour,emin,nstud,testoextra,exconnip |
||
10736 | guerimand | 21 | !if $po isitemof $tv_listlocal and $codevar=$up_codevar |
10273 | guerimand | 22 | data=!line 3 to -1 of $data |
23 | listcle=!column 1 of $data |
||
24 | tmp=!line $po of $tv_listtechvar |
||
25 | tmp=!record $(tmp[3]) of wimshome/log/classes/$wims_class/.techvar |
||
26 | listval=!line 2 of $tmp |
||
27 | numsess=!itemcnt $listval |
||
28 | !default mod_numsess=$numsess |
||
29 | !for i=1 to $numsess |
||
30 | p=!positionof item $(listval[$i]) in $listcle |
||
31 | !if $p!=$empty |
||
32 | tdon=!line $p of $data |
||
33 | !for v=1 to 10 |
||
34 | !default up_$(listvar[$v])$i=$(tdon[$v+1]) |
||
35 | !next v |
||
36 | !endif |
||
11849 | guerimand | 37 | !if $jquery_defined=yes and $(up_bdate$i)!=$empty |
38 | up_byear$i=!char 1 to 4 of $(up_bdate$i) |
||
39 | up_bmonth$i=!char 5 to 6 of $(up_bdate$i) |
||
40 | up_bday$i=!char 7 to 8 of $(up_bdate$i) |
||
41 | !endif |
||
10273 | guerimand | 42 | !for var in $listvar |
43 | $(var)$i=$(up_$(var)$i) |
||
10241 | guerimand | 44 | !next var |
45 | !next i |
||
10273 | guerimand | 46 | !else |
47 | data=$empty |
||
48 | !endif |
||
49 | !default up_testointro=!record 2 of $votedir/$vote.data |
||
50 | testointro=$up_testointro |
||
10471 | guerimand | 51 | !for var in testointro,defconnip,namevar |
5369 | bpr | 52 | !default up_$var=$($var) |
53 | !set $var=$(up_$var) |
||
10233 | guerimand | 54 | !next var |
5297 | czzmrn | 55 | |
5369 | bpr | 56 | !if $gstep=2 |
7198 | bpr | 57 | !! need to check carefully namexevar vs. up_namevar (at some step we seem to |
5369 | bpr | 58 | !! be loosing the correction)(?? should this go outside the if $gstep=2) |
10736 | guerimand | 59 | !bound up_codevar within $tv_listlocalcode default $codevar |
60 | !if $up_codevar=$empty and $codevar=$empty |
||
5369 | bpr | 61 | error=bad_variable |
10241 | guerimand | 62 | gstep=1 |
63 | !exit |
||
5369 | bpr | 64 | !endif |
10736 | guerimand | 65 | !default codevar=$up_codevar |
66 | !if $codevar=$empty |
||
5369 | bpr | 67 | error=no_variable |
10241 | guerimand | 68 | gstep=1 |
69 | !exit |
||
5369 | bpr | 70 | !endif |
10736 | guerimand | 71 | !writefile $votedir/$vote.data :$codevar\ |
10273 | guerimand | 72 | $defconnip\ |
73 | $data\ |
||
74 | :$testointro |
||
10241 | guerimand | 75 | !endif |
76 | |||
77 | !if $gstep>=2 |
||
78 | !! get list of value for the technical variable : |
||
10736 | guerimand | 79 | numvar=!positionof item $codevar in $tv_listcode |
10702 | guerimand | 80 | tmp=!line $numvar of $tv_listtechvar |
10736 | guerimand | 81 | namevar=!item $numvar of $tv_listname |
10241 | guerimand | 82 | !distribute item $tmp into bb,classid,num |
83 | don=!record $num of wimshome/log/classes/$wims_class/.techvar |
||
84 | listval=!line 2 of $don |
||
85 | numsess=!itemcnt $listval |
||
86 | !endif |
||
87 | |||
88 | !if $gstep=3 |
||
89 | !!## need to check $testointro contains no vote primitives |
||
10273 | guerimand | 90 | !for i in uservar,menu,list,radio,checkbox,textarea |
91 | testointro=!replace internal \$i by INVALID in $testointro |
||
92 | !next i |
||
10736 | guerimand | 93 | donfile=$codevar\ |
10273 | guerimand | 94 | $defconnip |
10241 | guerimand | 95 | |
10736 | guerimand | 96 | techvartable=\$codevar\ |
10305 | guerimand | 97 | !set techvar_EMPTY=>$class_expiration |
10273 | guerimand | 98 | !for i=1 to $numsess |
99 | !!## need to check no "," in exconnip/testoextra and numerical for date variable. |
||
100 | exconnip$i=!replace internal , by . in $(exconnip$i) |
||
101 | testoextra$i=!replace internal , by . in $(testoextra$i) |
||
10535 | czzmrn | 102 | nstud$i=$[max(-1,$(nstud$i))] |
103 | !if NaN isin $(nstud$i) or . isin $(nstud$i) |
||
104 | nstud$i=-1 |
||
105 | !endif |
||
10273 | guerimand | 106 | !for v in bday,bmonth,byear,bhour,bmin,ehour,emin |
107 | !if NaN isin $[$($v$i)*1] |
||
108 | $v$i=$empty |
||
109 | !endif |
||
110 | !next v |
||
10241 | guerimand | 111 | |
10273 | guerimand | 112 | ligne=$(listval[$i]) |
113 | !for var in $listvar |
||
114 | ligne=!append item $($var$i) to $ligne |
||
115 | !next var |
||
116 | donfile=!append line $ligne to $donfile |
||
117 | !next i |
||
118 | !writefile $votedir/$vote.data :$donfile\ |
||
10241 | guerimand | 119 | :$testointro |
10273 | guerimand | 120 | |
10241 | guerimand | 121 | !set reg_src=<div>\ |
122 | $testointro\ |
||
123 | </div>\ |
||
124 | \list{ |
||
125 | |||
126 | reg_src1=$reg_src |
||
127 | reg_src2=\uservar{$namevar,$empty, |
||
128 | !for i=1 to $numsess |
||
129 | mese$i=!item $(bmonth$i) of $months |
||
130 | bmonth$i=!char 2,3 of $[abs(floor($(bmonth$i)))+100] |
||
131 | byear$i=!char -4 to -1 of $[abs(floor($(byear$i)))+100000] |
||
132 | bmin$i=!char 2,3 of $[abs(floor($(bmin$i)))+100] |
||
133 | emin$i=!char 2,3 of $[abs(floor($(emin$i)))+100] |
||
134 | bday$i=!char 2,3 of $[abs(floor($(bday$i)))+100] |
||
135 | bhour$i=!char 2,3 of $[abs(floor($(bhour$i)))+100] |
||
136 | ehour$i=!char 2,3 of $[abs(floor($(ehour$i)))+100] |
||
10536 | czzmrn | 137 | !! |
138 | !! ??? (MC) for vote "0" means "no limit", but maybe when a teacher |
||
139 | !! writes "0" here he/she means really "0" so we should change |
||
140 | !! $(nstud$i) to "-1"? |
||
141 | !! |
||
142 | !! writing "0:" gives bad output in the vote page |
||
143 | !if $(nstud$i)=0 |
||
10241 | guerimand | 144 | reg_src1=$reg_src1\ |
10536 | czzmrn | 145 | $(bday$i) $(mese$i) $(byear$i) - $(bhour$i).$(bmin$i) / $(ehour$i).$(emin$i)$ $(testoextra$i), |
146 | !else |
||
147 | reg_src1=$reg_src1\ |
||
10241 | guerimand | 148 | $(nstud$i): $(bday$i) $(mese$i) $(byear$i) - $(bhour$i).$(bmin$i) / $(ehour$i).$(emin$i)$ $(testoextra$i), |
10536 | czzmrn | 149 | !endif |
10241 | guerimand | 150 | techvartable=$techvartable\ |
10305 | guerimand | 151 | !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 | 152 | reg_src2=$reg_src2\ |
153 | $(listval[$i]), |
||
154 | !next i |
||
155 | |||
156 | reg_src=$reg_src1\ |
||
157 | $name_cancellation\ |
||
158 | }\ |
||
159 | $reg_src2\ |
||
160 | $empty\ |
||
161 | } |
||
10736 | guerimand | 162 | !sh mkdir -p $wims_home/log/classes/$wims_class/techvar |
163 | !writefile wimshome/log/classes/$wims_class/techvar/$codevar $techvartable |
||
5369 | bpr | 164 | !endif |