Subversion Repositories wimsdev

Rev

Rev 17306 | Rev 17359 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17306 Rev 17358
Line 10... Line 10...
10
!default time1=0
10
!default time1=0
11
test=!fileexists $ufile
11
test=!fileexists $ufile
12
!if $test=yes and ($[$wims_nowseconds-$time1]<3600*$swork_refreshtiming or ($swork_allowrefresh=1 and $refresh!=1))
12
!if $test=yes and ($[$wims_nowseconds-$time1]<3600*$swork_refreshtiming or ($swork_allowrefresh=1 and $refresh!=1))
13
  !exit
13
  !exit
14
!endif
14
!endif
-
 
15
!sh rm -f $wims_home/log/fabrice/fabrice
15
!readproc proc/loguserwork.proc $user
16
!readproc proc/loguserwork.proc $user
16
time2=!record 0 of $clsfile
17
time2=!record 0 of $clsfile
17
time2=!word 1 of $time2
18
time2=!word 1 of $time2
18
!default time2=0
19
!default time2=0
19
!if $[$wims_nowseconds-$time2]<3600
20
!if $[$wims_nowseconds-$time2]<3600
Line 92... Line 93...
92
    !reset useraverage
93
    !reset useraverage
93
    !for dtu in $userlist
94
    !for dtu in $userlist
94
      lq=!getscoremean user=$dtu sheet=$sh
95
      lq=!getscoremean user=$dtu sheet=$sh
95
      !if $indic=0
96
      !if $indic=0
96
        li=!getscore user=$dtu sheet=$sh
97
        li=!getscore user=$dtu sheet=$sh
-
 
98
        re=!getscorerequire user=$dtu sheet=$sh
97
      !else
99
      !else
98
        !if $indic=1
100
        !if $indic=1
99
          li=!getscorebest user=$dtu sheet=$sh
101
          li=!getscorebest user=$dtu sheet=$sh
-
 
102
          re=!getscorerequire user=$dtu sheet=$sh
100
        !else
103
        !else
101
          li=!getscorelevel user=$dtu sheet=$sh
104
          li=!getscorelevel user=$dtu sheet=$sh
-
 
105
          re=!values 1 for v=1 to $nbexo
-
 
106
          re=!items2words $re
102
        !endif
107
        !endif
103
      !endif
108
      !endif
104
      !!calcul du score pour chaque exo
109
      !!calcul du score pour chaque exo
105
      !reset lave lmax lcount lave2
110
      !reset lave lmax lcount lave2
106
      !for k=1 to $nbexo
111
      !for k=1 to $nbexo
107
        ewei=!word $k of $wei
112
        ewei=!word $k of $wei
108
        elq=!word $k of $lq
113
        elq=!word $k of $lq
109
        eli=!word $k of $li
114
        eli=!word $k of $li
-
 
115
        rei=!word $k of $re
-
 
116
        !if $rei!=0
110
        ave=!replace internal I by $[$eli/10] in $formula
117
          ave=!replace internal I by $[$eli/10/$rei] in $formula
-
 
118
        !else
-
 
119
          ave=!replace internal I by 1 in $formula
-
 
120
        !endif
111
        ave=!replace internal Q by $[$elq/10] in $ave
121
        ave=!replace internal Q by $[$elq/10] in $ave
112
        ave=$[rint($ave*1000)]
122
        ave=$[rint($ave*1000)]
113
        !if $dtu=$user
123
        !if $dtu=$user
114
          useraverage=!append item $ave to $useraverage
124
          useraverage=!append item $ave to $useraverage
115
        !endif
125
        !endif
116
        try=!getscorealltries user=$dtu sheet=$sh work=$k
126
        try=!getscoretry user=$dtu sheet=$sh work=$k
117
        !if $try>0          
127
        !if $try>0          
118
          ave2=$[$(ave)+$(average2[$k])]
-
 
119
          lave2=!append item $ave2 to $lave2
-
 
120
          cnt=$[$(count[$k])+1]
128
          cnt=$[$(count[$k])+1]
121
          lcount=!append item $cnt to $lcount
129
          lcount=!append item $cnt to $lcount
122
        !else
130
        !else
123
          lave2=!append item $(average2[$k]) to $lave2
-
 
124
          lcount=!append item $(count[$k]) to $lcount
131
          lcount=!append item $(count[$k]) to $lcount
125
        !endif
132
        !endif
126
        lmax=!append item $[max($ave,$(max[$k]))] to $lmax
133
        lmax=!append item $[max($ave,$(max[$k]))] to $lmax
127
        ave=$[$(ave)+$(average[$k])]
134
        ave=$[$(ave)+$(average[$k])]
128
        lave=!append item $ave to $lave
135
        lave=!append item $ave to $lave
129
        lave=!append item $(average[$k]) to $lave
-
 
130
        lcount=!append item $(count[$k]) to $lcount
-
 
131
      !next k
136
      !next k
132
      count=$lcount
137
      count=$lcount
133
      average=$lave
138
      average=$lave
134
      average2=$lave2
-
 
135
      max=$lmax
139
      max=$lmax
136
    !next dtu
140
    !next dtu
137
    !reset tmp tmp2
141
    !reset tmp tmp2
138
    !if $time2!=yes
142
    !if $time2!=yes
139
      tmp=!record $sh of $clsfile
143
      tmp=!record $sh of $clsfile
Line 177... Line 181...
177
  !endif
181
  !endif
178
!next sh
182
!next sh
179
 
183
 
180
!sh sort -n -r -k 3 -k 4 $Ufile > $wims_home/sessions/$wimss_session/tmp.swork;\
184
!sh sort -n -r -k 3 -k 4 $Ufile > $wims_home/sessions/$wimss_session/tmp.swork;\
181
    mv -f $wims_home/sessions/$wimss_session/tmp.swork $Ufile
185
    mv -f $wims_home/sessions/$wimss_session/tmp.swork $Ufile
182
 
-