File: userscore

package info (click to toggle)
wims 2%3A4.29a%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 185,704 kB
  • sloc: xml: 366,687; javascript: 120,570; ansic: 62,341; java: 62,170; sh: 7,744; perl: 3,937; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (64 lines) | stat: -rw-r--r-- 1,667 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
!default uu=$wims_read_parm
!!one line by sheet : points quality best level
percents=!getscorepercent user=$uu
!if $showsheet=$empty
  shlist=$activesh
  exlist=$activexams
!else
  shlist=$showsheet
  shlist=!listintersect $activesh and $shlist
  exlist=!items2lines $showsheet
  exlist=!replace internal E by E, in $exlist
  exlist=!select $exlist where column 1=E
  exlist=$(exlist[;2])
  exlist=!listintersect $activexams and $exlist
!endif

!distribute items 0,0 into per,av

!! w_$i etc are defined in sheetweights
!! give an average for all active sheets (or in showsheet) and for the user $uu
!! - even not seen in sequences ??

!for i in $shlist
  !if $(f_$i)=$empty or $(w_$i)=$empty
    !read adm/class/sheetweights
  !endif
  perc=!line $i of $percents
  !distribute words $perc into p1,p2,p3,p4
  !if $p2!=$empty and $(w_$i)!=$empty
    !distribute item $[$p1/100],$[$p2/10],$[$p3/100],$[$p4/100] into x0_,y_,x1_,x2_
    !set ff_$i=!mathsubst Q=$y_ in $(f_$i)
    !for sev=0 to 2
      !set ff_$i=!mathsubst I$sev=$(x$(sev)_) in $(ff_$i)
    !next
    per=$[$per+($(w_$i))*$(ff_$i)]
  !endif
!next i
!if $showsheet!=$empty
  totweight=0
  !for i in $shlist
    !set totweight=$[$totweight+$(w_$i)]
  !next i
!endif

examout=!examscore user=$uu

!for i in $exlist
  es_$i=!line 1 of $examout
  es__$i=!word $i of $(es_$i)
  !!it happens that es__$i is empty, so we calculate per with 0 instead
  es_$i=$(es__$i)
  !default es_$i=0
  per=$[$per+$(ew_$i)*$(es_$i)/10]
  es_$i=$(es__$i)
  !if $showsheet!=$empty
    !set totweight=$[$totweight+$(ew_$i)]
  !endif
!next i

!if $totweight>0
  per=$[rint($scoremax*100*$per/$totweight)/100]
!else
  per=0
!endif