Rev 18144 | Blame | Compare with Previous | Last modification | View Log | RSS feed
!read adm/language lang/names.phtml
!read adm/levelname.phtml
!if robot isin $wims_session
error=bad_sheet
!exit
!endif
wims_trustfile=primitives/target.phtml
wims_prefix=class user tmp techvar
wims_prefix2=$wims_prefix
!set wims_backslash_insmath=yes
wims_nw=deps prcnt empty job class_header data\
imagedir Imagedir Class_header wims_prefix wims_prefix2
!default prcnt=0
authscoresuspend=!defof class_authscoresuspend in wimshome/log/classes/$wims_class/.def
wims_class_exolog=!defof class_exolog in wimshome/log/classes/$wims_class/.def
!default authscoresuspend=yes
!setdef wims_authscoresuspend=$authscoresuspend in wimshome/sessions/$wims_session/var.stat
!set severity=!record 0 of wimshome/log/classes/$wims_class/sheets/.severity
!set severity=!line $sh+1 of $severity
!distribute words $severity into severity_w,severity_s,severity_ss
!set tmp=!defof DF_SEVERITY in wimshome/public_html/bases/sys/define.conf
!distribute words $tmp into tmp_w,tmp_s,tmp_ss
!bound severity_w between 0 and 100000 default $tmp_w
!bound severity_s between integer 0 and 6 default $tmp_s
!bound severity_ss between integer 0 and 2 default $tmp_ss
!reset tmp tmp_w tmp_s tmp_ss
!set severity=$severity_w,$severity_s,$severity_ss
!setdef wims_severity=$severity in wimshome/sessions/$wims_session/var.stat
!if $authscoresuspend=yes
!if $job=suspend
wims_scorereg=suspend
!endif
!if $job=reopen
wims_scorereg=$empty
!endif
!if ($job=suspend or $job=reopen) and $exo!=$empty
!let limit=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$sh
!bound exo between 1 and $limit default 0
!if $exo!=0
!set ex=!record $exo of wimshome/log/classes/$wims_class/sheets/.sheet$sh
!distribute lines $ex into di,pa,require,we,ti,de
!setdef w_wims_scorereg=$wims_scorereg in wimshome/sessions/$wims_session/var
!restart module=$di&cmd=new&worksheet=$public$sh&$pa
!endif
!endif
!else
wims_scorereg=$empty
!setdef w_wims_scorereg=$empty in wimshome/sessions/$wims_session/var
!endif
!if $seq!=
!set wims_sequence=$seq
!endif
!bound job within read,raw,import,print default read
c=!char 1 of $sh
!if $c=P or $wims_class=$empty or / isin $sh
public=P
!if $c=P
sh=!char 2 to -1 of $sh
!endif
!endif
!if $job iswordof raw import and ($public!=P or $wims_user!=supervisor)
job=read
!endif
!if $public!=P
!bound sh between integer 1 and 1024 default 0
!if $sh=0
:badsheet
error=bad_sheet
!exit
!endif
data=wimshome/log/classes/$wims_class/sheets/.sheet$sh
sheet=!record $sh of wimshome/log/classes/$wims_class/sheets/.sheets
!distribute lines $sheet into sheet_active,sheet_expiration,sheet_title,sheet_desc,\
sheet_docpage,sheet_comment,sheet_icone,sheet_exodesc,sheet_hidetechvar,sheet_indivtechvar
!! ------test if sheet is hidden for this user
!if $wims_user!=supervisor
!set tmp_sheetstatus=!getsheetstatus sheet=$sh
!if $tmp_sheetstatus=3
error=sheet_hidden
!exit
!endif
!endif
!! -----end test
!! ----- define individualisation with techvar
!if $sheet_indivtechvar!=$empty
!if $wims_user=supervisor
!if $techvarlistval=$empty
!readproc adm/vfilter/listvarfilter.proc
nb=!positionof item $sheet_indivtechvar in $tv_listcode
!if $nb!=$empty
don=!line $nb of $tv_listtechvar
!distribute item $don into nametechvar,classid,number
!if $sheet_active=0
don=!record $number of wimshome/log/classes/$classid/.techvar
techvarlistval=!line 2 of $don
!else
don=!record $sh of wimshome/log/classes/$wims_class/sheets/.vars
techvarlistval=!word 3 to -1 of $don
techvarlistval=!words2items $techvarlistval
!endif
!else
techvarlistval=$empty
!endif
!endif
!bound choosevalue within EMPTY,$techvarlistval default EMPTY
!if $choosevalue=EMPTY
uservartechvalue=$empty
!else
uservartechvalue=$choosevalue
!endif
!else
!if / isin $wims_class
userclass=$wims_superclass
!else
userclass=$wims_class
!endif
uservartechvalue=!getdef user_techvar_$(sheet_indivtechvar) in wimshome/log/classes/$userclass/.users/$wims_user
don=!record $sh of wimshome/log/classes/$wims_class/sheets/.vars
techvarlistval=!word 3 to -1 of $don
techvarlistval=!words2items $techvarlistval
!bound uservartechvalue within $empty,$techvarlistval default $empty
!if $uservartechvalue!=$empty
!readproc adm/vfilter/listvarfilter.proc
nb=!positionof item $sheet_indivtechvar in $tv_listcode
don=!line $nb of $tv_listtechvar
!distribute item $don into nametechvar,classid,number
!endif
!endif
!endif
!! ----- end indiv
!if $wims_user != supervisor and $sheet_active notin 12
!distribute items $ into sheet_active,sheet_expiration,sheet_title,sheet_desc,\
sheet_docpage,sheet_comment,sheet_icone,sheet_exodesc,sheet_hidetechvar,sheet_indivtechvar
!if $job=print
job=read
!endif
!endif
sheet_docpage=!word 1 of $sheet_docpage
!if $sheet_docpage!=$empty and $sheet_docpage!=no
!if $sheet_docpage=yes
docdef=wimshome/log/classes/$wims_class/sheets/sheet$(sh).def
!else
test=!fileexists wimshome/log/classes/$wims_class/doc/$sheet_docpage.def
!if $test=yes
docdef=wimshome/log/classes/$wims_class/doc/$sheet_docpage.def
doctit=!getdef titb in $docdef
!else
sheet_docpage=no
!endif
!endif
!endif
requires=!getscorerequire sheet=$sh
!if $sheet_active=0
nb1=!wordcnt $requires
nb2=!recordcnt $data
!if $nb1!=$nb2
!readproc adm/sheet/writeweights
requires=!getscorerequire sheet=$sh
!endif
!endif
scores=!getscore sheet=$sh
means=!getscoremean sheet=$sh
bests=!getscorebest sheet=$sh
levels=!getscorelevel sheet=$sh
alltries=!getscorealltries sheet=$sh
!if $sheet_active=$empty
n=0
!else
n=!recordcnt $data
!endif
!if $job=read and $n>0
!read adm/mkdepsheet.proc $sh
!endif
exolog=!filelist $wims_home/$wims_sesdir/exolog.$sh.*
!else
dd=!record 0 of wimshome/$wims_sesdir/.sheets
!if / isin $sh
test=!positionof line $sh in $dd
!if $test=$empty
!appendfile wimshome/$wims_sesdir/.sheets $sh
shn=!linecnt $dd
!advance shn
!else
shn=!item 1 of $test
!endif
!else
!bound sh between integer 1 and 1024 default 0
!if $sh=0
!goto badsheet
!endif
shn=$sh
sh=!line $shn of $dd
sh=!trim $sh
!if $sh=$empty
!goto badsheet
!endif
!endif
data=wimshome/public_html/bases/sheet/$sh.def
sheet=!record 0 of $data
sheet=!trim $sheet
!distribute lines $sheet into sheet_title, sheet_desc, sheet_duration,\
sheet_severity, sheet_level, sheet_domain, sheet_keywords
!!sheet_remark=!lines 10 to -1 of $sheet
!distribute words $sheet_duration into sheet_duration,sheet_year
sheet_active=1
n=!recordcnt $data
!endif
!!setdef wims_sheettitle=$sheet_title in wimshome/sessions/$wims_session/var.stat
maxexo=!recordcnt $data
wims_listexo=!values v for v=1 to $maxexo
!setdef wims_listexo=$wims_listexo in wimshome/sessions/$wims_session/var.stat
!if $wims_class!=$empty
!reset wims_listexo
!endif
!reset exofeedback
!for e=1 to $maxexo
redir=!record $e of wimshome/log/classes/$wims_class/sheets/.sheet$sh
redir=!line 9 of $redir
!if $redir!=$empty
redir=[$redir]
!endif
!if $e=1
exofeedback=$redir
!else
exofeedback=$exofeedback;$redir
!endif
!next
!setdef wims_exofeedback=$exofeedback in wimshome/sessions/$wims_session/var.stat
!if $job iswordof print import
!read $job.proc
!endif