Subversion Repositories wimsdev

Rev

Rev 16264 | Blame | Compare with Previous | Last modification | View Log | RSS feed

!! display a saved exercise in case of type=4 (in popup window)
!if $wims_user!=supervisor
  checkuser=$wims_user
!else
  !if $checkuser notitemof $ulist
    error=exolog-nouser
    notallowed=1
    !exit
  !endif
!endif
nbexo=!recordcnt wimshome/log/classes/$wims_class/freeworks/.Wfreework$freework
!bound logcheck between 1 and $nbexo default $empty
!if $logcheck=$empty
  error=exolog-nofile
  !exit
!endif
logfile=wimshome/log/classes/$wims_class/freeworksdata/$freework/work/$(checkuser)-wimsexo/$logcheck
test=!fileexists $logfile
!if $test!=yes
  error=exolog-nofile
  !exit
!endif

!writefile wimshome/$wims_sesdir/var REMOTE_ADDR=$httpd_REMOTE_ADDR\
HTTP_REFERER=$httpd_HTTP_REFERER\
QUERY_STRING=\
HTTP_USER_AGENT=$httpd_HTTP_USER_AGENT\
HTTP_COOKIE=$httpd_HTTP_COOKIE\
w_cmd=new\
w_lang=$class_lang\
w_special_parm=1\
w_special_parm2=\
w_useropts=$useropts\
w_wims_session=$wims_session\
w_wims_subsession=$wims_subsession\
w_wims_window=$wims_window\
w_wims_mode=$wims_mode\
w_wims_module_start_time=\
w_wims_protocol=$wims_protocol\
w_wims_req_time=$wims_req_time\
w_wims_session_serial=$wims_session_serial\
w_wims_session_start_time=$wims_session_start_time

!setdef wims_checkfile=$logfile in wimshome/$wims_sesdir/var.stat
!restart module=adm/class/exolog&+cmd=new&+job=examcheck&+checkuser=$checkuser&+checkexo=file




!! --------- end of file no more in use but waiting test before deleting
!! use directly module adm/class/exolog






score=!getdef w_module_score in $logfile
!writefile wimshome/$wims_sesdir/restart.time
session1=!translate _ to $ $ in $wims_session
session1=!word 1 of $session1
steps=!recordcnt $logfile
!bound checkstep between integer 1 and $steps default 1
vars=!record $checkstep of $logfile
vars=!trim $vars
!distribute lines $vars into checkqstr,checkmodule,checkcmd
vars=!line 4 to -1 of $vars
memchecksession=$checksession
!if $checksession=$empty
  checksession=!replace internal QUERY_STRING= by $empty in $checkqstr
  checksession=!replace &+ by & in $checksession
  checksession=!translate & to $\
 $ in $checksession
  checksession=!replace internal = by , in $checksession
  checksession=!replace internal . by , in $checksession
  tmp=!column 1 of $checksession
  tmp=!positionof item session in $tmp
  checksession=$(checksession[$tmp;2])
!endif
loggedsessiondcl=session=$checksession
wimssessiondcl=session=$wims_session
!if $loggedsessiondcl isin $vars
  vars=!replace $loggedsessiondcl[\._a-z0-9]* by $wimssessiondcl in $vars
!endif
checkmodule=!replace w_module= by $ in $checkmodule
checkqstr=!replace QUERY_STRING= by $ in $checkqstr
checkcmd=!replace w_cmd= by $ in $checkcmd
!writefile wimshome/$wims_sesdir/var REMOTE_ADDR=$httpd_REMOTE_ADDR\
HTTP_REFERER=$httpd_HTTP_REFERER\
QUERY_STRING=\
HTTP_USER_AGENT=$httpd_HTTP_USER_AGENT\
HTTP_COOKIE=$httpd_HTTP_COOKIE\
w_cmd=new\
w_lang=$class_lang\
w_module=$checkmodule\
w_session=$session\
w_special_parm=$checkstep\
w_special_parm2=\
w_useropts=$useropts\
w_wims_session=$wims_session\
w_wims_subsession=$wims_subsession\
w_wims_window=$wims_window\
w_wims_mode=$wims_mode\
w_wims_module_start_time=\
w_wims_protocol=$wims_protocol\
w_wims_req_time=$wims_req_time\
w_wims_session_serial=$wims_session_serial\
w_wims_session_start_time=$wims_session_start_time\

!if $checkcmd iswordof new renew next
  !appendfile wimshome/$wims_sesdir/var $vars
  !setdef wims_check=$module,$checkuser,$memchecksession,$freework.$logcheck,$steps,$score in wimshome/sessions/$session1/var.stat
!!  !setdef wims_check=adm/class/exolog,$checkuser,$memchecksession,$freework.$logcheck,$steps,$score in wimshome/sessions/$session1/var.stat
  !setdef wims_checkfile=$logfile in wimshome/sessions/$session1/var.stat
  !restart module=$checkmodule&special_parm=$checkstep&cmd=resume
!else
  vars=!record $checkstep-1 of $logfile
  vars=!trim $vars
  vars=!line 4 to -1 of $vars
  loggedsessiondcl=session=$checksession
  wimssessiondcl=session=$wims_session
  !if $loggedsessiondcl isin $vars
    vars=!replace $loggedsessiondcl[\._a-z0-9]* by $wimssessiondcl in $vars
  !endif
  !appendfile wimshome/$wims_sesdir/var $vars
  !!!must be careful if we replace & by &
  checkqstr=!replace &+ by & in $checkqstr
  checkqstr=!translate & to $\
 $ in $checkqstr
  checkqstr=!trim $checkqstr
  cnt=!linecnt $checkqstr
  qstr=
  !for i=1 to $cnt
    l=!line $i of $checkqstr
    eq==
    !if &&module$eq notin &&$l and \
        &&session$eq notin &&$l and \
        &&cmd$eq notin &&$l and \
        &&wims_window$eq notin &&$l and \
        &&worksheet$eq notin &&$l
      qstr=!append line $l to $qstr
    !endif
  !next i
  !if $checksession isin $qstr
    qstr=!replace $checksession[\._a-z0-9]* by $wims_session in $qstr
  !endif
     qstr=!translate $\
$ to & in $qstr
  !restart module=$checkmodule&cmd=reply&special_parm=$checkstep&$qstr
!endif