File: userscore1

package info (click to toggle)
wims 2%3A4.29a%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 185,704 kB
  • sloc: xml: 366,687; javascript: 120,570; ansic: 62,341; java: 62,170; sh: 7,744; perl: 3,937; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (119 lines) | stat: -rw-r--r-- 3,658 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
!default uu=$wims_read_parm

!!! perhaps should be a command in wims.c ?
!!! variables which are necessary : wims_class, checksessions
!!! FIXME max of session number
!!! do reset only if the variable is non empty, if not it creates a variable
!!! and gives some "variable_name_buffer_overflow"
max_exams=!defof MAX_EXAMS in wimshome/public_html/bases/sys/define.conf

!for i in $activexams
  !if $(Dureeexam_$i)!=$empty
    !reset Dureeexam_$i
  !endif
  !if $(Dureeexam_$i)!=$empty
    !reset Dureeexam_$i
  !endif
  !for jj=1 to $max_exams
    !! jj correspond to maximum of number sessions
    !if $(duree$(jj)_$(i))!=$empty
      !reset duree$(jj)_$(i)
    !endif
    !if $(exam_$jj)!=$empty
     !reset exam_$jj
    !endif
    !! jj correspond to exos in an exam
    !if $(exam$(i)_$jj)!=$empty
      !reset exam$(i)_$jj
    !endif
    !if $(sess_$jj)!=$empty
      !reset sess_$jj
    !endif
  !next jj
!next i

!! -------- reduce file length with only concerned session before wims action
  tmp_=$empty
  checksessions=!text select char 0123456789AZERTYUIOPMLKJHGFDSQWXCVBN,azertyuiopmlkjhgfdsqwxcvbn in $checksessions
  !for k_ in $checksessions
    tmp_=!append word a["$k_"]=0; to $tmp_
    !reset ip_$(k_)
  !next k_
  !sh if [ -e $wims_home/log/classes/$wims_class/score/$uu.exam ]; then awk 'BEGIN{$tmp_} {if ($$6 in a || ($$6=="0" && flag==1)){print $$0; flag=1;} else {flag=0};}' $wims_home/log/classes/$wims_class/score/$uu.exam > $wims_home/sessions/$wims_session/tmpuser.exam; fi;
!! ---------------------
sc=!record 0 of wimshome/sessions/$wims_session/tmpuser.exam
!!sc=!record 0 of wimshome/log/classes/$wims_class/score/$uu.exam
!if $sc=$empty
  !exit
!endif

nsc=!linecnt $sc
!reset scorereducedbyip
!for i=1 to $nsc
  l=!line $i of $sc
  !distribute words $l into e_,s_,t__,T_,i_,S_,t_
  !if $S_=0
    !reset jj
  !else
    !set jj=!positionof item $S_ in $checksessions
    !if $(ip_$jj)=$i_
        scoreip$(jj)_$e_=$s_
    !endif
    !set score$(jj)_$e_=$s_
    !set exam_$jj=!append item $e_ to $(exam_$jj)
    !set sess_$e_=!append item $jj to $(sess_$e_)
    !set exam_$jj=!listuniq $(exam_$jj)
    !if $s_ issametext 00
      start$(jj)_$e_=$t_
      dur$(jj)_$e_=$T_
      ip_$jj=$i_
    !endif
    !if $t__ issametext -1
      duree$(jj)_$(e_)=$[$T_ - $(dur$(jj)_$e_)]
      !if $(score$(jj)_$e_)!=$(scoreip$(jj)_$e_)
        scorereducedbyip=1
      !endif
    !endif
  !endif
!next i
!for i in $activexams
  !if $(Dureeexam_$i)!=$empty
    !reset Dureeexam_$i
  !endif
  !for e=1 to $max_exams
    !if $(Exam_$(i)_$(e))!=$empty
      !reset Exam_$(i)_$(e)
    !endif
    !if $(exam$(i)_$e)!=$empty
      !reset exam$(i)_$e
    !endif
  !next e
  !for ses_ in $checksessions
    !set jj=!positionof item $ses_ in $checksessions
    !if $(duree$(jj)_$i)!=$empty
      Dureeexam_$i=!append item $(duree$(jj)_$i) to $(Dureeexam_$i)
    !endif
  !next ses_
!next

!!details des notes examens par session
!for ses_ in $checksessions
  !set jj=!positionof item $ses_ in $checksessions
  !set ss=!sh grep "$ses_" $wims_home/log/classes/$wims_class/noscore/$uu | grep "score" | awk -F"\t" '{print $$1}' | awk -F" " '{print $$3,$$4,$$6}'
  !set ss=!lines2rows $ss
  !set ss=!words2items $ss
  !!perhaps several different exams in one session.
  !for i in $(exam_$(jj))
    !set s_=!select $ss where column 1=$i
    !set nbx=!recordcnt wimshome/log/classes/$wims_class/exams/.exam$i
    !for k_=1 to $nbx
      !reset s
      !set s=!select $s_ where column 2=$k_
      !set s=$(s[3])
      !if $s!=$empty
        !set s=$[rint($s*$scoremax)/10]
      !endif
      !set Exam_$(i)_$(jj)=$(Exam_$(i)_$(jj)) $s,
    !next
  !next
!next