Rev 18144 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5181 | guerimand | 1 | !read adm/language lang/names.phtml |
5195 | guerimand | 2 | !read adm/levelname.phtml |
23 | reyssat | 3 | !if robot isin $wims_session |
15981 | bpr | 4 | error=bad_sheet |
5 | !exit |
||
23 | reyssat | 6 | !endif |
7 | |||
8 | wims_trustfile=primitives/target.phtml |
||
10305 | guerimand | 9 | wims_prefix=class user tmp techvar |
23 | reyssat | 10 | wims_prefix2=$wims_prefix |
1932 | bpr | 11 | !set wims_backslash_insmath=yes |
23 | reyssat | 12 | wims_nw=deps prcnt empty job class_header data\ |
14348 | bpr | 13 | imagedir Imagedir Class_header wims_prefix wims_prefix2 |
23 | reyssat | 14 | !default prcnt=0 |
4801 | guerimand | 15 | |
4808 | guerimand | 16 | authscoresuspend=!defof class_authscoresuspend in wimshome/log/classes/$wims_class/.def |
12863 | czzmrn | 17 | wims_class_exolog=!defof class_exolog in wimshome/log/classes/$wims_class/.def |
4808 | guerimand | 18 | !default authscoresuspend=yes |
4884 | guerimand | 19 | !setdef wims_authscoresuspend=$authscoresuspend in wimshome/sessions/$wims_session/var.stat |
7664 | bpr | 20 | !set severity=!record 0 of wimshome/log/classes/$wims_class/sheets/.severity |
21 | !set severity=!line $sh+1 of $severity |
||
11106 | bpr | 22 | !distribute words $severity into severity_w,severity_s,severity_ss |
23 | !set tmp=!defof DF_SEVERITY in wimshome/public_html/bases/sys/define.conf |
||
24 | !distribute words $tmp into tmp_w,tmp_s,tmp_ss |
||
25 | !bound severity_w between 0 and 100000 default $tmp_w |
||
26 | !bound severity_s between integer 0 and 6 default $tmp_s |
||
27 | !bound severity_ss between integer 0 and 2 default $tmp_ss |
||
28 | !reset tmp tmp_w tmp_s tmp_ss |
||
29 | !set severity=$severity_w,$severity_s,$severity_ss |
||
7664 | bpr | 30 | !setdef wims_severity=$severity in wimshome/sessions/$wims_session/var.stat |
4808 | guerimand | 31 | !if $authscoresuspend=yes |
12476 | bpr | 32 | !if $job=suspend |
33 | wims_scorereg=suspend |
||
4808 | guerimand | 34 | !endif |
12476 | bpr | 35 | !if $job=reopen |
36 | wims_scorereg=$empty |
||
37 | !endif |
||
38 | !if ($job=suspend or $job=reopen) and $exo!=$empty |
||
39 | !let limit=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$sh |
||
40 | !bound exo between 1 and $limit default 0 |
||
41 | !if $exo!=0 |
||
42 | !set ex=!record $exo of wimshome/log/classes/$wims_class/sheets/.sheet$sh |
||
43 | !distribute lines $ex into di,pa,require,we,ti,de |
||
44 | !setdef w_wims_scorereg=$wims_scorereg in wimshome/sessions/$wims_session/var |
||
45 | !restart module=$di&cmd=new&worksheet=$public$sh&$pa |
||
46 | !endif |
||
47 | !endif |
||
4808 | guerimand | 48 | !else |
12476 | bpr | 49 | wims_scorereg=$empty |
50 | !setdef w_wims_scorereg=$empty in wimshome/sessions/$wims_session/var |
||
23 | reyssat | 51 | !endif |
4801 | guerimand | 52 | |
1407 | bpr | 53 | !if $seq!= |
12476 | bpr | 54 | !set wims_sequence=$seq |
1407 | bpr | 55 | !endif |
23 | reyssat | 56 | |
57 | !bound job within read,raw,import,print default read |
||
58 | c=!char 1 of $sh |
||
59 | !if $c=P or $wims_class=$empty or / isin $sh |
||
12476 | bpr | 60 | public=P |
61 | !if $c=P |
||
62 | sh=!char 2 to -1 of $sh |
||
63 | !endif |
||
23 | reyssat | 64 | !endif |
65 | |||
66 | !if $job iswordof raw import and ($public!=P or $wims_user!=supervisor) |
||
12476 | bpr | 67 | job=read |
23 | reyssat | 68 | !endif |
69 | |||
70 | !if $public!=P |
||
12476 | bpr | 71 | !bound sh between integer 1 and 1024 default 0 |
7664 | bpr | 72 | |
12476 | bpr | 73 | !if $sh=0 |
18147 | bpr | 74 | :badsheet |
12476 | bpr | 75 | error=bad_sheet |
76 | !exit |
||
23 | reyssat | 77 | !endif |
12476 | bpr | 78 | data=wimshome/log/classes/$wims_class/sheets/.sheet$sh |
79 | sheet=!record $sh of wimshome/log/classes/$wims_class/sheets/.sheets |
||
15763 | guerimand | 80 | !distribute lines $sheet into sheet_active,sheet_expiration,sheet_title,sheet_desc,\ |
81 | sheet_docpage,sheet_comment,sheet_icone,sheet_exodesc,sheet_hidetechvar,sheet_indivtechvar |
||
82 | !! ------test if sheet is hidden for this user |
||
14441 | guerimand | 83 | !if $wims_user!=supervisor |
18147 | bpr | 84 | !set tmp_sheetstatus=!getsheetstatus sheet=$sh |
85 | !if $tmp_sheetstatus=3 |
||
86 | error=sheet_hidden |
||
87 | !exit |
||
14441 | guerimand | 88 | !endif |
89 | !endif |
||
15763 | guerimand | 90 | !! -----end test |
91 | !! ----- define individualisation with techvar |
||
92 | !if $sheet_indivtechvar!=$empty |
||
93 | !if $wims_user=supervisor |
||
94 | !if $techvarlistval=$empty |
||
95 | !readproc adm/vfilter/listvarfilter.proc |
||
96 | nb=!positionof item $sheet_indivtechvar in $tv_listcode |
||
97 | !if $nb!=$empty |
||
98 | don=!line $nb of $tv_listtechvar |
||
15963 | guerimand | 99 | !distribute item $don into nametechvar,classid,number |
100 | !if $sheet_active=0 |
||
101 | don=!record $number of wimshome/log/classes/$classid/.techvar |
||
102 | techvarlistval=!line 2 of $don |
||
103 | !else |
||
104 | don=!record $sh of wimshome/log/classes/$wims_class/sheets/.vars |
||
105 | techvarlistval=!word 3 to -1 of $don |
||
106 | techvarlistval=!words2items $techvarlistval |
||
107 | !endif |
||
15763 | guerimand | 108 | !else |
109 | techvarlistval=$empty |
||
110 | !endif |
||
111 | !endif |
||
112 | !bound choosevalue within EMPTY,$techvarlistval default EMPTY |
||
113 | !if $choosevalue=EMPTY |
||
114 | uservartechvalue=$empty |
||
115 | !else |
||
116 | uservartechvalue=$choosevalue |
||
15978 | guerimand | 117 | !endif |
15763 | guerimand | 118 | !else |
119 | !if / isin $wims_class |
||
120 | userclass=$wims_superclass |
||
121 | !else |
||
122 | userclass=$wims_class |
||
123 | !endif |
||
124 | uservartechvalue=!getdef user_techvar_$(sheet_indivtechvar) in wimshome/log/classes/$userclass/.users/$wims_user |
||
15963 | guerimand | 125 | don=!record $sh of wimshome/log/classes/$wims_class/sheets/.vars |
126 | techvarlistval=!word 3 to -1 of $don |
||
127 | techvarlistval=!words2items $techvarlistval |
||
128 | !bound uservartechvalue within $empty,$techvarlistval default $empty |
||
129 | !if $uservartechvalue!=$empty |
||
130 | !readproc adm/vfilter/listvarfilter.proc |
||
131 | nb=!positionof item $sheet_indivtechvar in $tv_listcode |
||
132 | don=!line $nb of $tv_listtechvar |
||
133 | !distribute item $don into nametechvar,classid,number |
||
134 | !endif |
||
15763 | guerimand | 135 | !endif |
136 | !endif |
||
137 | !! ----- end indiv |
||
12476 | bpr | 138 | !if $wims_user != supervisor and $sheet_active notin 12 |
15763 | guerimand | 139 | !distribute items $ into sheet_active,sheet_expiration,sheet_title,sheet_desc,\ |
140 | sheet_docpage,sheet_comment,sheet_icone,sheet_exodesc,sheet_hidetechvar,sheet_indivtechvar |
||
12476 | bpr | 141 | !if $job=print |
142 | job=read |
||
143 | !endif |
||
23 | reyssat | 144 | !endif |
12476 | bpr | 145 | sheet_docpage=!word 1 of $sheet_docpage |
16919 | guerimand | 146 | !if $sheet_docpage!=$empty and $sheet_docpage!=no |
147 | !if $sheet_docpage=yes |
||
148 | docdef=wimshome/log/classes/$wims_class/sheets/sheet$(sh).def |
||
149 | !else |
||
150 | test=!fileexists wimshome/log/classes/$wims_class/doc/$sheet_docpage.def |
||
151 | !if $test=yes |
||
152 | docdef=wimshome/log/classes/$wims_class/doc/$sheet_docpage.def |
||
153 | doctit=!getdef titb in $docdef |
||
154 | !else |
||
155 | sheet_docpage=no |
||
156 | !endif |
||
12476 | bpr | 157 | !endif |
158 | !endif |
||
159 | requires=!getscorerequire sheet=$sh |
||
16095 | guerimand | 160 | !if $sheet_active=0 |
161 | nb1=!wordcnt $requires |
||
162 | nb2=!recordcnt $data |
||
163 | !if $nb1!=$nb2 |
||
164 | !readproc adm/sheet/writeweights |
||
165 | requires=!getscorerequire sheet=$sh |
||
166 | !endif |
||
167 | !endif |
||
12476 | bpr | 168 | scores=!getscore sheet=$sh |
169 | means=!getscoremean sheet=$sh |
||
170 | bests=!getscorebest sheet=$sh |
||
171 | levels=!getscorelevel sheet=$sh |
||
12531 | bpr | 172 | alltries=!getscorealltries sheet=$sh |
12476 | bpr | 173 | !if $sheet_active=$empty |
174 | n=0 |
||
23 | reyssat | 175 | !else |
12476 | bpr | 176 | n=!recordcnt $data |
23 | reyssat | 177 | !endif |
12476 | bpr | 178 | !if $job=read and $n>0 |
179 | !read adm/mkdepsheet.proc $sh |
||
23 | reyssat | 180 | !endif |
12476 | bpr | 181 | exolog=!filelist $wims_home/$wims_sesdir/exolog.$sh.* |
182 | !else |
||
183 | dd=!record 0 of wimshome/$wims_sesdir/.sheets |
||
184 | !if / isin $sh |
||
185 | test=!positionof line $sh in $dd |
||
186 | !if $test=$empty |
||
187 | !appendfile wimshome/$wims_sesdir/.sheets $sh |
||
188 | shn=!linecnt $dd |
||
189 | !advance shn |
||
190 | !else |
||
191 | shn=!item 1 of $test |
||
192 | !endif |
||
193 | !else |
||
194 | !bound sh between integer 1 and 1024 default 0 |
||
195 | !if $sh=0 |
||
196 | !goto badsheet |
||
197 | !endif |
||
198 | shn=$sh |
||
199 | sh=!line $shn of $dd |
||
200 | sh=!trim $sh |
||
201 | !if $sh=$empty |
||
202 | !goto badsheet |
||
203 | !endif |
||
23 | reyssat | 204 | !endif |
12476 | bpr | 205 | data=wimshome/public_html/bases/sheet/$sh.def |
206 | sheet=!record 0 of $data |
||
207 | sheet=!trim $sheet |
||
208 | !distribute lines $sheet into sheet_title, sheet_desc, sheet_duration,\ |
||
209 | sheet_severity, sheet_level, sheet_domain, sheet_keywords |
||
210 | !!sheet_remark=!lines 10 to -1 of $sheet |
||
211 | !distribute words $sheet_duration into sheet_duration,sheet_year |
||
212 | sheet_active=1 |
||
213 | n=!recordcnt $data |
||
23 | reyssat | 214 | !endif |
4884 | guerimand | 215 | !!setdef wims_sheettitle=$sheet_title in wimshome/sessions/$wims_session/var.stat |
2865 | guerimand | 216 | maxexo=!recordcnt $data |
16022 | bpr | 217 | wims_listexo=!values v for v=1 to $maxexo |
218 | !setdef wims_listexo=$wims_listexo in wimshome/sessions/$wims_session/var.stat |
||
219 | !if $wims_class!=$empty |
||
220 | !reset wims_listexo |
||
221 | !endif |
||
4530 | bpr | 222 | !reset exofeedback |
223 | !for e=1 to $maxexo |
||
224 | redir=!record $e of wimshome/log/classes/$wims_class/sheets/.sheet$sh |
||
225 | redir=!line 9 of $redir |
||
14646 | bpr | 226 | !if $redir!=$empty |
227 | redir=[$redir] |
||
228 | !endif |
||
4530 | bpr | 229 | !if $e=1 |
230 | exofeedback=$redir |
||
231 | !else |
||
7664 | bpr | 232 | exofeedback=$exofeedback;$redir |
233 | !endif |
||
4530 | bpr | 234 | !next |
235 | !setdef wims_exofeedback=$exofeedback in wimshome/sessions/$wims_session/var.stat |
||
23 | reyssat | 236 | !if $job iswordof print import |
12476 | bpr | 237 | !read $job.proc |
23 | reyssat | 238 | !endif |