Subversion Repositories wimsdev

Rev

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

Rev 10241 Rev 10270
Line 6... Line 6...
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
!readdef $votedir/$vote.data
12
data=!record 1 of $votedir/$vote.data
-
 
13
namevar=!line 1 of $data
-
 
14
po=!positionof item $namevar in $tv_listname
-
 
15
!bound up_namevar within $listlocalname default $namevar
-
 
16
 
12
!default testointro=!record 1 of $votedir/$vote.data
17
!if $po isitemof $tv_listlocal and $namevar=$up_namevar
-
 
18
 data=!line 2 to -1 of $data
-
 
19
 listcle=!column 1 of $data
-
 
20
 tmp=!line $po of $tv_listtechvar
-
 
21
 tmp=!record $(tmp[3]) of wimshome/log/classes/$wims_class/.techvar
-
 
22
 listval=!line 2 of $tmp
-
 
23
 numsess=!itemcnt $listval
13
!default mod_numsess=$numsess
24
 !default mod_numsess=$numsess
14
numsess=$mod_numsess
25
 !for i=1 to $numsess
-
 
26
   p=!positionof item $(listval[$i]) in $listcle
15
!for i=1 to $numsess
27
   !if $p!=$empty
16
   !for var in testoextra,nstud
28
    tdon=!line $p of $data
17
    !default up_$var$i=$($var$i)
29
    !default up_nstud$i=$(tdon[2])
18
    !set $var$i=$(up_$var$i)
30
    !default up_testoextra$i=$(tdon[3])
19
   !next var
31
   !endif
-
 
32
   nstud$i=$(up_nstud$i)
-
 
33
   testoextra$i=$(up_testoextra$i)
20
 !next i
34
 !next i
-
 
35
!else
21
!for var in testointro, namevar
36
 data=$empty
-
 
37
!endif
22
    !default up_$var=$($var)
38
!default up_testointro=!record 2 of $votedir/$vote.data
23
    !set $var=$(up_$var)
39
testointro=$up_testointro
24
!next var
-
 
25
 
40
 
26
!if $gstep=2
41
!if $gstep=2
27
!! need to check carefully namexevar vs. up_namevar (at some step we seem to
42
!! need to check carefully namexevar vs. up_namevar (at some step we seem to
28
!! be loosing the correction)(?? should this go outside the if $gstep=2)
43
!! be loosing the correction)(?? should this go outside the if $gstep=2)
29
 !bound up_namevar within $listlocalname
-
 
30
 !if $up_namevar=$empty and $namevar=$empty
44
 !if $up_namevar=$empty and $namevar=$empty
31
   error=bad_variable
45
   error=bad_variable
32
   gstep=1
46
   gstep=1
33
   !exit
47
   !exit
34
 !endif
48
 !endif
35
 !default namevar=$up_namevar
49
 !default namevar=$up_namevar
36
 !if $namevar=$empty
50
 !if $namevar=$empty
37
  error=no_variable
51
  error=no_variable
38
  gstep=1
52
  gstep=1
39
  !exit
53
  !exit
40
 !endif
54
 !endif
41
 !for dato in namevar
55
 !writefile $votedir/$vote.data :$namevar\
42
  !setdef $dato=$($dato) \
56
$data\
43
in  $votedir/$vote.data
-
 
44
 !next dato
57
:$testointro
45
!endif
58
!endif
46
 
59
 
47
!if $gstep>=2
60
!if $gstep>=2
48
!! get list of value for the technical variable :
61
!! get list of value for the technical variable :
49
 tmp=!positionof item $namevar in $tv_listname
62
 tmp=!positionof item $namevar in $tv_listname
Line 56... Line 69...
56
!if $gstep=3
69
!if $gstep=3
57
!!## need to check $testointro contains no vote primitives
70
!!## need to check $testointro contains no vote primitives
58
 !for i in uservar,menu,list,radio,checkbox,textarea
71
 !for i in uservar,menu,list,radio,checkbox,textarea
59
  !set testointro=!replace internal \$i by INVALID in $testointro
72
  !set testointro=!replace internal \$i by INVALID in $testointro
60
 !next i
73
 !next i
61
 !writefile $votedir/$vote.data
-
 
62
 
-
 
63
!!## with writefile we are loosing these variables at gstep=3
-
 
64
!for dato in numsess,namevar
-
 
65
  !appendfile $votedir/$vote.data $dato=$($dato)
-
 
66
!next dato
-
 
67
 
-
 
68
 donfile=$empty
74
 donfile=$namevar
69
 !for i=1 to $numsess
75
 !for i=1 to $numsess
70
!!## need to check no "," in testoextra
76
!!## need to check no "," in testoextra
71
  !set testoextra$i=!replace internal , by . in $(testoextra$i)
77
  testoextra$i=!replace internal , by . in $(testoextra$i)
72
  nstud$i=$[max(0,$(nstud$i))]
78
  nstud$i=$[max(0,$(nstud$i))]
73
  !if NaN isin $(nstud$i)
79
  !if NaN isin $(nstud$i)
74
    nstud$i=0
80
    nstud$i=0
75
  !endif
81
  !endif
76
  !for dato in nstud$i,testoextra$i
-
 
77
   donfile=!append line $dato=$($dato) to $donfile
82
  donfile=!append line $(listval[$i]),$(nstud$i),$(testoextra$i) to $donfile
78
  !next dato
-
 
79
!next i
83
 !next i
80
 !appendfile $votedir/$vote.data $donfile\
84
 !writefile $votedir/$vote.data :$donfile\
81
:$testointro
85
:$testointro
82
 
86
 
83
 reg_src=<div>\
87
 reg_src=<div>\
84
$testointro\
88
$testointro\
85
</div>\
89
</div>\