Subversion Repositories wimsdev

Rev

Rev 10736 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 10736 Rev 15720
Line 2... Line 2...
2
thisyear=!char 1 to 4 of $today
2
thisyear=!char 1 to 4 of $today
3
!if $class_expiration=$empty
3
!if $class_expiration=$empty
4
 !defread wimshome/log/classes/$wims_class/.def
4
  !defread wimshome/log/classes/$wims_class/.def
5
!endif
5
!endif
6
!if $class_expiration=$empty
6
!if $class_expiration=$empty
7
 error=bad_class
7
  error=bad_class
8
 !exit
8
  !exit
9
!endif
9
!endif
10
 
10
 
11
!! ------------------ keep save data
11
!! ------------------ keep save data
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
po=!positionof item $codevar in $tv_listcode
14
po=!positionof item $codevar in $tv_listcode
15
namevar=!item $po of $tv_listname
15
namevar=!item $po of $tv_listname
16
!bound up_codevar within $tv_listlocalcode default $codevar
16
!bound up_codevar within $tv_listlocalcode default $codevar
17
 
17
 
18
!if $po isitemof $tv_listlocal and $codevar=$up_codevar
18
!if $po isitemof $tv_listlocal and $codevar=$up_codevar
19
 data=!line 2 to -1 of $data
19
  data=!line 2 to -1 of $data
20
 listcle=!column 1 of $data
20
  listcle=!column 1 of $data
21
 tmp=!line $po of $tv_listtechvar
21
  tmp=!line $po of $tv_listtechvar
22
 tmp=!record $(tmp[3]) of wimshome/log/classes/$wims_class/.techvar
22
  tmp=!record $(tmp[3]) of wimshome/log/classes/$wims_class/.techvar
23
 listval=!line 2 of $tmp
23
  listval=!line 2 of $tmp
24
 numsess=!itemcnt $listval
24
  numsess=!itemcnt $listval
25
 !default mod_numsess=$numsess
25
  !default mod_numsess=$numsess
26
 !for i=1 to $numsess
26
  !for i=1 to $numsess
27
   p=!positionof item $(listval[$i]) in $listcle
27
    p=!positionof item $(listval[$i]) in $listcle
28
   !if $p!=$empty
28
    !if $p!=$empty
29
    tdon=!line $p of $data
29
      tdon=!line $p of $data
30
    !default up_nstud$i=$(tdon[2])
30
      !default up_nstud$i=$(tdon[2])
31
    !default up_testoextra$i=$(tdon[3])
31
      !default up_testoextra$i=$(tdon[3])
32
   !endif
32
    !endif
33
   nstud$i=$(up_nstud$i)
33
    nstud$i=$(up_nstud$i)
34
   testoextra$i=$(up_testoextra$i)
34
    testoextra$i=$(up_testoextra$i)
35
 !next i
35
  !next i
36
!else
36
!else
37
 data=$empty
37
  data=$empty
38
!endif
38
!endif
39
!default up_testointro=!record 2 of $votedir/$vote.data
39
!default up_testointro=!record 2 of $votedir/$vote.data
40
testointro=$up_testointro
40
testointro=$up_testointro
41
 
41
 
42
!if $gstep=2
42
!if $gstep=2
43
!! need to check carefully namexevar vs. up_namevar (at some step we seem to
43
  !! need to check carefully namexevar vs. up_namevar (at some step we seem to
44
!! be loosing the correction)(?? should this go outside the if $gstep=2)
44
  !! be loosing the correction)(?? should this go outside the if $gstep=2)
45
 !if $up_codevar=$empty and $codevar=$empty
45
  !if $up_codevar=$empty and $codevar=$empty
46
   error=bad_variable
46
    error=bad_variable
47
   gstep=1
47
    gstep=1
48
   !exit
48
    !exit
49
 !endif
49
  !endif
50
 !default codevar=$up_codevar
50
  !default codevar=$up_codevar
51
 !if $codevar=$empty
51
  !if $codevar=$empty
52
  error=no_variable
52
    error=no_variable
53
  gstep=1
53
    gstep=1
54
  !exit
54
    !exit
55
 !endif
55
  !endif
56
 !writefile $votedir/$vote.data :$codevar\
56
  !writefile $votedir/$vote.data :$codevar\
57
$data\
57
$data\
58
:$testointro
58
:$testointro
59
!endif
59
!endif
60
 
60
 
61
!if $gstep>=2
61
!if $gstep>=2
62
!! get list of value for the technical variable :
62
  !! get list of value for the technical variable :
63
 numvar=!positionof item $codevar in $tv_listcode
63
 numvar=!positionof item $codevar in $tv_listcode
64
 tmp=!line $numvar of $tv_listtechvar
64
  tmp=!line $numvar of $tv_listtechvar
65
 tmp=!record $(tmp[3]) of wimshome/log/classes/$wims_class/.techvar
65
  tmp=!record $(tmp[3]) of wimshome/log/classes/$wims_class/.techvar
66
 listval=!line 2 of $tmp
66
  listval=!line 2 of $tmp
67
 numsess=!itemcnt $listval
67
  numsess=!itemcnt $listval
68
!endif
68
!endif
69
 
69
 
70
!if $gstep=3
70
!if $gstep=3
71
!!## need to check $testointro contains no vote primitives
71
  !!## need to check $testointro contains no vote primitives
72
 !for i in uservar,menu,list,radio,checkbox,textarea
72
  !for i in uservar,menu,list,radio,checkbox,textarea
73
  !set testointro=!replace internal \$i by INVALID in $testointro
73
    !set testointro=!replace internal \$i by INVALID in $testointro
74
 !next i
74
  !next i
75
 donfile=$codevar
75
  donfile=$codevar
76
 !for i=1 to $numsess
76
  !for i=1 to $numsess
77
!!## need to check no "," in testoextra
77
    !!## need to check no "," in testoextra
78
  testoextra$i=!replace internal , by . in $(testoextra$i)
78
    testoextra$i=!replace internal , by . in $(testoextra$i)
79
  nstud$i=$[max(-1,$(nstud$i))]
79
    nstud$i=$[max(-1,$(nstud$i))]
80
  !if NaN isin $(nstud$i) or . isin $(nstud$i)
80
    !if NaN isin $(nstud$i) or . isin $(nstud$i)
81
    nstud$i=-1
81
      nstud$i=-1
82
  !endif
82
    !endif
83
  donfile=!append line $(listval[$i]),$(nstud$i),$(testoextra$i) to $donfile
83
    donfile=!append line $(listval[$i]),$(nstud$i),$(testoextra$i) to $donfile
84
 !next i
84
  !next i
85
 !writefile $votedir/$vote.data :$donfile\
85
  !writefile $votedir/$vote.data :$donfile\
86
:$testointro
86
:$testointro
87
 
87
 
88
 reg_src=<div>\
88
  reg_src=<div>\
89
$testointro\
89
$testointro\
90
</div>\
90
</div>\
91
\list{
91
\list{
92
 
92
 
93
 reg_src1=$reg_src
93
  reg_src1=$reg_src
94
 reg_src2=\uservar{$namevar,$empty,
94
  reg_src2=\uservar{$namevar,$empty,
95
 !for i=1 to $numsess
95
  !for i=1 to $numsess
96
!! writing "0:" gives bad output in the vote page
96
    !! writing "0:" gives bad output in the vote page
97
!if $(nstud$i)=0
97
    !if $(nstud$i)=0
98
  reg_src1=$reg_src1\
98
      reg_src1=$reg_src1\
99
$(testoextra$i),
99
$(testoextra$i),
100
!else
100
    !else
101
  reg_src1=$reg_src1\
101
      reg_src1=$reg_src1\
102
$(nstud$i): $(testoextra$i),
102
$(nstud$i): $(testoextra$i),
103
!endif
103
    !endif
104
  reg_src2=$reg_src2\
104
    reg_src2=$reg_src2\
105
$(listval[$i]),
105
$(listval[$i]),
106
 !next i
106
  !next i
107
 reg_src=$reg_src1\
107
  reg_src=$reg_src1\
108
$name_cancellation\
108
$name_cancellation\
109
}\
109
}\
110
$reg_src2\
110
$reg_src2\
111
$empty\
111
$empty\
112
}
112
}
113
 
113
 
114
!endif
114
!endif
115
 
-