# Computing complex background computations

Is it possible to compute values in the background in order to test
the consistency of the answers provided?
For example:
-Computing per capita caloric consumption over recall period, to
compare against maximum threshold (e.g., two people cannot physically
eat 50kg of rice in two days)
-Compute unit value of purchased food items, or unit value of sold
crops

My guess is that it might be possible but the functionality would be
limited by the fact that you are only able to include one constraint
per question.

Has anyone done this? Have an idea how to do this?

yes. you should be able to use a combination of calculate and
constraints to check consistency of answers.

··· On Tue, Nov 23, 2010 at 08:44, Ulli wrote: > Is it possible to compute values in the background in order to test > the consistency of the answers provided? > For example: > -Computing per capita caloric consumption over recall period, to > compare against maximum threshold (e.g., two people cannot physically > eat 50kg of rice in two days) > -Compute unit value of purchased food items, or unit value of sold > crops > > My guess is that it might be possible but the functionality would be > limited by the fact that you are only able to include one constraint > per question. > > Has anyone done this? Have an idea how to do this? > > -- > Post: opendatakit@googlegroups.com > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > Options: http://groups.google.com/group/opendatakit?hl=en >

But you are limited to one constraint per questions, so there is a
limit to the complexity for now. Right?

··· On Nov 25, 10:55 pm, Yaw Anokwa wrote: > yes. you should be able to use a combination of calculate and > constraints to check consistency of answers. > > > > > > > > On Tue, Nov 23, 2010 at 08:44, Ulli wrote: > > Is it possible to compute values in the background in order to test > > the consistency of the answers provided? > > For example: > > -Computing per capita caloric consumption over recall period, to > > compare against maximum threshold (e.g., two people cannot physically > > eat 50kg of rice in two days) > > -Compute unit value of purchased food items, or unit value of sold > > crops > > > My guess is that it might be possible but the functionality would be > > limited by the fact that you are only able to include one constraint > > per question. > > > Has anyone done this? Have an idea how to do this? > > > -- > > Post: opendatakit@googlegroups.com > > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > > Options:http://groups.google.com/group/opendatakit?hl=en

you can have one constraint per question, but that constraint can
evaluate any number of xpath expressions.

··· On Mon, Nov 29, 2010 at 07:28, Ulli wrote: > But you are limited to one constraint per questions, so there is a > limit to the complexity for now. Right? > > > On Nov 25, 10:55 pm, Yaw Anokwa wrote: >> yes. you should be able to use a combination of calculate and >> constraints to check consistency of answers. >> >> >> >> >> >> >> >> On Tue, Nov 23, 2010 at 08:44, Ulli wrote: >> > Is it possible to compute values in the background in order to test >> > the consistency of the answers provided? >> > For example: >> > -Computing per capita caloric consumption over recall period, to >> > compare against maximum threshold (e.g., two people cannot physically >> > eat 50kg of rice in two days) >> > -Compute unit value of purchased food items, or unit value of sold >> > crops >> >> > My guess is that it might be possible but the functionality would be >> > limited by the fact that you are only able to include one constraint >> > per question. >> >> > Has anyone done this? Have an idea how to do this? >> >> > -- >> > Post: opendatakit@googlegroups.com >> > Unsubscribe: opendatakit+unsubscribe@googlegroups.com >> > Options:http://groups.google.com/group/opendatakit?hl=en > > -- > Post: opendatakit@googlegroups.com > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > Options: http://groups.google.com/group/opendatakit?hl=en >