Subversion Repositories wimsdev

Rev

Rev 3106 | Rev 3111 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
20 reyssat 1
!if wimshome/ notin $logfile
2
 logfile=wimshome/log/$logfile
3
!endif
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
 score=!getdef w_module_score in $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
15
 !endif
16
 !default score=00.0
17
 !writefile wimshome/$wims_sesdir/restart.time
18
 session1=!translate _ to $ $ in $wims_session
19
 session1=!word 1 of $session1
20
 steps=!recordcnt $logfile
21
 !bound checkstep between integer 1 and $steps default 1
22
 vars=!record $checkstep of $logfile
23
 vars=!trim $vars
24
 !distribute lines $vars into checkqstr,checkmodule,checkcmd
25
 vars=!line 4 to -1 of $vars
26
 loggedsessiondcl=session=$checksession
27
 wimssessiondcl=session=$wims_session
28
 !if $loggedsessiondcl isin $vars
29
  vars=!replace $loggedsessiondcl[\._a-z0-9]* by $wimssessiondcl in $vars
30
 !endif
31
 checkmodule=!replace w_module= by $ in $checkmodule
32
 checkqstr=!replace QUERY_STRING= by $ in $checkqstr
33
 checkcmd=!replace w_cmd= by $ in $checkcmd
34
 !writefile wimshome/$wims_sesdir/var REMOTE_ADDR=$httpd_REMOTE_ADDR\
35
HTTP_REFERER=$httpd_HTTP_REFERER\
36
QUERY_STRING=\
37
HTTP_USER_AGENT=$httpd_HTTP_USER_AGENT\
38
HTTP_COOKIE=$httpd_HTTP_COOKIE\
39
w_cmd=new\
40
w_lang=$class_lang\
41
w_module=$checkmodule\
42
w_session=$session\
43
w_special_parm=$checkstep\
44
w_special_parm2=\
45
w_useropts=$useropts\
46
w_wims_session=$wims_session\
47
w_wims_subsession=$wims_subsession\
48
w_wims_window=$wims_window\
49
w_wims_mode=$wims_mode\
50
w_wims_module_start_time=\
51
w_wims_protocol=$wims_protocol\
52
w_wims_req_time=$wims_req_time\
53
w_wims_session_serial=$wims_session_serial\
54
w_wims_session_start_time=$wims_session_start_time\
55
 
56
 !if $checkcmd iswordof new renew next
57
  !appendfile wimshome/$wims_sesdir/var $vars
58
  !setdef wims_check=$module,$checkuser,$checksession,$checkexo,$steps,$score in wimshome/sessions/$session1/var.stat
59
  !restart module=$checkmodule&special_parm=$checkstep&cmd=resume
60
 !else
61
  vars=!record $checkstep-1 of $logfile
62
  vars=!trim $vars
63
  vars=!line 4 to -1 of $vars
64
  loggedsessiondcl=session=$checksession
65
  wimssessiondcl=session=$wims_session
66
  !if $loggedsessiondcl isin $vars
67
   vars=!replace $loggedsessiondcl[\._a-z0-9]* by $wimssessiondcl in $vars
68
  !endif
69
  !appendfile wimshome/$wims_sesdir/var $vars
3110 bpr 70
!!!must be careful if we replace & by &
20 reyssat 71
  checkqstr=!replace &+ by & in $checkqstr
72
  checkqstr=!translate & to $\
73
 $ in $checkqstr
74
  checkqstr=!trim $checkqstr
75
  cnt=!linecnt $checkqstr
76
  qstr=
77
  !for i=1 to $cnt
78
   l=!line $i of $checkqstr
79
   eq==
80
   !if &&module$eq notin &&$l and \
81
	&&session$eq notin &&$l and \
82
	&&cmd$eq notin &&$l and \
83
	&&wims_window$eq notin &&$l and \
84
	&&worksheet$eq notin &&$l
85
    qstr=!append line $l to $qstr
86
   !endif
87
  !next i
3110 bpr 88
 !if $loggedsessiondcl isin $qstr
89
   qstr=!replace $loggedsessiondcl[\._a-z0-9]* by $wimssessiondcl in $qstr
90
 !endif
20 reyssat 91
  qstr=!translate $\
92
$ to & in $qstr
93
  !restart module=$checkmodule&cmd=reply&special_parm=$checkstep&$qstr
94
 !endif