Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
862 guerimand 1
!read adm/class/userisinclass ,$getuser
2
!if yes notin $script_reply
3
 error=bad_usercls
4
 !reset job,getuser
5
 !exit
6
!endif
23 reyssat 7
 
8
!if $getuser!=$empty
12465 bpr 9
  m=!record 1 of wimshome/log/classes/$wims_class/.grades
10
  !distribute lines $m into manual,titles,weights
11
  gcnt=!itemcnt $titles
12
  gcnt=$[$gcnt-2]
13
  !if $gcnt<1
14
    manual=0
15
  !else
16
    mwtot=0
17
    !for g=1 to $gcnt
18
      w$g=!item $g+2 of $weights
19
      mwtot=$[$mwtot+$(w$g)]
20
    !next g
4581 bpr 21
  !endif
12465 bpr 22
  !if $manual>0
23
    uucnt=!recordcnt wimshome/log/classes/$wims_class/.grades
24
    !for u=2 to $uucnt
25
      l_=!record $u of wimshome/log/classes/$wims_class/.grades
26
      n_=!item 1 of $l_
27
      !if $n_=$getuser
28
        teacher=!item 3 to -1 of $l_
29
        !break
30
      !endif
31
    !next u
32
    mav=0
33
    !for i=1 to $gcnt
34
      g_$i=!item $i of $teacher
35
      mav=$[$mav+($(g_$i))*($(w$i))]
36
    !next i
37
     mav=$[rint(100*$mav/$mwtot)/100]
38
  !else
39
    mav=0
40
  !endif
41
  t=!translate = to , in $wims_req_time
42
  t=!item -1 of $t
43
  means=!record 0 of wimshome/log/classes/$wims_class/scoreavg
44
  topscores=!record 0 of wimshome/log/classes/$wims_class/.scoretop
45
  topnb=!defof class_topscores in wimshome/log/classes/$wims_class/.def
46
  classnb=!defof class_limit in wimshome/log/classes/$wims_class/.def
47
  !for ic=1 to $classnb
48
    UU=!line $ic of $topscores
49
    UU1=!item 4 of $UU
50
    VV=!append line $UU1 to $VV
51
    WW=!append line $UU to $WW
52
  !next ic
53
  VV=!sort reverse numeric line  $VV
54
  !readdef wimshome/log/classes/$wims_class/.def
55
  !default class_topscores=0
56
  !for s=1 to $class_topscores
57
    ic=!item $s of $wims_sort_order
58
    LL=!line $ic of $WW
59
    TT=!append line $LL to $TT
60
  !next s
61
  ot=!line 1 of $means
62
  !if $ot=$empty or $ot<$t-3
63
    !read var.avg
64
    !if $class_type notwordof 2 3 4
65
      !if $class_topscores>0
66
        !read var.topscores
67
      !endif
68
    !endif
69
  !endif
70
  l=!line 2 of $means
7638 bpr 71
 
12465 bpr 72
  !distribute words $l into\
14333 bpr 73
    min_auto,mean_auto,max_auto,\
74
    min_tea,mean_tea,max_tea,\
75
    min_glob,mean_glob,max_glob
12465 bpr 76
  c=!linecnt $means
77
  !for i=3 to $c
78
    l=!line $i of $means
79
    s=!word 1 of $l
80
    !distribute words $l into x0_,min_$s,mean_$s,max_$s
81
  !next i
82
  uu=$getuser
83
  !read adm/class/userscore
84
  globalav=$[rint($manual*$mav+((100-$manual)*$per))/100]
85
  exologs=!filelist $wims_home/log/classes/$wims_class/exolog/$getuser
23 reyssat 86
!else
12465 bpr 87
  job=
23 reyssat 88
!endif
89
 
90
!if $wims_user=supervisor
12465 bpr 91
  !read var.proc.userexam
23 reyssat 92
!endif