Client/Item/Field.pm

filter: Statementstmt 19.7% 36 / 182 Branchbran 4.6% 4 / 86 Conditioncond 11.1% 4 / 36 MC/DCmcdc 0.0% 0 / 21 Subroutinesub 37.5% 6 / 16 Podpod 9.0% 1 / 11 totaltotal 14.4% 51 / 352 CC 57 SCAR 50.9
CC
57
Cov
14%
execute
462.0
getUserInput
110.0
refetchUserInput
42.0
CRAP 161.9
↑ Summary Client/Engine.pm »
1 package VoiceXML::Client::Item::Field;
2  
3  
4 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6  
7 3 ▶use base qw (VoiceXML::Client::Item);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 ▶use VoiceXML::Client::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 3 ▶use VoiceXML::Client::Item::Prompt;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 =head1 COPYRIGHT AND LICENSE
12  
13
14 Copyright (C) 2007,2008 by Pat Deegan.
15 All rights reserved
16 http://voicexml.psychogenic.com
17  
18 This library is released under the terms of the GNU GPL version 3, making it available only for
19 free programs ("free" here being used in the sense of the GPL, see http://www.gnu.org for more details).
20 Anyone wishing to use this library within a proprietary or otherwise non-GPLed program MUST contact psychogenic.com to
21 acquire a distinct license for their application. This approach encourages the use of free software
22 while allowing for proprietary solutions that support further development.
23  
24  
25 This file is part of VoiceXML::Client.
26  
27
28
29 VoiceXML::Client is free software: you can redistribute it and/or modify
30 it under the terms of the GNU General Public License as published by
31 the Free Software Foundation, either version 3 of the License, or
32 (at your option) any later version.
33  
34 VoiceXML::Client is distributed in the hope that it will be useful,
35 but WITHOUT ANY WARRANTY; without even the implied warranty of
36 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37 GNU General Public License for more details.
38  
39 You should have received a copy of the GNU General Public License
40 along with VoiceXML::Client. If not, see <http://www.gnu.org/licenses/>.
41  
42  
43 =cut
44  
45  
46  
47  
48 3 ▶use vars qw{
Subroutine BEGIN: called CC=1 SCAR=0.0
49 $VERSION
50 $DefaultNumDigits
51 3 };
52  
53 3 $VERSION = $VoiceXML::Client::Item::VERSION;
54  
55 3 $DefaultNumDigits = 1;
56  
57  
58  
59  
60 1 ▶sub init {
Subroutine init: called CC=11 SCAR=30.4
Pod documented
61 1 my $self = shift;
62
63 1 ▶ unless (defined $self->{'name'})
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"name"}) 1 0 1
64 {
65 1 ▶ $self->{'name'} = $self->{'XMLElement'}->attribute('name') || int(rand(999999)) . time();
Condition33%1/3
$self->{'XMLElement'}->attribute('name') || int(rand 999999) . time
l!l&&r!l&&!r
100
MC/DC0%0/2
$self->{'XMLElement'}->attribute('name') || int(rand 999999) . time
$self->{'XMLElement'}->attribute('name') int(rand 999999) . time
Truth table33%1/3
A || B
A= $self->{'XMLElement'}->attribute('name')B= int(rand 999999) . time
ABresult
1X1
011
000
66
67 }
68
69 1 ▶ $self->{'type'} = $self->{'XMLElement'}->attribute('type') || 'digits';
Condition50%1/2
$self->{'XMLElement'}->attribute('type') || 'digits'
l!l
10
MC/DC0%0/1
$self->{'XMLElement'}->attribute('type') || 'digits'
$self->{'XMLElement'}->attribute('type')
Truth table50%1/2
A
A= $self->{'XMLElement'}->attribute('type')
Aresult
11
00
70
71 1 ▶ if ($self->{'type'} eq 'digits')
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'type'} eq 'digits') { } 1 0 1
72 {
73 1 ▶ $self->{'numdigits'} = $self->{'XMLElement'}->attribute('numdigits') || $DefaultNumDigits;
Condition33%1/3
$self->{'XMLElement'}->attribute('numdigits') || $VoiceXML::Client::Item::Field::DefaultNumDigits
l!l&&r!l&&!r
100
MC/DC0%0/2
$self->{'XMLElement'}->attribute('numdigits') || $VoiceXML::Client::Item::Field::DefaultNumDigits
$self->{'XMLElement'}->attribute('numdigits') $VoiceXML::Client::Item::Field::DefaultNumDigits
Truth table33%1/3
A || B
A= $self->{'XMLElement'}->attribute('numdigits')B= $VoiceXML::Client::Item::Field::DefaultNumDigits
ABresult
1X1
011
000
74
75 1 ▶ if ($self->{'numdigits'} && $self->{'numdigits'} >= 1)
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'numdigits'} and $self->{'numdigits'} >= 1) { } 1 0 1
Condition33%1/3
$self->{"numdigits"} and $self->{"numdigits"} >= 1
!ll&&!rl&&r
001
MC/DC0%0/2
$self->{"numdigits"} and $self->{"numdigits"} >= 1
$self->{"numdigits"} $self->{"numdigits"} >= 1
Truth table33%1/3
A and B
A= $self->{"numdigits"}B= $self->{"numdigits"} >= 1
ABresult
0X0
100
111
76 {
77 1 $self->{'inputmode'} = $VoiceXML::Client::DeviceHandle::InputMode{'FIXEDDIGIT'};
78 1 ▶ VoiceXML::Client::Util::log_msg("Setting input mode to FIXED ($self->{'numdigits'}) for field $self->{'name'}")
Branch: 1 branch
BranchTrueFalseTotal
if $VoiceXML::Client::Debug 0 1 1
79 if ($VoiceXML::Client::Debug);
80 } else {
81 0 $self->{'inputmode'} = $VoiceXML::Client::DeviceHandle::InputMode{'MULTIDIGIT'};
82 0 ▶ VoiceXML::Client::Util::log_msg("Setting input mode to MULTIDIGIT for field $self->{'name'}")
Branch: 1 branch
BranchTrueFalseTotal
if $VoiceXML::Client::Debug 0 0 0
83 if ($VoiceXML::Client::Debug);
84 }
85
86 } else {
87 0 $self->{'numdigits'} = '';
88 0 $self->{'inputmode'} = $VoiceXML::Client::DeviceHandle::InputMode{'MULTIDIGIT'};
89
90 0 ▶ VoiceXML::Client::Util::log_msg("Defaulting to MULTIDIGIT mode for field $self->{'name'}")
Branch: 1 branch
BranchTrueFalseTotal
if $VoiceXML::Client::Debug 0 0 0
91 if ($VoiceXML::Client::Debug);
92 }
93
94
95 1 VoiceXML::Client::Item::Util->declareVariable($self, $self->{'name'});
96
97 1 $self->{'noinput'} = [];
98 1 $self->{'nomatch'} = [];
99 1 $self->{'timeswithoutinput'} = 0;
100 1 $self->{'timesnomatchinput'} = 0;
101 1 $self->{'lastinputstate'} = '';
102 1 $self->{'infilledelement'} = 0;
103
104 1 $self->{'currentinputtimeout'} = $VoiceXML::Client::Item::Prompt::DefaultTimeoutSeconds;
105
106 1 return 1;
107
108
109 }
110  
111 0 ▶sub inputReceivedInterrupt {
Subroutine inputReceivedInterrupt: not called CC=2 SCAR=17.9
Pod undocumented
112 0 my $self = shift;
113 0 my $handle = shift;
114 0 my $input = shift;
115
116 0 $handle->deleteInputReceivedCallback('fieldinput_' . $self->{'name'});
117  
118 0 ▶ if ($self->{'infilledelement'})
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'infilledelement'}) { } 0 0 0
119 {
120
121 0 $self->abortProcessing(0) ;
122 } else {
123
124 0 $self->abortProcessing(1) ;
125 }
126
127
128 0 return;
129 }
130
131 0 ▶sub execute {
Subroutine execute: not called CC=21 SCAR=61.4
Pod undocumented
132 0 my $self = shift;
133 0 my $handle = shift;
134 0 my $optParams = shift;
135
136 0 $self->clearValue();
137 0 $handle->registerInputReceivedCallback('fieldinput_' . $self->{'name'}, $self, 'inputReceivedInterrupt');
138
139 0 $handle->inputMode($self->{'inputmode'}, $self->{'numdigits'});
140
141
142
143 0 ▶ for (my $i=0; $i < @{$self->{'children'}}; $i++)
Branch: 1 branch
BranchTrueFalseTotal
if ($i < @{$self->{"children"};}) 0 0 0
144 {
145 0 ▶ my $aChild = $self->{'children'}->[$i] || next;
Condition0%0/2
$self->{'children'}[$i] || (next)
l!l
00
MC/DC0%0/1
$self->{'children'}[$i] || (next)
$self->{'children'}[$i]
Truth table0%0/2
A
A= $self->{'children'}[$i]
Aresult
11
00
146
147 0 my $cType = $aChild->getType();
148
149 0 ▶ if ($cType eq 'VoiceXML::Client::Item::NoInput')
Branch: 2 branches
BranchTrueFalseTotal
if ($cType eq 'VoiceXML::Client::Item::NoInput') { } 0 0 0
elsif ($cType eq 'VoiceXML::Client::Item::NoMatch') { } 0 0 0
150 {
151 0 push @{$self->{'noinput'}}, $aChild;
152 } elsif ($cType eq 'VoiceXML::Client::Item::NoMatch')
153 {
154
155 0 push @{$self->{'nomatch'}}, $aChild;
156 }
157 }
158
159
160 0 my $fillFound = 0;
161 0 ▶ while (my $curChild = $self->getCurrentChild())
Branch: 1 branch
BranchTrueFalseTotal
if (my $curChild = $self->getCurrentChild) 0 0 0
162 {
163
164 0 my $cType = $curChild->getType();
165 0 ▶ if ($cType eq 'VoiceXML::Client::Item::Filled')
Branch: 1 branch
BranchTrueFalseTotal
if ($cType eq 'VoiceXML::Client::Item::Filled') { } 0 0 0
166 {
167 0 $self->{'infilledelement'} = 1;
168 } else {
169 0 $self->{'infilledelement'} = 0;
170 }
171
172 0 ▶ if ($self->haveUserInput($handle, $optParams))
Branch: 1 branch
BranchTrueFalseTotal
if ($self->haveUserInput($handle, $optParams)) 0 0 0
173 {
174 # the user has barged in... fugget about it--this is a barge in... we don't want to do
175 # anything except deal with the filled element if present and collect any remaining input
176
177
178 0 $self->abortProcessing(0);
179
180 0 ▶ VoiceXML::Client::Util::log_msg("Field -- detected user input...") if ($VoiceXML::Client::Debug > 1);
Branch: 1 branch
BranchTrueFalseTotal
if $VoiceXML::Client::Debug > 1 0 0 0
181
182
183
184 0 ▶ unless ($self->{'infilledelement'})
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"infilledelement"}) 0 0 0
185 {
186 0 ▶ VoiceXML::Client::Util::log_msg("skipping $cType item") if ($VoiceXML::Client::Debug > 1);
Branch: 1 branch
BranchTrueFalseTotal
if $VoiceXML::Client::Debug > 1 0 0 0
187 0 $self->proceedToNextChild();
188 0 next;
189 }
190 0 ▶ VoiceXML::Client::Util::log_msg("Dealing with the <filled> item") if ($VoiceXML::Client::Debug > 1);
Branch: 1 branch
BranchTrueFalseTotal
if $VoiceXML::Client::Debug > 1 0 0 0
191 }
192
193  
194 0 ▶ if ($curChild->can('timeoutSeconds'))
Branch: 1 branch
BranchTrueFalseTotal
if ($curChild->can("timeoutSeconds")) 0 0 0
195 {
196 0 ▶ $self->{'currentinputtimeout'} =
Condition0%0/3
$curChild->timeoutSeconds || $VoiceXML::Client::Item::Prompt::DefaultTimeoutSeconds
l!l&&r!l&&!r
000
MC/DC0%0/2
$curChild->timeoutSeconds || $VoiceXML::Client::Item::Prompt::DefaultTimeoutSeconds
$curChild->timeoutSeconds $VoiceXML::Client::Item::Prompt::DefaultTimeoutSeconds
Truth table0%0/3
A || B
A= $curChild->timeoutSecondsB= $VoiceXML::Client::Item::Prompt::DefaultTimeoutSeconds
ABresult
1X1
011
000
197 $curChild->timeoutSeconds()
198 || $VoiceXML::Client::Item::Prompt::DefaultTimeoutSeconds;
199 }
200
201 0 ▶ if ($self->{'infilledelement'})
Branch: 2 branches
BranchTrueFalseTotal
if ($self->{'infilledelement'}) { } 0 0 0
elsif ($cType eq 'VoiceXML::Client::Item::NoInput' or $cType eq 'VoiceXML::Client::Item::NoMatch') { } 0 0 0
202 {
203 # we are in a <filled> element...
204 0 $fillFound = 1;
205
206 0 $self->abortProcessing(0);
207 # we might just be done here... let's see
208
209 0 ▶ unless ($self->getUserInput($handle, $optParams))
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->getUserInput($handle, $optParams)) 0 0 0
210 {
211 0 return $self->refetchUserInput($handle, $optParams);
212 }
213
214 ▶ } elsif ($cType eq 'VoiceXML::Client::Item::NoInput' || $cType eq 'VoiceXML::Client::Item::NoMatch')
Condition0%0/3
$cType eq "VoiceXML::Client::Item::NoInput" or $cType eq "VoiceXML::Client::Item::NoMatch"
l!l&&r!l&&!r
000
MC/DC0%0/2
$cType eq "VoiceXML::Client::Item::NoInput" or $cType eq "VoiceXML::Client::Item::NoMatch"
$cType eq "VoiceXML::Client::Item::NoInput" $cType eq "VoiceXML::Client::Item::NoMatch"
Truth table0%0/3
A or B
A= $cType eq "VoiceXML::Client::Item::NoInput"B= $cType eq "VoiceXML::Client::Item::NoMatch"
ABresult
1X1
011
000
215 {
216 # skip these...
217 0 $self->proceedToNextChild();
218 0 next;
219 }
220
221
222 0 my $rv = $curChild->execute($handle, $optParams) ;
223
224 0 ▶ return $rv if ($rv != $VoiceXML::Client::Flow::Directive{'CONTINUE'});
Branch: 1 branch
BranchTrueFalseTotal
if $rv != $VoiceXML::Client::Flow::Directive{"CONTINUE"} 0 0 0
225
226 0 $self->proceedToNextChild();
227 }
228
229 0 ▶ unless ($fillFound)
Branch: 1 branch
BranchTrueFalseTotal
unless ($fillFound) 0 0 0
230 {
231 # no filled element... need some input
232 0 $self->abortProcessing(0);
233 0 ▶ unless ($self->getUserInput($handle, $optParams))
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->getUserInput($handle, $optParams)) 0 0 0
234 {
235 0 return $self->refetchUserInput($handle, $optParams);
236 }
237 }
238
239 0 return $VoiceXML::Client::Flow::Directive{'CONTINUE'};
240
241 }
242  
243 0 ▶sub reset {
Subroutine reset: not called CC=1 SCAR=6.9
Pod undocumented
244 0 my $self = shift;
245 0 my $vxmlDoc = $self->getParentVXMLDocument();
246 0 $vxmlDoc->clearGlobalVar($self->{'name'});
247 0 $self->SUPER::reset();
248 }
249  
250 0 ▶sub getBestNoInputItem {
Subroutine getBestNoInputItem: not called CC=5 SCAR=34.0
Pod undocumented
251 0 my $self = shift;
252 0 my $handle = shift;
253 0 my $optParams = shift;
254
255
256 0 my $lastCountMatch = 0;
257  
258 0 my $noInputMatch = $self->{'noinput'}->[0];
259 0 my $idx = 1;
260 0 ▶ while ($idx < scalar @{$self->{'noinput'}})
Branch: 1 branch
BranchTrueFalseTotal
if ($idx < scalar @{$self->{"noinput"};}) 0 0 0
261 {
262 0 my $niItem = $self->{'noinput'}->[$idx];
263 0 ▶ if ($niItem
Branch: 1 branch
BranchTrueFalseTotal
if ($niItem and $niItem->{"count"} <= $self->{"timeswithoutinput"} and $niItem->{"count"} > $lastCountMatch) 0 0 0
Condition0%0/6
$niItem and $niItem->{"count"} <= $self->{"timeswithoutinput"} and $niItem->{"count"} > $lastCountMatch
!ll&&!rl&&r
000
$niItem and $niItem->{"count"} <= $self->{"timeswithoutinput"}
!ll&&!rl&&r
000
MC/DC0%0/3
$niItem and $niItem->{"count"} <= $self->{"timeswithoutinput"} and $niItem->{"count"} > $lastCountMatch
$niItem $niItem->{"count"} <= $self->{"timeswithoutinput"} $niItem->{"count"} > $lastCountMatch
Truth table0%0/4
A and B and C
A= $niItemB= $niItem->{"count"} <= $self->{"timeswithoutinput"}C= $niItem->{"count"} > $lastCountMatch
ABCresult
0XX0
10X0
1100
1111
264 && $niItem->{'count'} <= $self->{'timeswithoutinput'}
265 && $niItem->{'count'} > $lastCountMatch)
266 {
267 0 $lastCountMatch = $niItem->{'count'};
268 0 $noInputMatch = $niItem;
269 }
270
271 0 $idx++;
272 }
273
274 0 return $noInputMatch;
275 }
276  
277  
278 0 ▶sub getBestNoMatchItem {
Subroutine getBestNoMatchItem: not called CC=5 SCAR=34.0
Pod undocumented
279 0 my $self = shift;
280 0 my $handle = shift;
281 0 my $optParams = shift;
282
283
284 0 my $lastCountMatch = 0;
285  
286 0 my $nomatchMatch = $self->{'nomatch'}->[0];
287 0 my $idx = 1;
288 0 ▶ while ($idx < scalar @{$self->{'nomatch'}})
Branch: 1 branch
BranchTrueFalseTotal
if ($idx < scalar @{$self->{"nomatch"};}) 0 0 0
289 {
290 0 my $niItem = $self->{'nomatch'}->[$idx];
291 0 ▶ if ($niItem
Branch: 1 branch
BranchTrueFalseTotal
if ($niItem and $niItem->{"count"} <= $self->{"timesnomatchinput"} and $niItem->{"count"} > $lastCountMatch) 0 0 0
Condition0%0/6
$niItem and $niItem->{"count"} <= $self->{"timesnomatchinput"} and $niItem->{"count"} > $lastCountMatch
!ll&&!rl&&r
000
$niItem and $niItem->{"count"} <= $self->{"timesnomatchinput"}
!ll&&!rl&&r
000
MC/DC0%0/3
$niItem and $niItem->{"count"} <= $self->{"timesnomatchinput"} and $niItem->{"count"} > $lastCountMatch
$niItem $niItem->{"count"} <= $self->{"timesnomatchinput"} $niItem->{"count"} > $lastCountMatch
Truth table0%0/4
A and B and C
A= $niItemB= $niItem->{"count"} <= $self->{"timesnomatchinput"}C= $niItem->{"count"} > $lastCountMatch
ABCresult
0XX0
10X0
1100
1111
292 && $niItem->{'count'} <= $self->{'timesnomatchinput'}
293 && $niItem->{'count'} > $lastCountMatch)
294 {
295 0 $lastCountMatch = $niItem->{'count'};
296 0 $nomatchMatch = $niItem;
297 }
298
299 0 $idx++;
300 }
301
302 0 return $nomatchMatch;
303 }
304
305  
306 0 ▶sub refetchUserInput {
Subroutine refetchUserInput: not called CC=6 SCAR=37.4
Pod undocumented
307 0 my $self = shift;
308 0 my $handle = shift;
309 0 my $optParams = shift;
310  
311  
312
313 0 ▶ if ($self->{'lastinputstate'} eq 'none')
Branch: 2 branches
BranchTrueFalseTotal
if ($self->{'lastinputstate'} eq 'none') { } 0 0 0
elsif ($self->{'lastinputstate'} eq 'invalid') { } 0 0 0
314 {
315 0 ▶ if (scalar @{$self->{'noinput'}})
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @{$self->{"noinput"};}) 0 0 0
316 {
317 0 my $noInputMatch = $self->getBestNoInputItem($handle, $optParams);
318
319 0 ▶ if ($noInputMatch)
Branch: 1 branch
BranchTrueFalseTotal
if ($noInputMatch) 0 0 0
320 {
321 0 return $noInputMatch->execute($handle, $optParams);
322 }
323 }
324 } elsif ($self->{'lastinputstate'} eq 'invalid')
325 {
326
327 0 $self->reset();
328 0 my $noMatchInputItem = $self->getBestNoMatchItem();
329
330 0 ▶ if ($noMatchInputItem)
Branch: 1 branch
BranchTrueFalseTotal
if ($noMatchInputItem) 0 0 0
331 {
332 0 return $noMatchInputItem->execute($handle, $optParams);
333 }
334 }
335
336
337 0 $self->{'parent'}->reset();
338 0 return $self->{'parent'}->execute($handle, $optParams);
339 }
340  
341 0 ▶sub haveUserInput {
Subroutine haveUserInput: not called CC=2 SCAR=17.9
Pod undocumented
342 0 my $self = shift;
343 0 ▶ my $handle = shift || return undef;
Condition0%0/2
shift() || (return undef)
l!l
00
MC/DC0%0/1
shift() || (return undef)
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
344 0 my $optParams = shift;
345
346
347 0 return $handle->pendingInputLength();
348 }
349  
350  
351 0 ▶sub getUserInput {
Subroutine getUserInput: not called CC=10 SCAR=47.0
Pod undocumented
352 0 my $self = shift;
353 0 my $handle = shift;
354 0 my $optParams = shift;
355
356
357  
358 0 my $number = $handle->readnum(undef, $self->{'currentinputtimeout'}, 1, $self->{'numdigits'});
359 0 ▶ if ($VoiceXML::Client::Debug > 1)
Branch: 1 branch
BranchTrueFalseTotal
if ($VoiceXML::Client::Debug > 1) 0 0 0
360 {
361 0 ▶ my $gotnum = (defined $number) ? $number : '';
Branch: 1 branch
BranchTrueFalseTotal
defined $number ? : 0 0 0
362 0 VoiceXML::Client::Util::log_msg("Field::getUserInput got '$gotnum' from handle");
363 }
364
365 0 ▶ if (defined $number && length($number))
Branch: 1 branch
BranchTrueFalseTotal
if (defined $number and length $number) 0 0 0
Condition0%0/3
defined $number and length $number
!ll&&!rl&&r
000
MC/DC0%0/2
defined $number and length $number
defined $number length $number
Truth table0%0/3
A and B
A= defined $numberB= length $number
ABresult
0X0
100
111
366 {
367 # got some input...
368 0 $self->{'timeswithoutinput'} = 0;
369
370 0 ▶ if (scalar @{$self->{'nomatch'}})
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @{$self->{'nomatch'};}) { } 0 0 0
371 {
372 # we have some nomatch fields... better check if this input is valid
373 # according to our grammmars...
374
375 0 my $parentForm = $self->getParentForm();
376
377 0 ▶ if ($parentForm->inputValidAccordingToGrammar($number))
Branch: 1 branch
BranchTrueFalseTotal
if ($parentForm->inputValidAccordingToGrammar($number)) 0 0 0
378 {
379 # huzzah!
380 0 $self->value($number);
381
382 0 return 1;
383 }
384
385 # the input came in, but was invalid and we have nomatch set...
386
387 0 ▶ VoiceXML::Client::Util::log_msg("Field user input considered invalid") if ($VoiceXML::Client::Debug);
Branch: 1 branch
BranchTrueFalseTotal
if $VoiceXML::Client::Debug 0 0 0
388 0 $self->{'lastinputstate'} = 'invalid';
389 0 $self->{'timesnomatchinput'}++;
390 0 return 0;
391
392 } else {
393
394 # no nomatches set... so no checking, just set the value
395 # whatever it may be...
396
397 0 $self->value($number);
398
399 0 ▶ VoiceXML::Client::Util::log_msg("Setting user input to '$number'") if ($VoiceXML::Client::Debug);
Branch: 1 branch
BranchTrueFalseTotal
if $VoiceXML::Client::Debug 0 0 0
400
401 0 return 1;
402 }
403 }
404
405 0 ▶ VoiceXML::Client::Util::log_msg("Field: no user input received") if ($VoiceXML::Client::Debug);
Branch: 1 branch
BranchTrueFalseTotal
if $VoiceXML::Client::Debug 0 0 0
406
407 0 $self->{'timeswithoutinput'}++;
408 0 $self->{'lastinputstate'} = 'none';
409
410 0 return 0;
411 }
412  
413 0 ▶sub value {
Subroutine value: not called CC=3 SCAR=24.8
Pod undocumented
414 0 my $self = shift;
415 0 my $setTo = shift;
416
417 0 my $vxmlDoc = $self->getParentVXMLDocument();
418
419
420
421 0 ▶ if (defined $setTo)
Branch: 1 branch
BranchTrueFalseTotal
if (defined $setTo) 0 0 0
422 {
423
424 0 $self->{'lastinputstate'} = 'valid';
425
426 0 ▶ VoiceXML::Client::Util::log_msg("Field setting variable " . $self->{'name'} . " to $setTo")
Branch: 1 branch
BranchTrueFalseTotal
if $VoiceXML::Client::Debug 0 0 0
427 if ($VoiceXML::Client::Debug);
428
429 0 $vxmlDoc->globalVar($self->{'name'}, $setTo);
430 }
431
432 0 return $vxmlDoc->globalVar($self->{'name'});
433 }
434  
435 0 ▶sub clearValue {
Subroutine clearValue: not called CC=1 SCAR=6.9
Pod undocumented
436 0 my $self = shift;
437
438 0 VoiceXML::Client::Item::Util->resetVariable($self, $self->{'name'});
439
440 }
441
442
443  
444
445
446  
447  
448 3 1;
↑ Summary Client/Engine.pm »