Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
20 reyssat 1
!nocache
2
stepdiag=bad
3
!for i=1 to $replycnt
12325 bpr 4
  !if r$i isitemof $gotsteps
5
    !if r$i isitemof $thisstep
6
      saverep$i=$(reply$i)
7
    !else
8
      reply$i=$(saverep$i)
8426 bpr 9
    !endif
12325 bpr 10
    r_=!trim $(reply$i)
11
    !if $r_=$empty
12
      default_$i=!getopt default in $(replyoption$i)
13
      !if $(default_$i)!=$empty
14
        r_=$(default_$i)
15
      !endif
16
    !endif
17
    !if $(replytype$i)!=code
13642 bpr 18
      reply$i=$r_
12325 bpr 19
    !endif
20
    !if $r_=$empty and $(replytype$i)!=coord || \
13642 bpr 21
        $click_x$click_y=$empty and $(replytype$i)=coord || \
22
        ($(reply$i)=?????? and $(replytype$i) iswordof menu)
23
      error=empty_data
24
      !exit
12325 bpr 25
    !endif
26
    m_reply$i=$(reply$i)
27
    !read oef/screply.proc
28
    !default replytype$i=default
29
    tt=!word 1 of $(replygood$i)
13642 bpr 30
    # analyzed reply
12325 bpr 31
    !if $tt=?analyze
32
      t_=!rows2lines $(replygood$i)
33
      t_=!word 2 of $t_
34
      !read oef/ans.proc $i nocompare
35
      !if $error!=$empty
36
        !exit
37
      !endif
38
      !default m_reply$i=$(reply$i)
39
      !default m_reply_$i=$(reply_$i)
40
      !default m_reply_$i=$(reply$i)
41
      !read oef/screply.proc
42
      val$t_=$(reply$i)
43
      !if NaN isin $test
44
        !goto badans
45
      !endif
46
      !goto cont
47
    !endif
48
    !read oef/ans.proc $i
49
    !default m_reply$i=$(reply$i)
50
    !default m_reply_$i=$(reply_$i)
51
    !default m_reply_$i=$(reply$i)
52
    !read oef/screply.proc
53
    !if bad isin $Test
54
      error=bad_exo
55
      !advance reply_cnt
56
      status=
57
      !exit
58
    !endif
59
    !if NaN isin $test
60
      :badans
61
      error=bad_answer
62
      bad_name=$(replyname$i)
63
      bad_value=$(reply$i)
64
      !exit
65
    !endif
66
    !if $(diareply$i)!=good and nonstop notwordof $(replyoption$i)
67
      !exit
68
    !endif
69
    :cont
8426 bpr 70
  !endif
20 reyssat 71
!next i
72
 
73
!for i=1 to $choicecnt
12325 bpr 74
  !if c$i isitemof $gotsteps
75
    !if c$i isitemof $thisstep
76
      savech$i=$(choice$i)
77
    !else
78
      choice$i=$(savech$i)
79
    !endif
80
    !default choice$i=0
81
    choic=$[rint($(choice$i))]
82
    !if $choic=0 and ($oefsteps=$empty or c$i isitemof $gotsteps)
83
      error=empty_data
84
      !exit
85
    !endif
86
    !if NaN isin $choic or $choic<1 or $choic>$(choiceitems$i)+2
87
      error=bad_answer
88
      bad_name=$(choicename$i)
89
      bad_value=$(choice$i)
90
      !exit
91
    !else
92
      choice$i=$choic
93
    !endif
94
    ch=!item $choic of $(choicelist$i)
95
    m_choice$i=$ch
96
    !if $qcmgood<1 and $choic=$[$(choiceitems$i)+2]
97
      !if $(choicegood$i)=$empty
98
        chh=good
99
      !else
100
        chh=bad
101
      !endif
102
    !endif
103
    !if ($choic>$(choiceitems$i) or $ch notitemof $(choicegood$i)) and $chh!=good
104
      !exit
105
    !endif
20 reyssat 106
  !endif
107
!next i
108
 
109
!advance oefstep
110
m_step=$oefstep
111
!if $dynsteps=yes
12325 bpr 112
  !read oef/nextstep.proc
20 reyssat 113
!endif
114
 
115
stepdiag=ok
116
thisstep=!line $oefstep of $oefsteps
117
gotsteps=!line 1 to $oefstep of $oefsteps
118
gotsteps=!lines2items $gotsteps