0

I'm trying to do a application that listen a name and two grades, do the media of the grades and then save it on a mysql database. I can't make the application to recognize the grade in decimal (in Portuguese). Here's my actual code:

 <?xml version="1.0" encoding="utf-8"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml" xml:lang="pt-BR">
    <var name="media"/>
    <form id="selecionar">
        <field name="Selecao">
            <prompt>
                Voce gostaria de registrar ou consultar?
            </prompt>
            <grammar xml:lang="pt-BR" root="myrule">
                <rule id="myrule">
                    <one-of>
                        <item> Registrar </item>
                        <item> Consultar </item>
                    </one-of>
                </rule>
            </grammar>
        <filled>
            <if cond="Selecao=='Registrar'">


                    <goto next="#nome"/>
            <elseif cond="Selecao=='Consultar'" />
                <prompt>
                    Você escolheu consultar.
                </prompt>
            </if>
</filled>
</field>            
    </form>
    <form id="escolha">
                <field name="escolhas">
            <prompt>
                Voce gostaria de fazer outra tarefa?
            </prompt>
            <grammar xml:lang="pt-BR" root="myrule2">
                <rule id="myrule2">
                    <one-of>
                        <item> Sim </item>
                        <item> Nao </item>
                    </one-of>
                </rule>
            </grammar>
        <filled>
            <if cond="escolhas=='Sim'">
                <goto next="#selecionar"/>
            <elseif cond="escolhas=='Nao'" />
                <prompt> Adeus. </prompt>
            </if>
</filled>
</field>                


    </form>

    <form id="nome">
                <field name="nomealuno" grammar="pt-BR">
            <prompt>
                Qual o nome do aluno?
            </prompt>
 <grammar type="application/x-gsl">

<![CDATA[

     NAME
     [[alberto] {return("alberto ")}
     [gabriele] {return("gabriele ")}
     [luiz] {return("luiz ")}]

]]>
</grammar>
            <filled namelist="nomealuno">
            <prompt> O nome dito foi <value expr="nomealuno"/> </prompt>
            <break strength="weak" time="1s" />
                <goto next="#notaum"/>
            </filled>
                </field>
    </form>
    <form id="notaum">
                <field name="notaum" slot="mySlot">
            <prompt>
                Qual a primeira nota?
            </prompt>

            <filled namelist="notaum" grammar="pt-BR" type="number">
                <prompt> A nota dita foi <value expr="notaum"/> </prompt>
                <goto next="#escolha"/>
            </filled>
                </field>
    </form>
</vxml>
  • Feel free to mark a question as accepted if it answered your question. Its a way to let the community know if your query got resolved. If not, feel free to ask clarify in the comments. – Anupam Feb 14 '17 at 07:55

1 Answers1

0

You can use the star key (*) as decimal.

Since you are using a built-in grammar:

<filled namelist="notaum" grammar="pt-BR" type="number">

check the built-in grammar 'number' in the VXML 2.0 spec - Appendix P.

Anupam
  • 14,950
  • 19
  • 67
  • 94