Subversion Repositories wimsdev

Rev

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

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