Rev 7198 | Rev 10241 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7198 | Rev 10233 | ||
---|---|---|---|
Line 1... | Line -... | ||
1 | - | ||
2 | - | ||
3 | today=!char 1 to 8 of $wims_now |
1 | today=!char 1 to 8 of $wims_now |
4 | thisyear=!char 1 to 4 of $today |
2 | thisyear=!char 1 to 4 of $today |
5 | !if $class_expiration=$empty |
3 | !if $class_expiration=$empty |
6 | !defread wimshome/log/classes/$wims_class/.def |
4 | !defread wimshome/log/classes/$wims_class/.def |
7 | !endif |
5 | !endif |
8 | !if $class_expiration=$empty |
6 | !if $class_expiration=$empty |
9 | error=bad_class |
7 | error=bad_class |
10 | !exit |
8 | !exit |
Line 13... | Line 11... | ||
13 | !readdef $votedir/$vote.data |
11 | !readdef $votedir/$vote.data |
14 | !default testointro=!record 1 of $votedir/$vote.data |
12 | !default testointro=!record 1 of $votedir/$vote.data |
15 | !default mod_numsess=$numsess |
13 | !default mod_numsess=$numsess |
16 | numsess=$mod_numsess |
14 | numsess=$mod_numsess |
17 | !for i=1 to $numsess |
15 | !for i=1 to $numsess |
18 | !for var in |
16 | !for var in testoextra,nstud |
19 | !default up_$var$i=$($var$i) |
17 | !default up_$var$i=$($var$i) |
20 | !set $var$i=$(up_$var$i) |
18 | !set $var$i=$(up_$var$i) |
21 | !next |
19 | !next var |
22 | !next |
20 | !next i |
23 | !for var in testointro, |
21 | !for var in testointro, namevar |
24 | !default up_$var=$($var) |
22 | !default up_$var=$($var) |
25 | !set $var=$(up_$var) |
23 | !set $var=$(up_$var) |
26 | !next |
24 | !next var |
27 | 25 | ||
28 | !if $gstep=2 |
26 | !if $gstep=2 |
29 | !! need to check carefully namexevar vs. up_namevar (at some step we seem to |
27 | !! need to check carefully namexevar vs. up_namevar (at some step we seem to |
30 | !! be loosing the correction)(?? should this go outside the if $gstep=2) |
28 | !! be loosing the correction)(?? should this go outside the if $gstep=2) |
31 | !read adm/class/authchars |
- | |
32 | - | ||
33 | !default namevar=$up_namevar |
- | |
34 |
|
29 | !bound up_namevar within $listlocalname |
35 |
|
30 | !if $up_namevar=$empty and $namevar=$empty |
36 | !set namevar=!text select $char_alnum in $namevar |
- | |
37 | !!## some words are forbidden. Should be more precise |
- | |
38 | test_=$namevar |
- | |
39 | !for w in exam, sheet, manual |
- | |
40 | !set test_=!replace internal __$w by in __$test_ |
- | |
41 | !next |
- | |
42 | test_=!text remove 0123456789_ in $test_ |
- | |
43 | !if $test_=$empty |
- | |
44 | error=bad_variable |
31 | error=bad_variable |
- | 32 | gstep=1 |
|
- | 33 | !exit |
|
45 | !endif |
34 | !endif |
- | 35 | !default namevar=$up_namevar |
|
46 | !if $namevar=$empty |
36 | !if $namevar=$empty |
47 | error=no_variable |
37 | error=no_variable |
- | 38 | gstep=1 |
|
- | 39 | !exit |
|
48 | !endif |
40 | !endif |
49 | !if $error!=$empty |
- | |
50 | gstep=$[max(0,$gstep-1)] |
- | |
51 | !exit |
- | |
52 | !endif |
- | |
53 |
|
41 | !! get system id of the techvar |
54 | !for dato in |
42 | !for dato in namevar |
55 | !setdef $dato=$($dato) \ |
43 | !setdef $dato=$($dato) \ |
56 |
|
44 | in $votedir/$vote.data |
57 | !next |
45 | !next dato |
58 | !endif |
46 | !endif |
- | 47 | ||
- | 48 | !if $gstep>=2 |
|
- | 49 | !! get list of value for the technical variable : |
|
- | 50 | tmp=!positionof item $namevar in $tv_listname |
|
- | 51 | tmp=!line $tmp of $tv_listtechvar |
|
- | 52 | tmp=!record $(tmp[3]) of wimshome/log/classes/$wims_class/.techvar |
|
- | 53 | listval=!line 2 of $tmp |
|
- | 54 | numsess=!itemcnt $listval |
|
- | 55 | !endif |
|
- | 56 | ||
- | 57 | !if $gstep=3 |
|
- | 58 | !!## need to check $testointro contains no vote primitives |
|
- | 59 | !for i in uservar,menu,list,radio,checkbox,textarea |
|
- | 60 | !set testointro=!replace internal \$i by INVALID in $testointro |
|
- | 61 | !next i |
|
- | 62 | !writefile $votedir/$vote.data |
|
- | 63 | ||
- | 64 | !!## with writefile we are loosing these variables at gstep=3 |
|
- | 65 | !for dato in numsess,namevar |
|
- | 66 | !appendfile $votedir/$vote.data $dato=$($dato) |
|
- | 67 | !next dato |
|
- | 68 | ||
- | 69 | donfile=$empty |
|
- | 70 | !for i=1 to $numsess |
|
- | 71 | !!## need to check no "," in testoextra |
|
- | 72 | !set testoextra$i=!replace internal , by . in $(testoextra$i) |
|
- | 73 | nstud$i=$[max(0,$(nstud$i))] |
|
- | 74 | !if NaN isin $(nstud$i) |
|
- | 75 | nstud$i=0 |
|
- | 76 | !endif |
|
- | 77 | !for dato in nstud$i,testoextra$i |
|
- | 78 | donfile=!append line $dato=$($dato) to $donfile |
|
- | 79 | !next dato |
|
- | 80 | !next i |
|
- | 81 | !appendfile $votedir/$vote.data $donfile\ |
|
- | 82 | :$testointro |
|
- | 83 | ||
- | 84 | reg_src=<div>\ |
|
- | 85 | $testointro\ |
|
- | 86 | </div>\ |
|
- | 87 | \list{ |
|
- | 88 | ||
- | 89 | reg_src1=$reg_src |
|
- | 90 | reg_src2=\uservar{$namevar,$empty, |
|
- | 91 | !for i=1 to $numsess |
|
- | 92 | reg_src1=$reg_src1\ |
|
- | 93 | $(nstud$i): $(testoextra$i), |
|
- | 94 | reg_src2=$reg_src2\ |
|
- | 95 | $(listval[$i]), |
|
- | 96 | !next i |
|
- | 97 | reg_src=$reg_src1\ |
|
- | 98 | $name_cancellation\ |
|
- | 99 | }\ |
|
- | 100 | $reg_src2\ |
|
- | 101 | $empty\ |
|
- | 102 | } |
|
- | 103 | ||
- | 104 | !endif |
|
- | 105 |