Subversion Repositories wimsdev

Rev

Rev 8674 | Rev 10922 | 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
8674 bpr 16
!for i_=1 to $totsheets
17
 !set f_=!line $i_ of $defaultformula
18
 !distribute word $f_ into w_$i_,s,ss
19
 !default w_$i_=1
7664 bpr 20
 !bound s between integer 0 and 6 default 2
21
 !bound ss between integer 0 and 2 default 0
8674 bpr 22
!!  f_$i_=!line $s+1 of max($$x$(ss)_,$$y_)\
7664 bpr 23
$$x$(ss)_\
24
$$x$(ss)_*$$y_^0.3\
25
$$x$(ss)_*$$y_^0.5\
26
$$x$(ss)_*$$y_\
27
$$x$(ss)_^2*$$y_\
28
($$x$(ss)_*$$y_)^2
29
 
8674 bpr 30
!set f_$i_=!record 0 of adm/class/sheetformula
31
!set f_$i_=!item $s+1 of $(f_$i_)
32
!set f_$i_=!replace internal I by I$ss in $(f_$i_)
33
 !if $i_ isitemof $activesh
34
  !set totweight=$[$totweight+$(w_$i_)]
20 reyssat 35
 !endif
8674 bpr 36
 !set s_$i_=$s
37
 !set ss_$i_=$ss
38
!next i_
20 reyssat 39
 
8674 bpr 40
!for i_=1 to $totexams
41
 !set ew_$i_=!line $i_ of $examweights
42
 !default ew_$i_=1
43
 !if $i_ isitemof $activexams
44
  !set totweight=$[$totweight+$(ew_$i_)]
20 reyssat 45
 !endif
8674 bpr 46
!next i_