Subversion Repositories wimsdev

Rev

Rev 20 | Rev 7612 | Go to most recent revision | Details | Compare with Previous | 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.
7363 bpr 7
# this formula must be calculated on some variables x_ and y_
20 reyssat 8
 
9
totweight=0
10
totsheets=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheets
11
totexams=!recordcnt wimshome/log/classes/$wims_class/exams/.exams
12
examweights=!record 0 of wimshome/log/classes/$wims_class/exams/.eseverity
13
!for i=1 to $totsheets
14
 f_=!line $i of $defaultformula
15
 !distribute word $f_ into w_$i,s
16
 !default w_$i=1
17
 !bound s between integer 0 and 6 default 2
18
 f_$i=!line $s+1 of max($$x_,$$y_)\
19
$$x_\
20
$$x_*$$y_^0.3\
21
$$x_*$$y_^0.5\
22
$$x_*$$y_\
23
$$x_^2*$$y_\
24
($$x_*$$y_)^2
25
 !if $i isitemof $activesh
26
  totweight=$[$totweight+$(w_$i)]
27
 !endif
28
 s_$i=$s
29
!next i
30
 
31
!for i=1 to $totexams
32
 ew_$i=!line $i of $examweights
33
 !default ew_$i=1
34
 !if $i isitemof $activexams
35
  totweight=$[$totweight+$(ew_$i)]
36
 !endif
37
!next i
38