Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
7664 bpr 1
 
7612 bpr 2
# Variables used: defaultformula in adm/class/userlist/var.proc
8528 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
20 reyssat 16
!for i=1 to $totsheets
8528 bpr 17
 !set f_=!line $i of $defaultformula
7664 bpr 18
 !distribute word $f_ into w_$i,s,ss
20 reyssat 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
22
!!  f_$i=!line $s+1 of max($$x$(ss)_,$$y_)\
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
 
8528 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)
20 reyssat 33
 !if $i isitemof $activesh
8528 bpr 34
  !set totweight=$[$totweight+$(w_$i)]
20 reyssat 35
 !endif
8528 bpr 36
 !set s_$i=$s
37
 !set ss_$i=$ss
20 reyssat 38
!next i
39
 
40
!for i=1 to $totexams
8528 bpr 41
 !set ew_$i=!line $i of $examweights
20 reyssat 42
 !default ew_$i=1
43
 !if $i isitemof $activexams
8528 bpr 44
  !set totweight=$[$totweight+$(ew_$i)]
20 reyssat 45
 !endif
46
!next i