Subversion Repositories wimsdev

Rev

Rev 13043 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
8006 schaersvoo 1
!if $use_mathml=1
2
 force_mathml=yes
3
!endif
338 schaersvoo 4
!if $cmd=reply and $status!=waiting
5
 error=double_reply
6
 !exit
7
!endif
8
 
9
n=$counter
1094 schaersvoo 10
 
11
# firm anti-back-button-policy
12
!if exam notin $session
13043 schaersvoo 13
 # because of strange behaviour of "help_in_exam bug_fix" the help-page starts a copy of the exam-page...
14
 !if $status=waiting and $cmd=reply
15
  session_done=!append item $session to $session_done
16
  t=!positionof item $session in $session_done
17
  t=!itemcnt $t
18
  !if $t!=1
19
  # disable !insmath $(reply$n)
20
   math=0
21
   status=done
13047 schaersvoo 22
   !for p=$n to $total_exos
23
    reply$p=<b>$no_back_button</b>
24
    remark$p=$NOK
13043 schaersvoo 25
   !next p
26
   !readproc $procdir/score.proc
27
   !exit
28
  !endif
29
 !endif
1094 schaersvoo 30
!endif
31
 
338 schaersvoo 32
!if $status=waiting and $cmd=reply
13047 schaersvoo 33
 # extra check on javascript injection through adress bar
34
 # in precheck.js the 'confirm box' will also check on substring 'script>' from input fields 
35
 forbidden=script>
36
 !if $forbidden isin $(reply$n)
37
  reply$n=hmmm...
38
  remark$n=<span style="color:red">@#! JAVASCRIPT !#@</span>
13043 schaersvoo 39
  modulescore=$[$modulescore/$total_exos]
40
  total_exos=$counter
41
  status=done
42
  !readproc $procdir/score.proc
43
  !exit
44
 !endif
45
 
46
 !readproc $checkfile
47
 
48
 !if $try>$maxtry
49
 # give some points for what was good...
50
  modulescore=$[$modulescore/$total_exos]
51
  total_exos=$counter
52
  status=done
53
  !readproc $procdir/score.proc
54
  !exit
55
 !endif
56
 
57
 !if $goback=1
58
  !increase try
59
  !exit
60
 !else
61
  !if $goodbadsign=2
62
   !if $maxscore>0.9
63
    fine=!randitem $ok
64
    clr=green
65
   !else
66
    !if $maxscore>0.4
67
     fine=!randitem $bok
68
     clr=#ff7900
338 schaersvoo 69
    !else
13043 schaersvoo 70
     fine=!randitem $nok
71
     clr=red
338 schaersvoo 72
    !endif
13043 schaersvoo 73
   !endif
74
   remark$n=!append line $ <br /><span style="color:$clr;font-style:italic;">$fine</span> $ to $(remark$n)
75
  !endif
76
  #wims_module_log=!append line $(answer$n) to $wims_module_log 
77
  !if $counter=$total_exos
78
   status=done
79
   !readproc $procdir/score.proc
80
   !exit
81
  !else
82
   counter=$[$counter+1]
83
   # reset maxscore 
84
   # in some checkfiles we give small penalties for little mistakes 
85
   # and maxscore=$[$penalty*$maxscore]
86
   maxscore=1
87
   goback=0
88
   errortext=$empty
89
   # typical: modulescore=$[$modulesecore + $maxscore]
90
   !readproc exos/exo$subject
91
  !endif
92
 !endif
338 schaersvoo 93
!endif