Subversion Repositories wimsdev

Rev

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