Engineering Full Stack Apps with Java and JavaScript
1. What are prompt counter?
An input item and the <initial> item of a mixed-initiative form have a prompt counter that lets you play different prompts if the user revisits the item several times. For example, you may want to play shorter descriptions after the first or second time the user is prompted for the same information. The prompt counters are reset on each form invocation.
<field name="fruit">
<prompt count="1">
Pick a fruit.
<break size="medium"/>
</prompt>
<prompt count="2">
Say the name of a fruit. For example, say apple.
<break size="medium"/>
</prompt>
……..
2. Differentiate between application-directed and mixed-initiative interactions?
In an application-directed (or simply directed) interaction, the application prompts for the information it needs and the user supplies the requested information by answering the prompts. The application controls the interaction and does not understand volunteered information:
In a mixed-initiative interaction, the user and the application both participate in determining what the application does next. A single utterance from the user may provide input for multiple input variables in a form. In response to a prompt in one dialog, the user may provide input that matches a grammar defined in a different form. When this happens, the interpreter transitions to that dialog and fills its input variables from the user input. Similarly, the user may provide input that selects a choice from a different menu or that matches a link grammar, causing a transition to the destination specified by that choice or link. If an application does not use links or grammars with document or application scope, it may still include mixed-initiative forms.
A directed form has no form grammar, only grammars for its individual fields. A directed form gives the user explicit directions about what to say and when. A form that includes its own grammar is a mixed-initiative form. The form grammar allows several input variables to be filled in as a result of a single user utterance. A mixed-initiative form allows the user to speak more naturally.
3. Within a form, the flow of execution is governed by the………. , a looping algorithm.
Form Interpretation Algorithm (FIA)
4. Where do you specify the URI of the application's root document?
In the application attribute of the vxml element.
5. List down the predefined events in vxml?
6. List down the predefined errors in vxml?
7. Give one major difference between subdialogues in vxml 1.0 and vxml 2.0?
In VoiceXML 1.0, when a subdialog throws an event,subdialogs are modal by default; a subdialog can be made non-modal by setting the modal attribute to false. In VoiceXML 2.0, all subdialogs are modal.
8. ………. is the required scripting language for VoiceXML.
ECMAScript
9. Differentiate between timeout, interdigittimeout and termtimeout for DTMF input?
The timeout parameter determines when the <noinput> event is thrown because the user has failed to enter any DTMF. Once the first DTMF has been entered, this parameter has no further effect.
The interdigittimeout determines when the nomatch event is thrown because a DTMF grammar is not yet recognized, and the user has failed to enter additional DTMF. This applies only once he starts entering any DTMF.
Once a successful DTMF has been entered and when no additional input is allowed by the grammar, termtimeout determines how much time to wait for the optional termchar. If the termtimeout is 0s (the default), then the recognized value is returned immediately after the last DTMF allowed by the grammar, without waiting for the optional termchar.
While waiting for the first or additional DTMF, three different timeouts may determine when the user's input is considered complete.
At each point, the user may enter DTMF which is not permitted by the active grammar(s). This causes the collected DTMF string to be invalid. Additional digits will be collected until either the termchar is pressed or the interdigittimeout has elapsed. A nomatch event is then generated.
10. How does FIA selects which form item to visit next?
Within a form, the flow of execution is governed by the Form Interpretation Algorithm (FIA), a looping algorithm. On each iteration, the FIA selects the form item to visit next.
A form item’s guard conditions determine whether it can be selected on a given iteration:
Both guard conditions must be met in order for a form item to be selected. The FIA examines the form items in document order, selecting the first one whose guard conditions are met. If the guard conditions for all form items fail, the form (and the application) exits.
By default, every form-item variable has an initial value of undefined so every form item that does not specify a cond expression is eligible for selection. After the form item is visited, its variable is set to a value, which prevents the same form item from being selected again on the next iteration.
11. How are events handled during an FIA execution?
During FIA execution, events may be generated at several points. These events are processed differently depending on which phase is active.
12. List down the major phases of an FIA algorithm?
13. Briefly explain the Initialization phase of FIA?
Whenever a form is entered, it is initialized. Internal prompt counter variables (in the form's dialog scope) are reset to 1. Each variable (form-level <var> elements and form item variables) is initialized, in document order, to undefined or to the value of the relevant expr attribute.
14. Give a case in FIA where first iteration of the main loop skips the select and collect phases, and goes right to the process phase?
If the FIA is given an input (a set of grammar slot/slot value pairs) that was collected while the user was in a different form's FIA. In this case the first iteration of the main loop skips the select and collect phases, and goes right to the process phase with that input. Also note that if an error occurs in the select or collect phase that causes an event to be generated, the event is thrown and the FIA moves directly into the process phase.
15. List and briefly describe the phases of the main loop of the FIA?
The main loop of the FIA has three phases: