Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Validation of total

  • baburam99
  • baburam99's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 8 months ago #186937 by baburam99
Validation of total was created by baburam99
Hello there
When I am creating a survey list for inputting numbers, and there is a total as the last question, I want a choice for the users to put the total manually. 2+2 = 4
The user has to put the number 4 for total.
If he puts 5 then there should be a validation error.
How can I do this?
I am attaching a sample survey here.

1. Choice for user to put the total.
2. Validation error when the total is wrong.

Thanks
Babu Ramabadran
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 8 months ago - 4 years 8 months ago #186938 by Joffm
Replied by Joffm on topic Validation of total
Hi, Babu,
1. please do not send a *.lsg (group) or *.lsq (question.
The import of both is language dependent, meaning we have to create a survey first which has the same base language as your file (which we do not know)
So to make our life easier send a whole survey *.lss with only the important questions.

2. You have a lot of errors in your survey.
a. You ask for numbers but use questions of type "multiple short text". Here you have to validate that the respondent really enters numbers.
There is a question type "multiple numeric input".

b. Your equation to calculate the total in the text display is wrong:
Total = Sum(Q1_SQ00.NAOK, Q2_SQ00.NAOK, Q3_SQ00.NAOK)

b.a. I hope you read the manual about the Expression Manager.
Here you read something about curly brackets to use:
manual.limesurvey.org/Expression_Manager...esentation#Equations
These are missing in your equation.

b.b. You refer to subquestions "SQ00", but you did not declare a subquestion "SQ00".

And where is anything related to your question in this survey?
Where is the users input of the total? And which total?
The total of the three questions?
Okay, then validate the input of this question:
Q4=sum(...)

Again I recommend to study the sample surveys about Expression Manager in the Demo Installation and to read the manual about question types and Expression Manager.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 8 months ago by Joffm.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose