Welcome to the LimeSurvey Community Forum

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

Multiple numeric entries

  • mblaise
  • mblaise's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 8 months ago - 6 years 8 months ago #157164 by mblaise
Multiple numeric entries was created by mblaise
Hi everyone,

I am creating a new survey.
It is a multiple numeric entry : each person answers with numbers on the subquestions, and the total has to be 30.

My question : is it possible to limit the total number of each subquestion

Ex : Marie is answering the survey as follows :
Subquestion 1 : 10
Subquestion 2 : 20
Subquestion 3 : 0
Total of Marie's choices : 30

--> is it possible to limit the number on Subquestion 2, for example:
Subquestion 2 is limited to 40 in total
Jim answered 30 to subquestion 2
When Marie wants to answer 20 to subquestion 2, she gets an error message : "only 10 is left for subquestion 2 !"

I hope this is clear, let me know !
Last edit: 6 years 8 months ago by mblaise. Reason: didn't finish my message !
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 8 months ago #157176 by tpartner
Replied by tpartner on topic Multiple numeric entries
Out of the box, there is no access to previous results.

I suppose you could code an AJAX call that queries the database but how would you handle concurrent respondents?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: mblaise
The topic has been locked.
  • mblaise
  • mblaise's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 8 months ago #157193 by mblaise
Replied by mblaise on topic Multiple numeric entries
The idea would be for the respondents to not be able to answer a number that would make the sum of responses excede a certain amount
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 8 months ago #157214 by holch
Replied by holch on topic Multiple numeric entries
As Tpartner says: This is not possible out of the box and requires custom coding.

But even with custom coding: What happens with people answering at the same time? How would you handle that?

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

The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 8 months ago #157233 by DenisChenu
Replied by DenisChenu on topic Multiple numeric entries
ajax or javascript solution currently.
With help from framagit.org/SondagePro-LimeSurvey-plugin/getStatInSurvey for javascript for example.

Project : put this in a future version (with a clean system to add it via plugins).

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 topic has been locked.
  • mblaise
  • mblaise's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 8 months ago #157250 by mblaise
Replied by mblaise on topic Multiple numeric entries
Yeah good point. Could one of the respondents be blocked while the first finishes answering ?
If so i'll try and get custom coding
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 8 months ago #157259 by DenisChenu
Replied by DenisChenu on topic Multiple numeric entries
I use it with javascript and css.
Code:
<span class="{if('[Q.nb.A1]'<10,'hidden','')}"> Answer for A1</span>[code]
[code]$("#question{QID} .hidden").each(function(){
$(this).closest('.answer-item').remove();
});

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 topic has been locked.
  • mblaise
  • mblaise's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 7 months ago #157749 by mblaise
Replied by mblaise on topic Multiple numeric entries
OK thanks. I'm not a coder so i'll try and find someone to help me with that :)
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose