Rev 16257 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
16257 | guerimand | 1 | !if $checkexo=file |
16264 | guerimand | 2 | logfile=!getdef wims_checkfile in wimshome/sessions/$wims_session/var.stat |
16257 | guerimand | 3 | !else |
4 | !bound checkexo within $exos default $ |
||
5 | !if $checkexo=$empty |
||
6 | error=bad_exo |
||
7 | !exit |
||
8 | !endif |
||
9 | checkexo=!item -1 of $checkexo |
||
10 | cexo=!translate . to , in $checkexo |
||
11 | !distribute item $cexo into exam,exo |
||
12 | !endif |
||
20 | reyssat | 13 | !if wimshome/ notin $logfile |
12555 | bpr | 14 | logfile=wimshome/log/$logfile |
20 | reyssat | 15 | !endif |
16257 | guerimand | 16 | |
12555 | bpr | 17 | score=!getdef w_module_score in $logfile |
18 | !if exam isin $logfile |
||
20 | reyssat | 19 | !default score=!sh awk '/^E/ && $$2=="$checksession" && $$3==$exam && $$4==$exo && $$5=="score" {print $$6}' $wims_home/log/classes/$wims_class/noscore/$checkuser |
12555 | bpr | 20 | !endif |
21 | !default score=00.0 |
||
22 | !writefile wimshome/$wims_sesdir/restart.time |
||
23 | session1=!translate _ to $ $ in $wims_session |
||
24 | session1=!word 1 of $session1 |
||
25 | steps=!recordcnt $logfile |
||
26 | !bound checkstep between integer 1 and $steps default 1 |
||
27 | vars=!record $checkstep of $logfile |
||
28 | vars=!trim $vars |
||
29 | !distribute lines $vars into checkqstr,checkmodule,checkcmd |
||
30 | vars=!line 4 to -1 of $vars |
||
31 | memchecksession=$checksession |
||
32 | !if $checksession=$empty |
||
3112 | guerimand | 33 | checksession=!replace internal QUERY_STRING= by $empty in $checkqstr |
34 | checksession=!replace &+ by & in $checksession |
||
35 | checksession=!translate & to $\ |
||
36 | $ in $checksession |
||
37 | checksession=!replace internal = by , in $checksession |
||
38 | checksession=!replace internal . by , in $checksession |
||
39 | tmp=!column 1 of $checksession |
||
40 | tmp=!positionof item session in $tmp |
||
41 | checksession=$(checksession[$tmp;2]) |
||
12555 | bpr | 42 | !endif |
43 | loggedsessiondcl=session=$checksession |
||
44 | wimssessiondcl=session=$wims_session |
||
45 | !if $loggedsessiondcl isin $vars |
||
20 | reyssat | 46 | vars=!replace $loggedsessiondcl[\._a-z0-9]* by $wimssessiondcl in $vars |
12555 | bpr | 47 | !endif |
48 | checkmodule=!replace w_module= by $ in $checkmodule |
||
49 | checkqstr=!replace QUERY_STRING= by $ in $checkqstr |
||
50 | checkcmd=!replace w_cmd= by $ in $checkcmd |
||
51 | !writefile wimshome/$wims_sesdir/var REMOTE_ADDR=$httpd_REMOTE_ADDR\ |
||
20 | reyssat | 52 | HTTP_REFERER=$httpd_HTTP_REFERER\ |
53 | QUERY_STRING=\ |
||
54 | HTTP_USER_AGENT=$httpd_HTTP_USER_AGENT\ |
||
55 | HTTP_COOKIE=$httpd_HTTP_COOKIE\ |
||
56 | w_cmd=new\ |
||
57 | w_lang=$class_lang\ |
||
58 | w_module=$checkmodule\ |
||
59 | w_session=$session\ |
||
60 | w_special_parm=$checkstep\ |
||
61 | w_special_parm2=\ |
||
62 | w_useropts=$useropts\ |
||
63 | w_wims_session=$wims_session\ |
||
64 | w_wims_subsession=$wims_subsession\ |
||
65 | w_wims_window=$wims_window\ |
||
66 | w_wims_mode=$wims_mode\ |
||
67 | w_wims_module_start_time=\ |
||
68 | w_wims_protocol=$wims_protocol\ |
||
69 | w_wims_req_time=$wims_req_time\ |
||
70 | w_wims_session_serial=$wims_session_serial\ |
||
71 | w_wims_session_start_time=$wims_session_start_time\ |
||
72 | |||
12555 | bpr | 73 | !if $checkcmd iswordof new renew next |
20 | reyssat | 74 | !appendfile wimshome/$wims_sesdir/var $vars |
3112 | guerimand | 75 | !setdef wims_check=$module,$checkuser,$memchecksession,$checkexo,$steps,$score in wimshome/sessions/$session1/var.stat |
20 | reyssat | 76 | !restart module=$checkmodule&special_parm=$checkstep&cmd=resume |
12555 | bpr | 77 | !else |
20 | reyssat | 78 | vars=!record $checkstep-1 of $logfile |
79 | vars=!trim $vars |
||
80 | vars=!line 4 to -1 of $vars |
||
81 | loggedsessiondcl=session=$checksession |
||
82 | wimssessiondcl=session=$wims_session |
||
83 | !if $loggedsessiondcl isin $vars |
||
12555 | bpr | 84 | vars=!replace $loggedsessiondcl[\._a-z0-9]* by $wimssessiondcl in $vars |
20 | reyssat | 85 | !endif |
86 | !appendfile wimshome/$wims_sesdir/var $vars |
||
12555 | bpr | 87 | !!!must be careful if we replace & by & |
20 | reyssat | 88 | checkqstr=!replace &+ by & in $checkqstr |
89 | checkqstr=!translate & to $\ |
||
90 | $ in $checkqstr |
||
91 | checkqstr=!trim $checkqstr |
||
92 | cnt=!linecnt $checkqstr |
||
93 | qstr= |
||
94 | !for i=1 to $cnt |
||
12555 | bpr | 95 | l=!line $i of $checkqstr |
96 | eq== |
||
97 | !if &&module$eq notin &&$l and \ |
||
14336 | bpr | 98 | &&session$eq notin &&$l and \ |
99 | &&cmd$eq notin &&$l and \ |
||
100 | &&wims_window$eq notin &&$l and \ |
||
101 | &&worksheet$eq notin &&$l |
||
12555 | bpr | 102 | qstr=!append line $l to $qstr |
103 | !endif |
||
20 | reyssat | 104 | !next i |
12555 | bpr | 105 | !if $checksession isin $qstr |
106 | qstr=!replace $checksession[\._a-z0-9]* by $wims_session in $qstr |
||
107 | !endif |
||
108 | qstr=!translate $\ |
||
20 | reyssat | 109 | $ to & in $qstr |
110 | !restart module=$checkmodule&cmd=reply&special_parm=$checkstep&$qstr |
||
12555 | bpr | 111 | !endif |