Subversion Repositories wimsdev

Rev

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