Skip questions

am new using ODK, tried so many times to use relevance in odk build with no
positive feedback,
how do i set skipping pattern in my form (using odk build?)

I tried to write this in relevance row:
"If answer is '2' in question Q9_Cough then jump to Q11_Cough"
when I tried to run this error occured.

I need help please....

can you post a form example? xml or xls?

Thanks
Angelo

··· Il giorno Sat Feb 07 2015 at 13:52:48 Rebecca Chaula < chaularebecca@gmail.com> ha scritto:

am new using ODK, tried so many times to use relevance in odk build with
no positive feedback,
how do i set skipping pattern in my form (using odk build?)

I tried to write this in relevance row:
"If answer is '2' in question Q9_Cough then jump to Q11_Cough"
when I tried to run this error occured.

I need help please....

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi Rebecca
under relevance in Q11, write this

${var Q11}=2

where var Q11 is the variable you have used for question 11 and 2 is the
value input for question 9 (2 can be an option being selected in the
choices)

Share your xls form if you can.

··· On Saturday, February 7, 2015 at 3:52:46 PM UTC+3, Rebecca Chaula wrote: > > > am new using ODK, tried so many times to use relevance in odk build with > no positive feedback, > how do i set skipping pattern in my form (using odk build?) > > I tried to write this in relevance row: > "If answer is '2' in question Q9_Cough then jump to Q11_Cough" > when I tried to run this error occured. > > > I need help please.... >

Hi Rebecca,

Please use the opendatakit@ list for questions about using the software.
This list (opendatakit-developers@) is for people writing the software.

The constraint and relevance expressions are not english-language
expressions.

They are formulas written in the javarosa expression language.

This is largely documented here:
https://opendatakit.org/help/form-design/binding/

If you write forms in Excel and use the XLSForm tool, you would express
fields using the ${fieldname} syntax.
If you are using Build, you would write the expressions in the form used in
the underlying XML.

The underlying XML syntax to refer to a field is either an absolute
reference:
/data/pathtofield/fieldname
or a relative reference, where "." refers to the current fieldname and ".."
refers to the parent of the current fieldname.

The 'pathtofield' is a slash/separated list of enclosing groups and repeat
groups.

In general, you should avoid using an absolute reference to a field within
a repeat group. The only exception is when using the indexed-repeat()
function.

If you have 3 fieldnames, 'q1', 'q2' and 'q3', with 'q3' being within a
group 'g', then the absolute references for these are:

/data/q1
/data/q2
/data/g/q3

If you wanted a constraint on the value of q2 such that it has the value
'red' if the answer to q1 is 'green' then you could write (for the
constraint on q2):

/data/q1 != 'green' or . = 'red'

This could also be written as

../q1 != 'green' or . = 'red'

If you wanted a constraint on q3 so that it did not match either of the
answers for q1 or q2, you would write:

. != /data/q1 and . != /data/q2

Or, using relative paths,

. != ../../q1 and . != ../../q2

··· -------- Mitch

On Sun, Feb 8, 2015 at 9:30 PM, Saduma sirahimahs@gmail.com wrote:

Hi Rebecca
under relevance in Q11, write this

${var Q11}=2

where var Q11 is the variable you have used for question 11 and 2 is the
value input for question 9 (2 can be an option being selected in the
choices)

Share your xls form if you can.

On Saturday, February 7, 2015 at 3:52:46 PM UTC+3, Rebecca Chaula wrote:

am new using ODK, tried so many times to use relevance in odk build with
no positive feedback,
how do i set skipping pattern in my form (using odk build?)

I tried to write this in relevance row:
"If answer is '2' in question Q9_Cough then jump to Q11_Cough"
when I tried to run this error occured.

I need help please....

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com