Subversion Repositories wimsdev

Rev

Rev 11849 | Rev 14946 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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