episphere / quest

experimenting with the idea of a questionnaire markup
https://episphere.github.io/quest/
2 stars 11 forks source link

Question about math.js functions #384

Closed boyd-mj closed 2 years ago

boyd-mj commented 2 years ago

@danielruss a question came up about the quotations in the documentation for the new isdefined functions. In the Wiki, there are quotations around all of the elements in the syntax (including the fixed numeric values):

valueEquals("elementid","value") Returns true if the value of the element with id=elementid equals value. If no value is provided, the function returns false

But they are not included around the value in the example code:

valueOrDefault("x","id1","id2"...) if x exist, return the value of x. Otherwise, work through the other ids looking for a valid value. If not of the ids have a valid value, return the last id as string value.

[Q1] 
Age |__|__|id=YEARSOLD min=0 max=valueOrDefault("AGE","age",99)|

[END] Thank you

Are quotations required or optional for variable names (element IDs) and/or numeric values? The transformer software uses some of these punctuation elements to parse code so we may need to adjust the software accordingly if the quotes are needed.

Thanks, Jen

danielruss commented 2 years ago

Only numbers can be unquoted. All strings or Ids must be quoted.

boyd-mj commented 2 years ago

Thanks for the quick response!