Welcome to the LimeSurvey Community Forum

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

check if a number has been already entered in a numeric question

  • atavei
  • atavei's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 months 3 weeks ago #252924 by atavei
Please help us help you and fill where relevant:
Your LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey hosting:
Survey theme/template:
==================
How do I check if a number has been entered already in a numeric question? And if that is so, then the person sees an alert telling him/she to check or to enter a different one. Thanks for your help.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Online
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 months 3 weeks ago - 4 months 3 weeks ago #252925 by Joffm
Hi,
1. why did you ignore the questions at the beginning?

2. How is it to work?
Imagine there are 100 respondents at the same time.
Now one respondent enters "12345"
10 seconds later another respondent enters "12345".
Now the first respondent decides not finish the survey and he closes his browser.
So was the second respondent allowed to enter the number or not?

And if you only take into account completed surveys; as long as respondent 1 did not complete another respondent is able to enter the same number.
This you have to consider.

Anyway:
This could be useful (last example)
[url] manual.limesurvey.org/StatFunctions [/url]

But what is the reason to enter a unique number?
If you only want to generate a unique number, you'd better use the SAVEDID.

​​​​​​Joffm 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 months 3 weeks ago by Joffm.
The following user(s) said Thank You: atavei

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 months 3 weeks ago #252934 by DenisChenu
I use it for Unique name statCount(QuestionCode.sgqa, 0, 0) < 1

It's the reason i need to add the last param : [, self = true]

 

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: atavei

Please Log in to join the conversation.

  • atavei
  • atavei's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 months 3 weeks ago #252935 by atavei
Please forgive me. I did not see the request for information related to the posting. Here it is:
LS version 6.3.7
Self-hosting
Fruity 23
==============

Perhaps my question to the forum was not clearly formulated. Context is everything and I provided very little of it.

We are using LS  as a data entry tool for a paper and pencil survey. Different people at different locations will be entering data, and they will not have access to the data entry screen in the administration area. They will use a "regular survey" to enter de data. The first question in the survey is the questionnaire id and it is a number already assigned to the paper questionnaire. I want to use a numeric question because of the different validation options it provides.Yet, besides those validation checks already available in this type of question, I need  to validate that a questionnaire id number has not been already entered, perhaps by mistake. The person entering the data should receive an alert message if the questionnaire id number has already being used. The person should also be requested to check if there was an error entering the id number, and if not, to go to the survey manager to solve the issue. Something like that should be the workflow.

Any help is welcomed. Please forgive me if the question was not correctly formulated in the original post. Thank you.

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 months 3 weeks ago #252969 by DenisChenu
We already answer on the way to do : statCount(QuestionCode.sgqa, 0, 0) < 1

in manual.limesurvey.org/Question_type_-_Nu...28em_validation_q.29

remind : test was done only in PHP, then when move next.

Maybe if you want to show the next number to take are to construct an plugin to show the max number used currently …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 months 3 weeks ago #253061 by holch
In this case, I personally would use tokens. You can use your survey ID as the token. I think that is the easiest way to do what you want to do.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose