is it possible to count the checked answers to a multiple choice answer in a text-variable somehow?
Something like: "You selected 14 answers" to question above?
More details:
I want to implement this text-variable as a help for the participants while processing the survey. They are forced to choose 15 answers out of 50 answer.options. For me this is very user unfriendly - so I want to show the number of choosen answers above the submit button. Can you help me to find a appropriate solution to this issue?
Last edit: 10 years 2 months ago by Ryuniri_44052.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. -
Professional support
-
Plugins, theme and development
. I don't answer to private message.
The following user(s) said Thank You: Ryuniri_44052
Works! But is it possible to let this "script" count dynamically each time the participant chosses another item? So, that the participants can always see how many answers need to be checked to fullfill the question requirements.
By now it is a little bit confusing that the system tells the participants, that there is no answer chosen until the participant clicks on "next".
Another possibility can be, that this "calculation" only applies after the participant has submitted, but did not the requirements of the question. I tried it with this code and entered the variable "{count(that.Q1)}" in the help-field:
It work in javascript. If it's broken in your system : you have a javascript error. This error can happen too with bad expression manager used.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. -
Professional support
-
Plugins, theme and development
. I don't answer to private message.
Yes, I have a javacript error in my template. In another template everything works fine. (unfortunately, I have other problems with array filters in other templates).
Do you know how to detect the jacvascript error?
Here's a link to the test-survey (the broken template with javascript error is chosen).
Last edit: 10 years 2 months ago by Ryuniri_44052.
I am struggling concentrated from problem to problem.
I am using a new template now. Everything works perfectly for first question. But the variable you show me "{count(that.q1)}" seems to be not working on questions with an arry filter. At any rate it is not working for my second question.
More info:
Variable for first question "q1": {count(that.q1)}
Variable for first question "q2": {count(that.q2)}
Array filter on question q2: exclude choosen answers on q1 for q2.
The second version is fine, but I am searching for a solution to use the same counting-variable also on the following pages to count the chosen answers also for questions with array filter. The array filter "connects" the multiple choice questions on first and second page, respective the following pages.