wsharba / opendatakit

Automatically exported from code.google.com/p/opendatakit
0 stars 1 forks source link

Use the "number" fonction in 'calculate' question via XLSForm #1051

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What tool are you using?
ODK Build, using the on-line XLSForm

What is frustrating, troubling, annoying or lacking?
I have a "Error: Unknown question type 'caculate'."
This probably comes from the fact that I'm trying to use the number() fonction 
in calculate:

the form is made so that i've a list of 10 select_one questions, and for each 
select_one, the choices id are named '0', '1', '2', ...
example:
survey:
select_one impression  /  difficulty  /  How difficult was that training 
session?
choices:
impression / 0 / easy
impression / 1 / medium
impression / 2 / difficult
impression / 3 / very difficult

Now i want to end the form with a note saying the result they have, which is a 
sum of all the 'point' for each question. So i've read about the "number" 
function which gives a number when the argument is a string (i.e number('100') 
gives 100) so i made a question in my survey
survey
calculate / result / / number(${difficulty})+number(${question2})
note / display / your score is ${result}

But it seems this doesn't work ! this is not taken by the XLSForm application.

How would you like it to work?

I'd like the XLSform application to transform my xls to a xml without making 
this error
or
anyone giving me an idea on how to make this?

NOTE: the core team has limited ability to make software enhancements.
We rely heavily on community-contributed enhancements to the tools. If this
is something you very much need, consider hiring a developer to make the
changes with the stipulation that they work with the core team to specify
the details of the change and contribute the change back to the project
under an Apache 2 license.

Original issue reported on code.google.com by yannick....@gmail.com on 22 Aug 2014 at 4:56

GoogleCodeExporter commented 9 years ago
The data type is "calculate" not "caculate"

Original comment by yano...@nafundi.com on 26 Aug 2014 at 1:26

GoogleCodeExporter commented 9 years ago
Dear god.
Sorry for this thread, you're right it was just a dumb spelling mistake.

all this time spent trial and error without seeing that. Thanks!

Original comment by yannick....@gmail.com on 26 Aug 2014 at 3:42

GoogleCodeExporter commented 9 years ago
So my problem is solved, my forms works.
An admin can close the issue

Original comment by yannick....@gmail.com on 26 Aug 2014 at 3:44

GoogleCodeExporter commented 9 years ago

Original comment by mitchellsundt@gmail.com on 16 Oct 2014 at 11:09