Subversion Repositories wimsdev

Rev

Rev 16807 | 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
17780 czzmrn 9
 
10
!! freeworks
11
!!
12
!! freworks are only listed in student score page if student has done
13
!! some work on the freework (for some types, just opened the freework)
14
  test=!defof allowed_optional_module in wimshome/log/wims.conf
15
  !if class/freework isitemof $test
16
    allowed_freework=yes
17
  !else
18
    !reset allowed_freework,freeworkcnt
19
  !endif
20
  !if $allowed_freework=yes and $job=getuser and $getuser!=$empty
21
    activefreew=$empty
22
    freeworkcnt=!recordcnt wimshome/log/classes/$wims_class/freeworks/.freeworks
23
    !for k=1 to $freeworkcnt
24
      t=!record $k of wimshome/log/classes/$wims_class/freeworks/.freeworks
25
      st_=!line 1 of $t
26
      !if $st_ isitemof 1,2
27
        ty_=!line 6 of $t
28
        !if $ty_=3 or $ty_=2
29
          !readproc adm/freework/finduserwork.proc $k,$getuser
30
          !if $(output)!=0
31
            activefreew=!append item $k to $activefreew
32
  	  !endif
33
        !endif
34
      !endif
35
    !next k
36
  !endif
37
  !set nbfreeworks=!itemcnt $activefreew
38
 
12465 bpr 39
  m=!record 1 of wimshome/log/classes/$wims_class/.grades
40
  !distribute lines $m into manual,titles,weights
41
  gcnt=!itemcnt $titles
42
  gcnt=$[$gcnt-2]
43
  !if $gcnt<1
44
    manual=0
45
  !else
46
    mwtot=0
47
    !for g=1 to $gcnt
48
      w$g=!item $g+2 of $weights
49
      mwtot=$[$mwtot+$(w$g)]
50
    !next g
4581 bpr 51
  !endif
17780 czzmrn 52
  !! need g_ for freeworks
53
  !!
54
  !! NOTE: for large classes adm/class/grades (i.e. manual score
55
  !! interfaces) is not available, but freeworks scoring works anyway
56
  !! and scores assigned to freeworks are visibile in this page.
57
  !!
58
  !if $manual>0 or $nbfreeworks>0
12465 bpr 59
    uucnt=!recordcnt wimshome/log/classes/$wims_class/.grades
60
    !for u=2 to $uucnt
61
      l_=!record $u of wimshome/log/classes/$wims_class/.grades
62
      n_=!item 1 of $l_
63
      !if $n_=$getuser
64
        teacher=!item 3 to -1 of $l_
65
        !break
66
      !endif
67
    !next u
68
    mav=0
69
    !for i=1 to $gcnt
70
      g_$i=!item $i of $teacher
14993 guerimand 71
      !if $(g_$i)!=$empty
72
        mav=$[$mav+($(g_$i))*($(w$i))]
73
      !endif
12465 bpr 74
    !next i
75
     mav=$[rint(100*$mav/$mwtot)/100]
76
  !else
77
    mav=0
78
  !endif
17780 czzmrn 79
 
12465 bpr 80
  t=!translate = to , in $wims_req_time
81
  t=!item -1 of $t
82
  means=!record 0 of wimshome/log/classes/$wims_class/scoreavg
83
  topscores=!record 0 of wimshome/log/classes/$wims_class/.scoretop
16807 guerimand 84
  topnb=!defof class_topscores\
85
class_limit\
86
class_hideaverage in wimshome/log/classes/$wims_class/.def
87
  !distribute line $topnb into topnb,classnb,class_hideaverage
12465 bpr 88
  !for ic=1 to $classnb
89
    UU=!line $ic of $topscores
90
    UU1=!item 4 of $UU
91
    VV=!append line $UU1 to $VV
92
    WW=!append line $UU to $WW
93
  !next ic
94
  VV=!sort reverse numeric line  $VV
95
  !readdef wimshome/log/classes/$wims_class/.def
96
  !default class_topscores=0
97
  !for s=1 to $class_topscores
98
    ic=!item $s of $wims_sort_order
99
    LL=!line $ic of $WW
100
    TT=!append line $LL to $TT
101
  !next s
102
  ot=!line 1 of $means
103
  !if $ot=$empty or $ot<$t-3
104
    !read var.avg
105
    !if $class_type notwordof 2 3 4
106
      !if $class_topscores>0
107
        !read var.topscores
108
      !endif
109
    !endif
110
  !endif
111
  l=!line 2 of $means
7638 bpr 112
 
12465 bpr 113
  !distribute words $l into\
14333 bpr 114
    min_auto,mean_auto,max_auto,\
115
    min_tea,mean_tea,max_tea,\
116
    min_glob,mean_glob,max_glob
12465 bpr 117
  c=!linecnt $means
118
  !for i=3 to $c
119
    l=!line $i of $means
120
    s=!word 1 of $l
121
    !distribute words $l into x0_,min_$s,mean_$s,max_$s
122
  !next i
123
  uu=$getuser
124
  !read adm/class/userscore
125
  globalav=$[rint($manual*$mav+((100-$manual)*$per))/100]
126
  exologs=!filelist $wims_home/log/classes/$wims_class/exolog/$getuser
15963 guerimand 127
  !readproc adm/vfilter/listvarfilter.proc
128
  !readproc adm/class/userdef ,$wims_class,$getuser
129
  !readproc adm/vfilter/uservarfilter.proc $userdef
17780 czzmrn 130
 
23 reyssat 131
!else
12465 bpr 132
  job=
23 reyssat 133
!endif
134
 
135
!if $wims_user=supervisor
12465 bpr 136
  !read var.proc.userexam
23 reyssat 137
!endif