Subversion Repositories wimsdev

Rev

Rev 7612 | Rev 8528 | 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
7664 bpr 3
# defaultformula in  wimshome/log/classes/$wims_class/sheets/.severity
7612 bpr 4
 
20 reyssat 5
# Output variables:
6
#
7
# f_$i: formula of sheet $i.
8
# w_$i: weight of sheet $i.
9
# totweight: total sum of weights.
10
 
11
totweight=0
12
totsheets=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheets
13
totexams=!recordcnt wimshome/log/classes/$wims_class/exams/.exams
14
examweights=!record 0 of wimshome/log/classes/$wims_class/exams/.eseverity
7664 bpr 15
formula_list=!record 0 of adm/class/sheetformula
20 reyssat 16
!for i=1 to $totsheets
17
 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
 
30
f_$i=!record 0 of adm/class/sheetformula
31
f_$i=!item $s+1 of $(f_$i)
32
f_$i=!replace internal I by I$ss in $(f_$i)
20 reyssat 33
 !if $i isitemof $activesh
34
  totweight=$[$totweight+$(w_$i)]
35
 !endif
36
 s_$i=$s
7664 bpr 37
 ss_$i=$ss
20 reyssat 38
!next i
39
 
40
!for i=1 to $totexams
41
 ew_$i=!line $i of $examweights
42
 !default ew_$i=1
43
 !if $i isitemof $activexams
44
  totweight=$[$totweight+$(ew_$i)]
45
 !endif
46
!next i
47