Subversion Repositories wimsdev

Rev

Rev 17410 | Rev 17471 | 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
 
17468 guerimand 70
!if $registered=$empty
71
  !! calcul uniquement lorsque l'examen n'est pas lancé (sinon c'est le c qui détermine la fin de la session)
72
  !! TODO il faudrait une commande c qui calcule tout seul cette date....
15494 bpr 73
  !! le temps restant affiche ne peut pas aller au dela de la limitation fixee par la limitation de feuille.
74
  !set expir_user=!record 0 of wimshome/log/classes/$wims_class/.E$exam
75
  !set cle=!word 1 of $expir_user
76
  !! process for technical variable definition (replace expir_user by value given by the technical variable)
77
  !if \ isin $cle
78
    !set idtechvar=!line 1 of $expir_user
79
    !set idtechvar=!char 2 to -1 of $idtechvar
80
    !readproc adm/class/userdef ,$wims_class,$wims_user
81
    !set val=!defof user_techvar_$(idtechvar) in $userdef
82
    !default val=EMPTY
83
    !reset expir_user
84
    !set expir_user=!defof techvar_$val in wimshome/log/classes/$wims_class/.E$exam
85
    !default expir_user=none
86
  !endif
87
  !! end process technical variable
88
  !if $expir_user!=none
89
    expir_user=!words2items $expir_user
90
    nb=!itemcnt $expir_user
91
    fin=$empty
92
    c=<
93
    !for k=1 to $nb
11434 guerimand 94
      !if $c isin $(expir_user[$k])
11472 bpr 95
        fin=!char 2 to -1 of $(expir_user[$k])
11434 guerimand 96
        fin=!text select 0123456789.: in $fin
97
      !endif
15494 bpr 98
    !next k
99
    !if $fin!=$empty
17468 guerimand 100
!!      date=!char 1 to 8 of $fin
101
      time_end=!char 10 to 14 of $fin
15494 bpr 102
    !endif
11959 guerimand 103
  !endif
15494 bpr 104
  !! fin des modifications qui decoule de la limitation fixee par la feuille
17468 guerimand 105
!else
106
  tmp=!record 0 of wimshome/$wims_sesdir/examdepend.$exam
107
  !if $tmp!=$empty
108
    wims_exam_remain=$[$tmp-$wims_nowseconds]
109
    time_end=!sh date -d "@$tmp" +%H:%M;
110
  !else
111
    wims_exam_remain=$[60*$sdure-($now-$registered)]
112
  !endif
23 reyssat 113
!endif
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
127
 
128
t_=!getscorestatus sheet=$exam exam=yes