Subversion Repositories wimsdev

Rev

Rev 3112 | Rev 14336 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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