Rev 15494 | Rev 16509 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
9663 | bpr | 1 | scoremax=!record 0 of wimshome/log/classes/$wims_class/sheets/.severity |
2 | scoremax=!line 1 of $scoremax |
||
3 | !default scoremax=10 |
||
23 | reyssat | 4 | |
5 | !for e=1 to $exocnt |
||
15494 | bpr | 6 | got$e=0 |
16378 | guerimand | 7 | gotip$e=0 |
15494 | bpr | 8 | replied$e=0 |
16378 | guerimand | 9 | ip$e=$empty |
23 | reyssat | 10 | !next e |
11 | |||
12 | p=!recordcnt wimshome/$wims_sesdir/examscore.$exam |
||
13 | reg=!record 0 of wimshome/$wims_sesdir/examreg.$exam |
||
14 | |||
16378 | guerimand | 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 |
||
19 | |||
23 | reyssat | 20 | replycnt=0 |
16378 | guerimand | 21 | !reset scorereducedbyip |
23 | reyssat | 22 | !for i=1 to $p |
15494 | bpr | 23 | l=!record $i of wimshome/$wims_sesdir/examscore.$exam |
24 | !distribute words $l into a_,b_,c_,d_,e_,f_,g_,i_ |
||
25 | !if $c_=score and $(replied$b_)=0 |
||
26 | got$b_=$d_ |
||
16378 | guerimand | 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 |
||
15494 | bpr | 34 | replied$b_=1 |
35 | !advance replycnt |
||
36 | !endif |
||
23 | reyssat | 37 | !next i |
38 | |||
39 | totgot=0 |
||
16378 | guerimand | 40 | totgotip=0 |
23 | reyssat | 41 | totweight=0 |
42 | !for e=1 to $exocnt |
||
15494 | bpr | 43 | l=!record $e of wimshome/log/classes/$wims_class/exams/.exam$exam |
44 | w=!word 1 of $l |
||
45 | weight$e=$w |
||
46 | totweight=$[$totweight+$w] |
||
47 | totgot=$[$totgot+$w*$(got$e)] |
||
16378 | guerimand | 48 | totgotip=$[$totgotip+$w*$(gotip$e)] |
15494 | bpr | 49 | dd=!append line $w $totgot to $dd |
23 | reyssat | 50 | !next e |
51 | |||
52 | !if $totweight>0 |
||
15494 | bpr | 53 | score=$[rint((100-10*$sprime)*$totgot/$totweight+100*$sprime)/100] |
16378 | guerimand | 54 | scoreip=$[rint((100-10*$sprime)*$totgotip/$totweight+100*$sprime)/100] |
23 | reyssat | 55 | !else |
15494 | bpr | 56 | score=$sprime |
23 | reyssat | 57 | !endif |
58 | |||
59 | !writefile wimshome/$wims_sesdir/examdata.$exam $sdure $sprime |
||
60 | registered=!record 0 of wimshome/$wims_sesdir/examreg.$exam |
||
61 | now=$wims_nowseconds |
||
11434 | guerimand | 62 | |
11956 | czzmrn | 63 | !if $registered>0 |
15494 | bpr | 64 | timeleft=$[60*$sdure-($now-$registered)] |
11956 | czzmrn | 65 | !endif |
66 | |||
11718 | bpr | 67 | !if $registered>-1 |
15494 | bpr | 68 | !! le temps restant affiche ne peut pas aller au dela de la limitation fixee par la limitation de feuille. |
69 | !set expir_user=!record 0 of wimshome/log/classes/$wims_class/.E$exam |
||
70 | !set cle=!word 1 of $expir_user |
||
71 | !! process for technical variable definition (replace expir_user by value given by the technical variable) |
||
72 | !if \ isin $cle |
||
73 | !set idtechvar=!line 1 of $expir_user |
||
74 | !set idtechvar=!char 2 to -1 of $idtechvar |
||
75 | !readproc adm/class/userdef ,$wims_class,$wims_user |
||
76 | !set val=!defof user_techvar_$(idtechvar) in $userdef |
||
77 | !default val=EMPTY |
||
78 | !reset expir_user |
||
79 | !set expir_user=!defof techvar_$val in wimshome/log/classes/$wims_class/.E$exam |
||
80 | !default expir_user=none |
||
81 | !endif |
||
82 | !! end process technical variable |
||
83 | !if $expir_user!=none |
||
84 | expir_user=!words2items $expir_user |
||
85 | nb=!itemcnt $expir_user |
||
86 | fin=$empty |
||
87 | c=< |
||
88 | !for k=1 to $nb |
||
11434 | guerimand | 89 | !if $c isin $(expir_user[$k]) |
11472 | bpr | 90 | fin=!char 2 to -1 of $(expir_user[$k]) |
11434 | guerimand | 91 | fin=!text select 0123456789.: in $fin |
92 | !endif |
||
15494 | bpr | 93 | !next k |
94 | !if $fin!=$empty |
||
95 | date=!char 1 to 8 of $fin |
||
96 | time=!char 10 to 14 of $fin |
||
97 | dt=!sh date -d"$date $time" +%s |
||
98 | left=$[$dt-$now] |
||
99 | !if $registered>0 |
||
100 | timeleft=$[min($timeleft,$left)] |
||
101 | !endif |
||
102 | !endif |
||
11959 | guerimand | 103 | !endif |
15494 | bpr | 104 | !! fin des modifications qui decoule de la limitation fixee par la feuille |
11718 | bpr | 105 | |
23 | reyssat | 106 | !endif |
107 | !if $timeleft<0 |
||
11718 | bpr | 108 | timeleft=0 |
23 | reyssat | 109 | !endif |
110 | wims_exam_remain=$timeleft |
||
111 | rm=$[floor($timeleft/60)] |
||
112 | rs=!char 2,3 of $[$timeleft%60+100] |
||
113 | remaintext=$rm:$rs |
||
114 | |||
10145 | bpr | 115 | l=!examscore |
23 | reyssat | 116 | lastscore=!word $exam of $l |
117 | !default lastscore=0 |
||
118 | tr=!line $exam+1 of $l |
||
119 | !distribute words $tr into tr1, tried, trcut |
||
120 | !if $tried=0 |
||
15494 | bpr | 121 | trcut=1 |
23 | reyssat | 122 | !endif |
123 | tryremain=$[$stries-$tried] |
||
124 | !if $trcut=0 |
||
15494 | bpr | 125 | tryremain=0 |
23 | reyssat | 126 | !endif |
11722 | bpr | 127 | !ifval $left!=$empty and $left <= $[min($timeleft+60*$sdure*($tryremain),$left)] |
15494 | bpr | 128 | time_end=!exec get_end_date.pl $left,%T |
129 | warning=yes |
||
11722 | bpr | 130 | !endif |
23 | reyssat | 131 | |
132 | t_=!getscorestatus sheet=$exam exam=yes |