Subversion Repositories wimsdev

Rev

Rev 15981 | Rev 16095 | 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
85
      !readproc adm/vfilter/ishiddensheet.proc $sheet_hidetechvar
14441 guerimand 86
      !if $hidden_sheet=1
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
148
  !if $sheet_docpage!=$empty
149
    docdef=wimshome/log/classes/$wims_class/doc/$sheet_docpage.def
150
    doctit=!getdef titb in $docdef
151
    !if $doctit=$empty
152
     !reset docdef sheet_docpage
153
    !endif
154
  !endif
155
  requires=!getscorerequire sheet=$sh
156
  scores=!getscore sheet=$sh
157
  means=!getscoremean sheet=$sh
158
  bests=!getscorebest sheet=$sh
159
  levels=!getscorelevel sheet=$sh
12531 bpr 160
  alltries=!getscorealltries sheet=$sh
12476 bpr 161
  !if $sheet_active=$empty
162
    n=0
23 reyssat 163
  !else
12476 bpr 164
    n=!recordcnt $data
23 reyssat 165
  !endif
12476 bpr 166
  !if $job=read and $n>0
167
    !read adm/mkdepsheet.proc $sh
23 reyssat 168
  !endif
12476 bpr 169
  exolog=!filelist $wims_home/$wims_sesdir/exolog.$sh.*
170
!else
171
  dd=!record 0 of wimshome/$wims_sesdir/.sheets
172
  !if / isin $sh
173
    test=!positionof line $sh in $dd
174
    !if $test=$empty
175
      !appendfile wimshome/$wims_sesdir/.sheets $sh
176
      shn=!linecnt $dd
177
      !advance shn
178
    !else
179
      shn=!item 1 of $test
180
    !endif
181
  !else
182
    !bound sh between integer 1 and 1024 default 0
183
    !if $sh=0
184
      !goto badsheet
185
    !endif
186
    shn=$sh
187
    sh=!line $shn of $dd
188
    sh=!trim $sh
189
    !if $sh=$empty
190
      !goto badsheet
191
    !endif
23 reyssat 192
  !endif
12476 bpr 193
  data=wimshome/public_html/bases/sheet/$sh.def
194
  sheet=!record 0 of $data
195
  sheet=!trim $sheet
196
  !distribute lines $sheet into sheet_title, sheet_desc, sheet_duration,\
197
    sheet_severity, sheet_level, sheet_domain, sheet_keywords
198
  !!sheet_remark=!lines 10 to -1 of $sheet
199
  !distribute words $sheet_duration into sheet_duration,sheet_year
200
  sheet_active=1
201
  n=!recordcnt $data
23 reyssat 202
!endif
4884 guerimand 203
!!setdef wims_sheettitle=$sheet_title in wimshome/sessions/$wims_session/var.stat
2865 guerimand 204
maxexo=!recordcnt $data
16022 bpr 205
wims_listexo=!values v for v=1 to $maxexo
206
!setdef wims_listexo=$wims_listexo in wimshome/sessions/$wims_session/var.stat
207
!if $wims_class!=$empty
208
  !reset wims_listexo
209
!endif
4530 bpr 210
!reset exofeedback
211
!for e=1 to $maxexo
212
  redir=!record $e of wimshome/log/classes/$wims_class/sheets/.sheet$sh
213
  redir=!line 9 of $redir
14646 bpr 214
  !if $redir!=$empty
215
    redir=[$redir]
216
  !endif
4530 bpr 217
  !if $e=1
218
    exofeedback=$redir
219
  !else
7664 bpr 220
    exofeedback=$exofeedback;$redir
221
  !endif
4530 bpr 222
!next
223
!setdef wims_exofeedback=$exofeedback in wimshome/sessions/$wims_session/var.stat
23 reyssat 224
!if $job iswordof print import
12476 bpr 225
  !read $job.proc
23 reyssat 226
!endif