source: dialogmanager/src/main/resources/dialogdemoWithAdd.json@ 207

Last change on this file since 207 was 45, checked in by wouter, 5 years ago

#30 added "black box" (UpdateFunction) functionality and example app with Add

File size: 3.5 KB
Line 
1{
2 "specification": {
3 "phases": [
4 {
5 "label": "START",
6 "options": [
7 {
8 "OptionForParameters": {
9 "stimulus": {
10 "Textual": {
11 "question": "Please enter a random number between 0 and 10."
12 }
13 },
14 "answer": {
15 "NumberAnswer": {
16 "parameter": "random1",
17 "min": 0,
18 "max": 10,
19 "stepsize": 1
20 }
21 },
22 "param": {
23 "values": {
24 }
25 }
26 }
27 }
28 ],
29
30 "next": {
31 "goto":"NUM2"
32 }
33 },
34 {
35 "label": "NUM2",
36 "options": [
37 {
38 "OptionForParameters": {
39 "stimulus": {
40 "Textual": {
41 "question": "And please enter another random number between 0 and 10?"
42 }
43 },
44 "answer": {
45 "NumberAnswer": {
46 "parameter": "random2",
47 "min": 0,
48 "max": 10,
49 "stepsize": 1
50 }
51 },
52 "param": {
53 "values": {
54 }
55 }
56
57 }
58 }
59 ],
60 "next": {
61 "goto":"askSum"
62 }
63 },
64 {
65 "label": "askSum",
66 "options": [
67 {
68 "OptionForParameters": {
69 "stimulus": {
70 "Textual": {
71 "question": "Ok, what is their sum, so what is [random1] + [random2] ?"
72 }
73 },
74 "answer": {
75 "NumberAnswer": {
76 "parameter": "sum",
77 "min": 0,
78 "max": 20,
79 "stepsize": 1
80 }
81 },
82 "param": {
83 "values": {
84 }
85 }
86 }
87 }
88 ],
89 "updatefunction":{"EqualsFunction":[["random1","random2","sum"],["correctAnswer"]]},
90 "next": {
91 "gotoif": [
92 {
93 "label": "GOOD",
94 "condition": {
95 "values": {
96 "correctAnswer": {
97 "bool": true
98 }
99 }
100 }
101 },
102 {
103 "label": "WRONG",
104 "condition": {
105 "values": {
106 "correctAnswer": {
107 "bool": false
108 }
109 }
110 }
111 }
112 ]
113 }
114 },
115 {
116 "label": "GOOD",
117 "options": [
118 {
119 "OptionForParameters": {
120 "stimulus": {
121 "Textual": {
122 "question": "Yes, [random1] + [random2] = [sum]! Try again?"
123 }
124 },
125 "answer": {
126 "BoolAnswer": {
127 "parameter": "retry"
128 }
129 },
130 "param": {
131 "values": {
132 }
133 }
134
135 }
136 }
137 ],
138 "next": {
139 "gotoif": [
140 {
141 "label": "END",
142 "condition": {
143 "values": {
144 "retry": {
145 "bool": false
146 }
147 }
148 }
149 },
150 {
151 "label": "START",
152 "condition": {
153 "values": {
154 "retry": {
155 "bool": true
156 }
157 }
158 }
159 }
160 ]
161 }
162 },
163 {
164 "label": "WRONG",
165 "options": [
166 {
167 "OptionForParameters": {
168 "stimulus": {
169 "Textual": {
170 "question": "No, [random1] + [random2] is not [sum]... Try again?"
171 }
172 },
173 "answer": {
174 "BoolAnswer": {
175 "parameter": "retry"
176 }
177 },
178 "param": {
179 "values": {
180 }
181 }
182
183 }
184 }
185 ],
186 "next": {
187 "gotoif": [
188 {
189 "label": "END",
190 "condition": {
191 "values": {
192 "retry": {
193 "bool": false
194 }
195 }
196 }
197 },
198 {
199 "label": "START",
200 "condition": {
201 "values": {
202 "retry": {
203 "bool": true
204 }
205 }
206 }
207 }
208 ]
209 }
210 }
211 ]
212 },
213 "parameters": {
214 "values": {
215 "dialog.PhaseLabel": {
216 "txt": "START"
217 }
218 }
219 }
220}
Note: See TracBrowser for help on using the repository browser.