Subversion Repositories wimsdev

Rev

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