Subversion Repositories wimsdev

Rev

Rev 7363 | Rev 7664 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

# Variables x_ y_ z_ are defined before
# Variables used: defaultformula in adm/class/userlist/var.proc
# defaultformula=!line 2 to -1 of (record 0) of wimshome/log/classes/$wims_class/sheets/.severity

# Output variables:
#
# f_$i: formula of sheet $i.
# w_$i: weight of sheet $i.
# s_$i: severity of $sheet $i.
# totweight: total sum of weights.
# this formula must be calculated on some variables x_ and y_ or z_

totweight=0
totsheets=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheets
totexams=!recordcnt wimshome/log/classes/$wims_class/exams/.exams
examweights=!record 0 of wimshome/log/classes/$wims_class/exams/.eseverity
!for i=1 to $totsheets
 f_=!line $i of $defaultformula
 !distribute word $f_ into w_$i,s
 !default w_$i=1
 !bound s between integer 0 and 13 default 2
 f_$i=!line $s+1 of max($$x_,$$y_)\
$$x_\
$$x_*$$y_^0.3\
$$x_*$$y_^0.5\
$$x_*$$y_\
$$x_^2*$$y_\
($$x_*$$y_)^2\
max($$z_,$$y_)\
$$z_\
$$z_*$$y_^0.3\
$$z_*$$y_^0.5\
$$z_*$$y_\
$$z_^2*$$y_\
($$z_*$$y_)^2
 !if $i isitemof $activesh
  totweight=$[$totweight+$(w_$i)]
 !endif
 s_$i=$s
!next i

!for i=1 to $totexams
 ew_$i=!line $i of $examweights
 !default ew_$i=1
 !if $i isitemof $activexams
  totweight=$[$totweight+$(ew_$i)]
 !endif
!next i