Subversion Repositories wimsdev

Rev

Rev 7363 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
20 reyssat 1
# Output variables:
2
#
3
# f_$i: formula of sheet $i.
4
# w_$i: weight of sheet $i.
5
# s_$i: severity of $sheet $i.
6
# totweight: total sum of weights.
7
 
8
totweight=0
9
totsheets=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheets
10
totexams=!recordcnt wimshome/log/classes/$wims_class/exams/.exams
11
examweights=!record 0 of wimshome/log/classes/$wims_class/exams/.eseverity
12
!for i=1 to $totsheets
13
 f_=!line $i of $defaultformula
14
 !distribute word $f_ into w_$i,s
15
 !default w_$i=1
16
 !bound s between integer 0 and 6 default 2
17
 f_$i=!line $s+1 of max($$x_,$$y_)\
18
$$x_\
19
$$x_*$$y_^0.3\
20
$$x_*$$y_^0.5\
21
$$x_*$$y_\
22
$$x_^2*$$y_\
23
($$x_*$$y_)^2
24
 !if $i isitemof $activesh
25
  totweight=$[$totweight+$(w_$i)]
26
 !endif
27
 s_$i=$s
28
!next i
29
 
30
!for i=1 to $totexams
31
 ew_$i=!line $i of $examweights
32
 !default ew_$i=1
33
 !if $i isitemof $activexams
34
  totweight=$[$totweight+$(ew_$i)]
35
 !endif
36
!next i
37