Subversion Repositories wimsdev

Rev

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

# 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.

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 6 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
 !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