Subversion Repositories wimsdev

Rev

Rev 18127 | Go to most recent revision | 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
74
    :badsheet
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
15763 guerimand 84
    !if $sheet_hidetechvar!=$empty
18144 bpr 85
      !readproc adm/vfilter/ishiddensheet.proc $sheet_hidetechvar
86
      !if $hidden_sheet=1
14441 guerimand 87
        error=sheet_hidden
88
        !exit
89
      !endif
90
    !endif
91
  !endif
15763 guerimand 92
!! -----end test
93
!! ----- define individualisation with techvar
94
  !if $sheet_indivtechvar!=$empty
95
    !if $wims_user=supervisor
96
      !if $techvarlistval=$empty
97
        !readproc adm/vfilter/listvarfilter.proc
98
        nb=!positionof item $sheet_indivtechvar in $tv_listcode
99
        !if $nb!=$empty
100
          don=!line $nb of $tv_listtechvar
15963 guerimand 101
          !distribute item $don into nametechvar,classid,number
102
          !if $sheet_active=0
103
            don=!record $number of wimshome/log/classes/$classid/.techvar
104
            techvarlistval=!line 2 of $don
105
          !else
106
            don=!record $sh of wimshome/log/classes/$wims_class/sheets/.vars
107
            techvarlistval=!word 3 to -1 of $don
108
            techvarlistval=!words2items $techvarlistval
109
          !endif
15763 guerimand 110
        !else
111
          techvarlistval=$empty
112
        !endif
113
      !endif
114
      !bound choosevalue within EMPTY,$techvarlistval default EMPTY
115
      !if $choosevalue=EMPTY
116
        uservartechvalue=$empty
117
      !else
118
         uservartechvalue=$choosevalue
15978 guerimand 119
      !endif
15763 guerimand 120
    !else
121
      !if / isin $wims_class
122
        userclass=$wims_superclass
123
      !else
124
        userclass=$wims_class
125
      !endif
126
      uservartechvalue=!getdef user_techvar_$(sheet_indivtechvar) in wimshome/log/classes/$userclass/.users/$wims_user
15963 guerimand 127
      don=!record $sh of wimshome/log/classes/$wims_class/sheets/.vars
128
      techvarlistval=!word 3 to -1 of $don
129
      techvarlistval=!words2items $techvarlistval
130
      !bound uservartechvalue within $empty,$techvarlistval default $empty
131
      !if $uservartechvalue!=$empty
132
        !readproc adm/vfilter/listvarfilter.proc
133
        nb=!positionof item $sheet_indivtechvar in $tv_listcode
134
        don=!line $nb of $tv_listtechvar
135
        !distribute item $don into nametechvar,classid,number
136
      !endif
15763 guerimand 137
    !endif
138
  !endif
139
!! ----- end indiv
12476 bpr 140
  !if $wims_user != supervisor and $sheet_active notin 12
15763 guerimand 141
    !distribute items $ into sheet_active,sheet_expiration,sheet_title,sheet_desc,\
142
   sheet_docpage,sheet_comment,sheet_icone,sheet_exodesc,sheet_hidetechvar,sheet_indivtechvar
12476 bpr 143
    !if $job=print
144
      job=read
145
    !endif
23 reyssat 146
  !endif
12476 bpr 147
  sheet_docpage=!word 1 of $sheet_docpage
16919 guerimand 148
  !if $sheet_docpage!=$empty and $sheet_docpage!=no
149
    !if $sheet_docpage=yes
150
      docdef=wimshome/log/classes/$wims_class/sheets/sheet$(sh).def
151
    !else
152
      test=!fileexists wimshome/log/classes/$wims_class/doc/$sheet_docpage.def
153
      !if $test=yes
154
        docdef=wimshome/log/classes/$wims_class/doc/$sheet_docpage.def
155
        doctit=!getdef titb in $docdef
156
      !else
157
        sheet_docpage=no
158
      !endif
12476 bpr 159
    !endif
160
  !endif
161
  requires=!getscorerequire sheet=$sh
16095 guerimand 162
  !if $sheet_active=0
163
    nb1=!wordcnt $requires
164
    nb2=!recordcnt $data
165
    !if $nb1!=$nb2
166
      !readproc adm/sheet/writeweights
167
      requires=!getscorerequire sheet=$sh
168
    !endif
169
  !endif
12476 bpr 170
  scores=!getscore sheet=$sh
171
  means=!getscoremean sheet=$sh
172
  bests=!getscorebest sheet=$sh
173
  levels=!getscorelevel sheet=$sh
12531 bpr 174
  alltries=!getscorealltries sheet=$sh
12476 bpr 175
  !if $sheet_active=$empty
176
    n=0
23 reyssat 177
  !else
12476 bpr 178
    n=!recordcnt $data
23 reyssat 179
  !endif
12476 bpr 180
  !if $job=read and $n>0
181
    !read adm/mkdepsheet.proc $sh
23 reyssat 182
  !endif
12476 bpr 183
  exolog=!filelist $wims_home/$wims_sesdir/exolog.$sh.*
184
!else
185
  dd=!record 0 of wimshome/$wims_sesdir/.sheets
186
  !if / isin $sh
187
    test=!positionof line $sh in $dd
188
    !if $test=$empty
189
      !appendfile wimshome/$wims_sesdir/.sheets $sh
190
      shn=!linecnt $dd
191
      !advance shn
192
    !else
193
      shn=!item 1 of $test
194
    !endif
195
  !else
196
    !bound sh between integer 1 and 1024 default 0
197
    !if $sh=0
198
      !goto badsheet
199
    !endif
200
    shn=$sh
201
    sh=!line $shn of $dd
202
    sh=!trim $sh
203
    !if $sh=$empty
204
      !goto badsheet
205
    !endif
23 reyssat 206
  !endif
12476 bpr 207
  data=wimshome/public_html/bases/sheet/$sh.def
208
  sheet=!record 0 of $data
209
  sheet=!trim $sheet
210
  !distribute lines $sheet into sheet_title, sheet_desc, sheet_duration,\
211
    sheet_severity, sheet_level, sheet_domain, sheet_keywords
212
  !!sheet_remark=!lines 10 to -1 of $sheet
213
  !distribute words $sheet_duration into sheet_duration,sheet_year
214
  sheet_active=1
215
  n=!recordcnt $data
23 reyssat 216
!endif
4884 guerimand 217
!!setdef wims_sheettitle=$sheet_title in wimshome/sessions/$wims_session/var.stat
2865 guerimand 218
maxexo=!recordcnt $data
16022 bpr 219
wims_listexo=!values v for v=1 to $maxexo
220
!setdef wims_listexo=$wims_listexo in wimshome/sessions/$wims_session/var.stat
221
!if $wims_class!=$empty
222
  !reset wims_listexo
223
!endif
4530 bpr 224
!reset exofeedback
225
!for e=1 to $maxexo
226
  redir=!record $e of wimshome/log/classes/$wims_class/sheets/.sheet$sh
227
  redir=!line 9 of $redir
14646 bpr 228
  !if $redir!=$empty
229
    redir=[$redir]
230
  !endif
4530 bpr 231
  !if $e=1
232
    exofeedback=$redir
233
  !else
7664 bpr 234
    exofeedback=$exofeedback;$redir
235
  !endif
4530 bpr 236
!next
237
!setdef wims_exofeedback=$exofeedback in wimshome/sessions/$wims_session/var.stat
23 reyssat 238
!if $job iswordof print import
12476 bpr 239
  !read $job.proc
23 reyssat 240
!endif