Rev 15569 | Rev 16378 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
9719 | bpr | 1 | !default uu=$wims_read_parm |
2 | |||
3 | !!! perhaps should be a command in wims.c ? |
||
4 | !!! variables which are necessary : wims_class, checksessions |
||
5 | !!! FIXME 64= max of exam number |
||
6 | !!! FIXME max of session number |
||
9878 | bpr | 7 | !!! do reset only if the variable is non empty, if not it creates a variable |
8 | !!! and gives some "variable_name_buffer_overflow" |
||
9 | |||
9719 | bpr | 10 | !for i in $activexams |
12555 | bpr | 11 | !if $(Dureeexam_$i)!=$empty |
12 | !reset Dureeexam_$i |
||
13 | !endif |
||
14 | !if $(Dureeexam_$i)!=$empty |
||
15 | !reset Dureeexam_$i |
||
16 | !endif |
||
17 | !for jj=1 to 64 |
||
18 | !! jj correspond to maximum of number sessions |
||
19 | !if $(duree$(jj)_$(i))!=$empty |
||
20 | !reset duree$(jj)_$(i) |
||
21 | !endif |
||
22 | !if $(exam_$jj)!=$empty |
||
23 | !reset exam_$jj |
||
24 | !endif |
||
25 | !! jj correspond to exos in an exam |
||
26 | !if $(exam$(i)_$jj)!=$empty |
||
27 | !reset exam$(i)_$jj |
||
28 | !endif |
||
15569 | bpr | 29 | !if $(sess_$jj)!=$empty |
30 | !reset sess_$jj |
||
31 | !endif |
||
16148 | guerimand | 32 | !next jj |
33 | !next i |
||
9719 | bpr | 34 | |
16148 | guerimand | 35 | !! -------- reduce file length with only concerned session before wims action |
36 | tmp_=$empty |
||
37 | checksessions=!text select char 0123456789AZERTYUIOPMLKJHGFDSQWXCVBN,azertyuiopmlkjhgfdsqwxcvbn in $checksessions |
||
38 | !for k_ in $checksessions |
||
39 | tmp_=!append word a["$k_"]=0; to $tmp_ |
||
40 | !next k_ |
||
41 | !sh 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; |
||
42 | !! --------------------- |
||
43 | sc=!record 0 of wimshome/sessions/$wims_session/tmpuser.exam |
||
44 | !!sc=!record 0 of wimshome/log/classes/$wims_class/score/$uu.exam |
||
10019 | bpr | 45 | !if $sc=$empty |
46 | !exit |
||
47 | !endif |
||
9719 | bpr | 48 | nsc=!linecnt $sc |
10019 | bpr | 49 | |
9719 | bpr | 50 | !for i=1 to $nsc |
51 | l=!line $i of $sc |
||
52 | !distribute words $l into e_,s_,t__,T_,i_,S_,t_ |
||
10019 | bpr | 53 | !if $S_=0 |
54 | !reset jj |
||
55 | !else |
||
56 | !set jj=!positionof item $S_ in $checksessions |
||
57 | !set score$(jj)_$e_=$s_ |
||
58 | !set exam_$jj=!append item $e_ to $(exam_$jj) |
||
15569 | bpr | 59 | !set sess_$e_=!append item $jj to $(sess_$e_) |
10019 | bpr | 60 | !set exam_$jj=!listuniq $(exam_$jj) |
61 | !if $s_ issametext 00 |
||
62 | start$(jj)_$e_=$t_ |
||
63 | dur$(jj)_$e_=$T_ |
||
64 | !endif |
||
65 | !if $t__ issametext -1 |
||
66 | duree$(jj)_$(e_)=$[$T_ - $(dur$(jj)_$e_)] |
||
67 | !endif |
||
9719 | bpr | 68 | !endif |
16148 | guerimand | 69 | !next i |
9719 | bpr | 70 | !for i in $activexams |
12555 | bpr | 71 | !if $(Dureeexam_$i)!=$empty |
72 | !reset Dureeexam_$i |
||
9878 | bpr | 73 | !endif |
12555 | bpr | 74 | !for e=1 to 64 |
75 | !if $(Exam_$(i)_$(e))!=$empty |
||
76 | !reset Exam_$(i)_$(e) |
||
77 | !endif |
||
78 | !if $(exam$(i)_$e)!=$empty |
||
79 | !reset exam$(i)_$e |
||
80 | !endif |
||
16148 | guerimand | 81 | !next e |
12555 | bpr | 82 | !for ses_ in $checksessions |
83 | !set jj=!positionof item $ses_ in $checksessions |
||
84 | !if $(duree$(jj)_$i)!=$empty |
||
85 | Dureeexam_$i=!append item $(duree$(jj)_$i) to $(Dureeexam_$i) |
||
86 | !endif |
||
16148 | guerimand | 87 | !next ses_ |
9719 | bpr | 88 | !next |
89 | |||
90 | !!details des notes examens par session |
||
91 | !for ses_ in $checksessions |
||
12555 | bpr | 92 | !set jj=!positionof item $ses_ in $checksessions |
93 | !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}' |
||
94 | !set ss=!lines2rows $ss |
||
95 | !set ss=!words2items $ss |
||
96 | !!perhaps several different exams in one session. |
||
97 | !for i in $(exam_$(jj)) |
||
98 | !set s_=!select $ss where column 1=$i |
||
99 | !set nbx=!recordcnt wimshome/log/classes/$wims_class/exams/.exam$i |
||
100 | !for k_=1 to $nbx |
||
101 | !reset s |
||
102 | !set s=!select $s_ where column 2=$k_ |
||
103 | !set s=$(s[3]) |
||
104 | !if $s!=$empty |
||
105 | !set s=$[rint($s*$scoremax)/10] |
||
106 | !endif |
||
107 | !set Exam_$(i)_$(jj)=$(Exam_$(i)_$(jj)) $s, |
||
108 | !next |
||
109 | !next |
||
9719 | bpr | 110 | !next |