Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
7664 bpr 1
 
9206 bpr 2
# Variables used: defaultformula in adm/class/userscore/var.proc
8674 bpr 3
!! defaultformula in wimshome/log/classes/$wims_class/sheets/.severity
7612 bpr 4
 
8528 bpr 5
!! Output variables:
6
!!
7
!! f_$i: formula of sheet $i.
8
!! w_$i: weight of sheet $i.
9
!! totweight: total sum of weights.
20 reyssat 10
 
8528 bpr 11
!set totweight=0
12
!set totsheets=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheets
13
!set totexams=!recordcnt wimshome/log/classes/$wims_class/exams/.exams
14
!set examweights=!record 0 of wimshome/log/classes/$wims_class/exams/.eseverity
15
!set formula_list=!record 0 of adm/class/sheetformula
10922 bpr 16
!set tmp=!defof DF_SEVERITY in wimshome/public_html/bases/sys/define.conf
11105 bpr 17
!distribute words $tmp into tmp_w,tmp_s,tmp_ss
8674 bpr 18
!for i_=1 to $totsheets
19
 !set f_=!line $i_ of $defaultformula
20
 !distribute word $f_ into w_$i_,s,ss
11105 bpr 21
 !bound w_$i_ between integer 0 and 100000 default $tmp_w
10922 bpr 22
 !bound s between integer 0 and 6 default $tmp_s
23
 !bound ss between integer 0 and 2 default $tmp_ss
8674 bpr 24
!!  f_$i_=!line $s+1 of max($$x$(ss)_,$$y_)\
7664 bpr 25
$$x$(ss)_\
26
$$x$(ss)_*$$y_^0.3\
27
$$x$(ss)_*$$y_^0.5\
28
$$x$(ss)_*$$y_\
29
$$x$(ss)_^2*$$y_\
30
($$x$(ss)_*$$y_)^2
31
 
8674 bpr 32
!set f_$i_=!record 0 of adm/class/sheetformula
33
!set f_$i_=!item $s+1 of $(f_$i_)
34
!set f_$i_=!replace internal I by I$ss in $(f_$i_)
35
 !if $i_ isitemof $activesh
36
  !set totweight=$[$totweight+$(w_$i_)]
20 reyssat 37
 !endif
8674 bpr 38
 !set s_$i_=$s
39
 !set ss_$i_=$ss
40
!next i_
20 reyssat 41
 
8674 bpr 42
!for i_=1 to $totexams
43
 !set ew_$i_=!line $i_ of $examweights
44
 !default ew_$i_=1
45
 !if $i_ isitemof $activexams
46
  !set totweight=$[$totweight+$(ew_$i_)]
20 reyssat 47
 !endif
8674 bpr 48
!next i_
11105 bpr 49
 
50
!reset tmp tmp_s tmp_ss tmp_w