Subversion Repositories wimsdev

Rev

Rev 17491 | 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
17491 guerimand 68
wims_exam_remain=$[60*$sdure-($wims_nowseconds-$registered)]
69
!! TODO il faudrait une commande c qui calcule tout seul cette date....
70
!! le temps restant affiche ne peut pas aller au dela de la limitation fixee par la limitation de feuille.
71
!set expir_user=!record 0 of wimshome/log/classes/$wims_class/.E$exam
72
!set cle=!word 1 of $expir_user
73
!! process for technical variable definition (replace expir_user by value given by the technical variable)
74
!if \ isin $cle
75
  !set idtechvar=!line 1 of $expir_user
76
  !set idtechvar=!char 2 to -1 of $idtechvar
77
  !readproc adm/class/userdef ,$wims_class,$wims_user
78
  !set val=!defof user_techvar_$(idtechvar) in $userdef
79
  !default val=EMPTY
80
  !reset expir_user
81
  !set expir_user=!defof techvar_$val in wimshome/log/classes/$wims_class/.E$exam
82
  !default expir_user=none
83
!endif
84
!! end process technical variable
85
!if $expir_user!=none
86
  expir_user=!words2items $expir_user
87
  nb=!itemcnt $expir_user
88
  fin=$empty
89
  c=<
90
  !for k=1 to $nb
91
    !if $c isin $(expir_user[$k])
92
      fin=!char 2 to -1 of $(expir_user[$k])
93
      fin=!text select 0123456789.: in $fin
15494 bpr 94
    !endif
17491 guerimand 95
  !next k
96
  !if $fin!=$empty
97
    date=!char 1 to 8 of $fin
98
    time=!char 10 to 14 of $fin
17493 guerimand 99
    !read date.phtml $date.$time,noprint
17491 guerimand 100
    time_end=$slib_out
101
    left=!sh date -d"$date $time" +%s
102
    left=$[max(0,$left-$wims_nowseconds)]
103
    wims_exam_remain=$[min($left,$wims_exam_remain)]
11959 guerimand 104
  !endif
23 reyssat 105
!endif
17491 guerimand 106
!! fin des modifications qui decoule de la limitation fixee par la feuille
107
!if $registered=$empty
108
  !reset wims_exam_remain
109
!endif
23 reyssat 110
 
10145 bpr 111
l=!examscore
23 reyssat 112
lastscore=!word $exam of $l
113
!default lastscore=0
114
tr=!line $exam+1 of $l
115
!distribute words $tr into tr1, tried, trcut
116
!if $tried=0
15494 bpr 117
  trcut=1
23 reyssat 118
!endif
119
tryremain=$[$stries-$tried]
120
!if $trcut=0
15494 bpr 121
  tryremain=0
23 reyssat 122
!endif
123
 
124
t_=!getscorestatus sheet=$exam exam=yes