Rev 15494 | Rev 16509 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 15494 | Rev 16378 | ||
---|---|---|---|
Line 2... | Line 2... | ||
2 | scoremax=!line 1 of $scoremax |
2 | scoremax=!line 1 of $scoremax |
3 | !default scoremax=10 |
3 | !default scoremax=10 |
4 | 4 | ||
5 | !for e=1 to $exocnt |
5 | !for e=1 to $exocnt |
6 | got$e=0 |
6 | got$e=0 |
- | 7 | gotip$e=0 |
|
7 | replied$e=0 |
8 | replied$e=0 |
- | 9 | ip$e=$empty |
|
8 | !next e |
10 | !next e |
9 | 11 | ||
10 | p=!recordcnt wimshome/$wims_sesdir/examscore.$exam |
12 | p=!recordcnt wimshome/$wims_sesdir/examscore.$exam |
11 | reg=!record 0 of wimshome/$wims_sesdir/examreg.$exam |
13 | reg=!record 0 of wimshome/$wims_sesdir/examreg.$exam |
- | 14 | ||
- | 15 | class_examscore_withoutip=!defof class_examscore_withoutip in wimshome/log/classes/$wims_class/.def |
|
- | 16 | !if $class_examscore_withoutip!=yes |
|
- | 17 | start_ip=!sh awk '{if ($$6=="$wims_session" && $$2=="00") print $$5;}' $wims_home/log/classes/$wims_class/score/$wims_user.exam |
|
- | 18 | !endif |
|
12 | 19 | ||
13 | replycnt=0 |
20 | replycnt=0 |
- | 21 | !reset scorereducedbyip |
|
14 | !for i=1 to $p |
22 | !for i=1 to $p |
15 | l=!record $i of wimshome/$wims_sesdir/examscore.$exam |
23 | l=!record $i of wimshome/$wims_sesdir/examscore.$exam |
16 | !distribute words $l into a_,b_,c_,d_,e_,f_,g_,i_ |
24 | !distribute words $l into a_,b_,c_,d_,e_,f_,g_,i_ |
17 | !if $c_=score and $(replied$b_)=0 |
25 | !if $c_=score and $(replied$b_)=0 |
18 | got$b_=$d_ |
26 | got$b_=$d_ |
- | 27 | ip$b_=$e_ |
|
- | 28 | !if $class_examscore_withoutip!=yes and $start_ip!=$e_ |
|
- | 29 | gotip$b_=0 |
|
- | 30 | scorereducedbyip=1 |
|
- | 31 | !else |
|
- | 32 | gotip$b_=$d_ |
|
- | 33 | !endif |
|
19 | replied$b_=1 |
34 | replied$b_=1 |
20 | !advance replycnt |
35 | !advance replycnt |
21 | !endif |
36 | !endif |
22 | !next i |
37 | !next i |
23 | 38 | ||
24 | totgot=0 |
39 | totgot=0 |
- | 40 | totgotip=0 |
|
25 | totweight=0 |
41 | totweight=0 |
26 | !for e=1 to $exocnt |
42 | !for e=1 to $exocnt |
27 | l=!record $e of wimshome/log/classes/$wims_class/exams/.exam$exam |
43 | l=!record $e of wimshome/log/classes/$wims_class/exams/.exam$exam |
28 | w=!word 1 of $l |
44 | w=!word 1 of $l |
29 | weight$e=$w |
45 | weight$e=$w |
30 | totweight=$[$totweight+$w] |
46 | totweight=$[$totweight+$w] |
31 | totgot=$[$totgot+$w*$(got$e)] |
47 | totgot=$[$totgot+$w*$(got$e)] |
- | 48 | totgotip=$[$totgotip+$w*$(gotip$e)] |
|
32 | dd=!append line $w $totgot to $dd |
49 | dd=!append line $w $totgot to $dd |
33 | !next e |
50 | !next e |
34 | 51 | ||
35 | !if $totweight>0 |
52 | !if $totweight>0 |
36 | score=$[rint((100-10*$sprime)*$totgot/$totweight+100*$sprime)/100] |
53 | score=$[rint((100-10*$sprime)*$totgot/$totweight+100*$sprime)/100] |
- | 54 | scoreip=$[rint((100-10*$sprime)*$totgotip/$totweight+100*$sprime)/100] |
|
37 | !else |
55 | !else |
38 | score=$sprime |
56 | score=$sprime |
39 | !endif |
57 | !endif |
40 | 58 | ||
41 | !writefile wimshome/$wims_sesdir/examdata.$exam $sdure $sprime |
59 | !writefile wimshome/$wims_sesdir/examdata.$exam $sdure $sprime |