Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
7612 bpr 1
# Variables x_ y_ z_ are defined before
2
# Variables used: defaultformula in adm/class/userlist/var.proc
3
# defaultformula=!line 2 to -1 of (record 0) of wimshome/log/classes/$wims_class/sheets/.severity
4
 
20 reyssat 5
# Output variables:
6
#
7
# f_$i: formula of sheet $i.
8
# w_$i: weight of sheet $i.
9
# s_$i: severity of $sheet $i.
10
# totweight: total sum of weights.
7612 bpr 11
# this formula must be calculated on some variables x_ and y_ or z_
20 reyssat 12
 
13
totweight=0
14
totsheets=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheets
15
totexams=!recordcnt wimshome/log/classes/$wims_class/exams/.exams
16
examweights=!record 0 of wimshome/log/classes/$wims_class/exams/.eseverity
17
!for i=1 to $totsheets
18
 f_=!line $i of $defaultformula
19
 !distribute word $f_ into w_$i,s
20
 !default w_$i=1
7612 bpr 21
 !bound s between integer 0 and 13 default 2
20 reyssat 22
 f_$i=!line $s+1 of max($$x_,$$y_)\
23
$$x_\
24
$$x_*$$y_^0.3\
25
$$x_*$$y_^0.5\
26
$$x_*$$y_\
27
$$x_^2*$$y_\
7612 bpr 28
($$x_*$$y_)^2\
29
max($$z_,$$y_)\
30
$$z_\
31
$$z_*$$y_^0.3\
32
$$z_*$$y_^0.5\
33
$$z_*$$y_\
34
$$z_^2*$$y_\
35
($$z_*$$y_)^2
20 reyssat 36
 !if $i isitemof $activesh
37
  totweight=$[$totweight+$(w_$i)]
38
 !endif
39
 s_$i=$s
40
!next i
41
 
42
!for i=1 to $totexams
43
 ew_$i=!line $i of $examweights
44
 !default ew_$i=1
45
 !if $i isitemof $activexams
46
  totweight=$[$totweight+$(ew_$i)]
47
 !endif
48
!next i
49