File: step.proc

package info (click to toggle)
wims 2%3A4.30%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 185,332 kB
  • sloc: xml: 366,687; javascript: 120,570; java: 62,170; ansic: 61,221; sh: 7,747; perl: 3,939; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (118 lines) | stat: -rw-r--r-- 2,785 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
!nocache
stepdiag=bad
!for i=1 to $replycnt
  !if r$i isitemof $gotsteps
    !if r$i isitemof $thisstep
      saverep$i=$(reply$i)
    !else
      reply$i=$(saverep$i)
    !endif
    r_=!trim $(reply$i)
    !if $r_=$empty
      default_$i=!getopt default in $(replyoption$i)
      !if $(default_$i)!=$empty
        r_=$(default_$i)
      !endif
    !endif
    !if $(replytype$i)!=code
      reply$i=$r_
    !endif
    !if $r_=$empty and $(replytype$i)!=coord || \
        $click_x$click_y=$empty and $(replytype$i)=coord || \
        ($(reply$i)=?????? and $(replytype$i) iswordof menu)
      error=empty_data
      !exit
    !endif
    m_reply$i=$(reply$i)
    !read oef/screply.proc
    !default replytype$i=default
    tt=!word 1 of $(replygood$i)
    # analyzed reply
    !if $tt=?analyze
      t_=!rows2lines $(replygood$i)
      t_=!word 2 of $t_
      !read oef/ans.proc $i nocompare
      !if $error!=$empty
        !exit
      !endif
      !default m_reply$i=$(reply$i)
      !default m_reply_$i=$(reply_$i)
      !default m_reply_$i=$(reply$i)
      !read oef/screply.proc
      val$t_=$(reply$i)
      !if NaN isin $test
        !goto badans
      !endif
      !goto cont
    !endif
    !read oef/ans.proc $i
    !default m_reply$i=$(reply$i)
    !default m_reply_$i=$(reply_$i)
    !default m_reply_$i=$(reply$i)
    !read oef/screply.proc
    !if bad isin $Test
      error=bad_exo
      !advance reply_cnt
      status=
      !exit
    !endif
    !if NaN isin $test
      :badans
      error=bad_answer
      bad_name=$(replyname$i)
      bad_value=$(reply$i)
      !exit
    !endif
    !if $(diareply$i)!=good and nonstop notwordof $(replyoption$i)
      !exit
    !endif
    :cont
  !endif
!next i

!for i=1 to $choicecnt
  !if c$i isitemof $gotsteps
    !if c$i isitemof $thisstep
      savech$i=$(choice$i)
    !else
      choice$i=$(savech$i)
    !endif
    !default choice$i=0
    choic=$[rint($(choice$i))]
    !if $choic=0 and ($oefsteps=$empty or c$i isitemof $gotsteps)
      error=empty_data
      !exit
    !endif
    !if NaN isin $choic or $choic<1 or $choic>$(choiceitems$i)+2
      error=bad_answer
      bad_name=$(choicename$i)
      bad_value=$(choice$i)
      !exit
    !else
      choice$i=$choic
    !endif
    ch=!item $choic of $(choicelist$i)
    m_choice$i=$ch
    !if $qcmgood<1 and $choic=$[$(choiceitems$i)+2]
      !if $(choicegood$i)=$empty
        chh=good
      !else
        chh=bad
      !endif
    !endif
    !if ($choic>$(choiceitems$i) or $ch notitemof $(choicegood$i)) and $chh!=good
      !exit
    !endif
  !endif
!next i

!advance oefstep
m_step=$oefstep
!if $dynsteps=yes
  !read oef/nextstep.proc
!endif

stepdiag=ok
thisstep=!line $oefstep of $oefsteps
gotsteps=!line 1 to $oefstep of $oefsteps
gotsteps=!lines2items $gotsteps