In VXML is there a way to re-enter a field from a filled block without clearing the nomatch/noinput counters? - vxml

I am having an issue with a VXML form, basically I have a field with an initial prompt and have a set of noinput nomatch blocks using counters to play back different prompts dependent on the number of noinput/nomatch events have been thrown.
I need to report on each attempt so the ASR confidence is set pretty low and in the filled element I check the confidence level and from that I would like to either accept, reprompt if confidence is low or if confidence is borderline, play a confirmation prompt. The issue I am having is that in the filled block I am performing an action to check the confidence and if too low I do the following (field name is collection):
<clear namelist="collection"/>
<throw event="nomatch"/>
The issue is that this clears the nomatch/noinput counters but I need these to remain. If I remove the clear tag, the nomatch event is hit but as the field is still 'filled' it doesn't accept input.
Is there a way to re-enter the field from the filled block without clearing the counters or is there a way I can access the counters via ECMA script to set them again or something similar? Can I only clear certain values from the "collection" field so the filled element is not immediately re-entered but retains the counters?
Cheers

I discovered the answer to this - the simple solution was to move the nomatch noinput event handlers out of the collection field scope to the document scope - this meant that when I called clear on the collection field, the noinput and nomatch counters were not cleared

It is not an issue, it is the standard :
https://www.w3.org/TR/voicexml20/#dml5.3.3
"In addition, if the variable name corresponds to a form item, then
the form item's prompt counter and event counters are reset."
You can add your own counter with a variable. Increment in the process block and test the value with or the attribute "cond" for the prompts.

Related

Saving form data as user types (React/Postgres)

Given a simple textbox to answer a question, how would you go about saving answers as the user types? Assuming that the answer is upserted.
Using a somewhat naive example of an onChange handler and saving answers using an API within that onChange, I ran into two problems:
Sends what seems to be too many patch requests from client to API since it's every time the input textbox answer changes.
If using postgres upsert or creating your own, then the second request made by the onChange handler may not see the first if the user is typing quickly, creating duplicate records for that textbox (two answers for one question)
I need to execute queries beforehand to get necessary relationship values before updating, so the HTTP wait time is fairly long. Fixing this now, but seems to not address the above two issues.
I thought of only saving once the user presses spacebar, but that seems hacky. Normally of course I'd save after clicking a submit button, but in this case it must be as the user types.
Any suggestions / comments? Cheers.
EDIT:
Also tried saving within onBlur.. But this doesn't always get called depending on where the user clicks.
Does it have to patch the data for every keypress or can you use a delay?
For instance...
User starts typing: Register the event, set a timeout for say 3 seconds
If the user keeps typing: reset that timeout back to the full 3s
If the user pauses typing + 3s passes: patch the data with new value
When the user resumes typing: set another timeout

Re-using entities in Watson Assistant results in automatically filled context variables

So to my understanding, entities are supposed to be re-used amongst different slots to optimize for the fact that you may want to accept a user input info for similar data types i.e. two separate slots "what is your household income", "what is your spouse's household income" would both use the #sys-currency entity.
In my current dialog flow, I have two child nodes each with one slot that checks for the sys-currency entity type. I'm using two different context variables however to set the slot.
The problem is that after the user inputs an answer for the first child node ('household income'), the context variable is then set for the following one as well. They have the same entity, but different context variables. To my understanding, this shouldn't be happening. I can confirm the node is processed, but it immediately skips the prompt as if it's already been filled and delivers the response in the node.
You are telling it to jump to the next slot and look for that entity. The user does not get the chance to input anything because their last message contained that entity. You should try jump to and wait for user input
If one node is giving a jump-to to the other, this will happen. The reason is because the intent and the entities found on the user input will be evaluated against all nodes from the flow until a new "wait for user input", where they will be changed.
In those situations, i normally create a new entity with a value that would never be found (like 389jd8239d892d8h89hf32hdsa8hdj3), to force every input into the not-found node of the slot, and there i use the entity necessary, in this case it would be the #sys-currency. This way the question will aways show, even if in a previous input the user typed a valid currency. To me it's useful when dealing with flows that use a lot of #sys-numbers/#sys-currency/#sys-date, and there isen't a lot of text to use to differenciate the values.
Another option would be to remove the slot and use a single node, with his own flow to get the answer. Personally i prefer to use slots, since it's easy to treat multiple possibilities. I would even put both questions on the same node, just using conditions to check if the slot should be evaluated or not.
I have searched for a way to clear the intent/entity recognized from the input in a previous node, but at no success.
So... I know this is a year and 3 months late, but I'll provide an answer in case anyone else is experiencing this issue.
The root cause is the "Divorce - Household Income" node sets the input.text to a value that the #sys-currency entity matches so any nodes you jump to that matches based on #sys-currency will automatically have their context variables set to the input.text without prompting the user.
Unfortunately, I haven't seen any documentation from IBM that allows you to set the input.text to null.
To solve this issue, you need the user to provide some other value that won't match #sys-currency.
Thankfully, the solution is simple to implement and users may actually prefer you follow my outline below.
Simply have your "Divorce - Household Income" node jump to a node that asks them to confirm their entry. Options such as Yes and No are perfect since they'll set input.text to "Yes" or "No", respectively.
Finally, jump to the "Divorce - Spouse Income" node. Since #sys-currency won't match the user's input.text, the node will properly prompt the user to fill the $spouse_annual_income slot.

Adding slot changing the intent

I have created a dialog which checks for some Intent and entity to trigger the response, I have also added slots to capture the missing entities. But when user enter the slot value it changes the intent thus causing change in final response. I have tried adding context variable also and deleting it after response but it gets deleted before response and I am getting empty context variable in response.
Like I have added a slot for capturing missing color values in an Intent say 'looking' and color values are like 'I, G, H' and there's also an Intent let's say Goodbye which is also trained for values like 'G or H'. So, when a user fills the slot value with 'G or H' it also overrides the previous intent 'looking' to 'Goodbye' and my final response value changes. What is the best way to handle this kind of flow?
The current intent is based on the latest utterance by the end user. So when someone types in a follow up to a slot, the intent will change and this is intended.
A common confusion is that this impacts the dialog tree. Because when you test it in "Try it out" you see the intent change. Unless your dialog tree is explicitly looking for it after the slot, then it has no impact what-so-ever.
If you do need it to stay the same, then you can send back the intent object in your context. This will disable Watson Assistant from trying to guess the intent.
The danger here is you need to be mindful that what you send back might not reflect what the user has entered. For example, they may ask something that has to trigger the handler of a slot. Doing this will disable that ability.

How to read string from a field without pressing enter

I have a barcode scanner that needs to read data into a database whenever a barcode is scanned. All the scanner does is take the barcode and create a string with it. Barcodes, however can be variable lengths.
The idea behind it is to have a java class open, and the user will scan multiple barcodes one after the other (without pressing the enter key). This class must then take each barcode and read it into a database.
I need help to read the strings from the scanner without the user having to press enter each time (as this makes the program pretty useless and not very user friendly)
Thanks. Looking forward to finding a solution!
I've done something similar to this in .NET but the concept should be about the same.
I would set a timer up with a delay long enough to be a sign that input has stopped but not too long to cause delay - so say 500ms.
On text box update event you ensure both that the timer is enabled and that you reset the timer essentially giving you another 500ms to enter more information.
On the timer tick event or equivalent you do your action (in your case save to the DB) and disable the timer, ensuring you don't affect focus during the processing obviously.
Assuming you also clear the text box, you can then after whatever delay you specify scan something else and trigger the exact same functionality.
Note this may fall down if you ever have to fall back to using a keyboard instead of barcode scanning. At the very least if this was the case you would need to research a better delay value that would accommodate both or maybe provide a way to disable the timer and revert back to using the enter key
Hope this helps

Why is data within a memory proxy marked as dirty?

I've a store that is using a memory proxy. The store get it's data by calling the loadRawData method. I now make some changes to this data using roweditor & rowaction which result in dirty records which seems to be a correct behavior but this store will never be able to sync any data so why are all cells marked with this red triangle?
I think I must oversee something here. How can I spare these trinangels without loosing the track on modified fields?
I am using ExtJS 4.2.1
If you don't want the little red triangles on your grid, you can set the following in the viewConfig.
markDirty: false
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.view.Table-cfg-markDirty
As LUKE already answered the Question I will add just some additional information about the dirty flag of a record
Note: the dirty flag is marked as readonly and this is for a reason.
Here is at least one reason:
The time set() finishes the record has already published the
changes to the store(s) which in the same time fires the update event for
the modified data.
So changing the dirty flag will have no affect because it happens after all this! So the record will be already marked as dirty e.g. the grid will have already marked all changed columns with the red triangle.
To prevent the record from setting it's dirty flag use a beginEdit() / endEdit() block and don't use set because set() will always set dirty the flag.
Here is a example which inverts a boolean and don't affect the dirty flag
record.beginEdit();
record.data.active = !rec.data.active;
record.endEdit();

Resources