-
Notifications
You must be signed in to change notification settings - Fork 1
/
mainEn.xml
154 lines (142 loc) · 5.63 KB
/
mainEn.xml
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<!--English Language-->
<form id="mainEn">
<field name="choosevote_or_opinion">
<prompt>Do you want to vote, or do you want to express an opinion?</prompt>
<noinput>Please say Vote or Opinion.</noinput>
<grammar mode="voice" root="vop">
<rule id="vop" scope="public">
<one-of>
<item>vote</item>
<item>opinion</item>
</one-of>
</rule>
</grammar>
</field>
<filled>
<if cond="choosevote_or_opinion == 'vote'">You choose to vote.
<assign name="vote_or_opinion" expr="'0'"/>
<goto next="#voteEn"/>
<else/>You choose to express your opinion.
<assign name="vote_or_opinion" expr="'1'"/>
<goto next="#opinionEn"/>
</if>
</filled>
</form>
<form id="voteEn"> <!--Vote part-->
<field name="choosevote">
<prompt>What is your vote? Say yes if you agree and no if you disagree.</prompt>
<help>Please say Yes or No.</help>
<grammar mode="voice" root="vop2">
<rule id="vop2" scope="public">
<one-of>
<item>yes</item>
<item>no</item>
</one-of>
</rule>
</grammar>
</field>
<filled>
<assign name="voteText" expr="choosevote"/>
<if cond="choosevote == 'yes'">
<assign name="choice" expr="'1'"/>
<else/>
<assign name="choice" expr="'0'"/>
</if>
<goto next="#voteFormEn"/>
</filled>
</form>
<form id="voteFormEn"> <!--Vote Yes-->
<field name="choosevoteYes">
<prompt>You choose <value expr="voteText" /> as your vote.</prompt>
<prompt>Are you sure that your vote is corect?</prompt>
<help>Please say Yes or No.</help>
<grammar mode="voice" root="vopYes">
<rule id="vopYes" scope="public">
<one-of>
<item>yes</item>
<item>no</item>
</one-of>
</rule>
</grammar>
</field>
<filled>
<if cond="choosevoteYes == 'no'">
<goto next="#mainEn"/>
<else/>
<goto next="#opinionAfterVoteEn"/>
</if>
</filled>
</form>
<form id="opinionAfterVoteEn"> <!--Opinion AFTER Voting-->
<field name="opinionAfterVote">
<prompt>Do you also want to express your opinion?</prompt>
<noinput>Please say Yes or No.</noinput>
<nomatch>Please say Yes or No.</nomatch>
<grammar mode="voice" root="vfy">
<rule id="vfy" scope="public">
<one-of>
<item>yes</item>
<item>no</item>
</one-of>
</rule>
</grammar>
</field>
<filled>
<if cond="opinionAfterVote == 'no'">
<goto next="#postResult"/>
<else/>
<assign name="vote_or_opinion" expr="'2'"/>
<goto next="#opinionEn"/>
</if>
</filled>
</form>
<form id="opinionEn"> <!--Opinion-->
<record name="msg" beep="true" maxtime="10s" finalsilence="2000ms"
dtmfterm="true" type="audio/x-wav">
<prompt timeout="2s" bargein="false">
Record your opinion after the beep.
</prompt>
<noinput>
I didn't hear anything, please try again.
</noinput>
</record>
<field name="confirm">
<prompt>
Your opinion is <audio expr="msg"/>.
</prompt>
<prompt>
To keep it, say yes. To discard it, say no.
</prompt>
<grammar mode="voice" root="vfy">
<rule id="vfy" scope="public">
<one-of>
<item>yes</item>
<item>no</item>
</one-of>
</rule>
</grammar>
<filled>
<assign name="opinion" expr="msg"/>
<if cond="confirm == 'yes'">
<goto next="#postResult"/>
</if>
</filled>
</field>
</form>
<form id="postResult"> <!--Opinion-->
<block>
<assign name="key" expr="'bipvote'"/>
<if cond="vote_or_opinion == '0'">
<assign name="opinion" expr="'0'"/>
<elseif cond="vote_or_opinion == '1'"/>
<assign name="choice" expr="'0'"/>
</if>
<assign name="lang" expr="'en'"/>
<submit enctype="multipart/form-data"
method="post" namelist="opinion choice vote_or_opinion key lang" next="https://bipvote.ml/vote/" />
<clear/>
</block>
</form>
</vxml>