Hi guys,
I'm beginning to work on using the latest javarosa libraries in ODK-Voice
and have come across two questions that I was hoping you could help me out
with.
The first one is how in ODK-Collect 1.1.7 you replaced the following
function that was in 1.1.4
PromptElement prompt.getAttribute(FormAttribute.AUDIO_SKIP_INSTRUCTIONS);
The second question also has to do with PromptElement. In OdK-Voice it has
the code below, where as now ODK uses Vector, what are the functions I
should use to get itemLabel and itemValue as shown below?
Is ItemValue prompt.getSelectChoiceText(mItems.get(i))?
And itemLabel i + RANDOM_BUTTON_ID, mItems.get(i).getLabelInnerText() or
getTextID?
OrderedHashtable h = prompt.getSelectChoices();
Enumeration items = h.keys();
itemLabel = (String) items.nextElement();
itemValue = (String) h.get(itemLabel);
confPrompt.append("<" + (i==1?"if":"elseif") + " cond="answer=='" +
itemValue + "'"" + (i==1?"":"/") + ">\n");
confPrompt.append(VxmlUtils.getAudio(itemLabel));
Thanks,
Joaquin
i'm moving this conservation to opendatakit-developers so we don't
scare the non-developers/normal people with.
···
---------- Forwarded message ----------
From: Joaquín Blaya
Date: Thu, Jun 23, 2011 at 12:32
Subject: [ODK Community] Questions about upgrading ODK-Voice from
Collect 1.1.4 to 1.1.7
To: opendatakit@googlegroups.com
Hi guys,
I'm beginning to work on using the latest javarosa libraries in
ODK-Voice and have come across two questions that I was hoping you
could help me out with.
The first one is how in ODK-Collect 1.1.7 you replaced the following
function that was in 1.1.4
PromptElement prompt.getAttribute(FormAttribute.AUDIO_SKIP_INSTRUCTIONS);
The second question also has to do with PromptElement. In OdK-Voice it
has the code below, where as now ODK uses Vector, what are the
functions I should use to get itemLabel and itemValue as shown below?
Is ItemValue prompt.getSelectChoiceText(mItems.get(i))?
And itemLabel i + RANDOM_BUTTON_ID, mItems.get(i).getLabelInnerText()
or getTextID?
OrderedHashtable h = prompt.getSelectChoices();
Enumeration items = h.keys();
itemLabel = (String) items.nextElement();
itemValue = (String) h.get(itemLabel);
confPrompt.append("<" + (i==1?"if":"elseif") + " cond="answer=='" +
itemValue + "'"" + (i==1?"":"/") + ">\n");
confPrompt.append(VxmlUtils.getAudio(itemLabel));
Thanks,
Joaquin
--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en
audio_skip_instructions is unique to voice, and i don't know what it does.
to figure out how we get item label and value, take a look the
select/select1 widgets in collect. in line 64, we loop throw the
elements and extract selectChoice items.
···
On Thu, Jun 23, 2011 at 12:32, Joaquín Blaya wrote:
> Hi guys,
> I'm beginning to work on using the latest javarosa libraries in ODK-Voice
> and have come across two questions that I was hoping you could help me out
> with.
>
> The first one is how in ODK-Collect 1.1.7 you replaced the following
> function that was in 1.1.4
>
> PromptElement prompt.getAttribute(FormAttribute.AUDIO_SKIP_INSTRUCTIONS);
>
> The second question also has to do with PromptElement. In OdK-Voice it has
> the code below, where as now ODK uses Vector, what are the functions I
> should use to get itemLabel and itemValue as shown below?
>
> Is ItemValue prompt.getSelectChoiceText(mItems.get(i))?
> And itemLabel i + RANDOM_BUTTON_ID, mItems.get(i).getLabelInnerText() or
> getTextID?
>
> OrderedHashtable h = prompt.getSelectChoices();
> Enumeration items = h.keys();
> itemLabel = (String) items.nextElement();
> itemValue = (String) h.get(itemLabel);
>
> confPrompt.append("<" + (i==1?"if":"elseif") + " cond=\"answer=='" +
> itemValue + "'\"" + (i==1?"":"/") + ">\n");
> confPrompt.append(VxmlUtils.getAudio(itemLabel));
>
> Thanks,
>
> Joaquin
>
> --
> Post: opendatakit@googlegroups.com
> Unsubscribe: opendatakit+unsubscribe@googlegroups.com
> Options: http://groups.google.com/group/opendatakit?hl=en
>