Welcome to the LimeSurvey Community Forum

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

Store preceding question and display at the end of survey

  • cauhlins
  • cauhlins's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #196611 by cauhlins
Hello guys.

So I have a survey: csr-in-action.org/survey/index.php/573265 and I want to display the questions with a "yes" response at the end of the survey telling the user to upload a file.

The reason for this is the upload function does not, at the moment, handle multiple uploads on one page so I need to display a single upload button at the end of the survey. However, I want to let the respondent know the questions for which he/she is to upload a file based an earlier response to a question.

Example:
1) Do you have a car? Yes/No *requires upload*
2) Do you drive? Yes/No *requires upload*
3) Can you drive? Yes/No *does not require upload*

The survey would display an upload button on the next page and if the respondent answers "Yes" to any of the questions requiring proof(uploaded file), the survey should display all the questions as well.

How do I go about this please?

Thank you.
The topic has been locked.
  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #196622 by holch
To show the upload quesiton for "car" if the answer was "yes, I have a car" is done by relevance equation. How this is done depends a little on the question type you have used for the yes/no questions, but if it is the "Yes/No" question type in Limesurvey (which I generally never use) it would be probably something like this ("car" being your question code for the car question, please adapt accordingly):
Code:
car=="Y"

So you built an upload question for CAR and DRIVE and show/hide them accordingly, depending on the given answer to questions 1) and 2).

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.
  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #196624 by holch
Hmmm, I just had a look at your survey and saw that you managed what I explained already. So what is your actual problem, because I don't seem to get it.

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.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #196626 by tpartner

So what is your actual problem, because I don't seem to get it.

I think that this thread refers to the fact that there is currently a bug preventing multiple file-upload questions on a single page.

The easy fix is to place the three upload questions in separate groups and hide/show those groups with relevance.

It's not ideal as it adds possibly three more clicks for the respondent but it will work.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
3 years 11 months ago #196630 by jelo

tpartner wrote: I think that this thread refers to the fact that there is currently a bug preventing multiple file-upload questions on a single page.

Yepp. I wonder why the fix is not released. Looks like Denis already fixed that in his fork.
github.com/Shnoulle/LimeSurvey-Shnoulle/...d67ebf57394843716af0

bugs.limesurvey.org/view.php?id=16026

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • cauhlins
  • cauhlins's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #196635 by cauhlins

tpartner wrote:

So what is your actual problem, because I don't seem to get it.

I think that this thread refers to the fact that there is currently a bug preventing multiple file-upload questions on a single page.

The easy fix is to place the three upload questions in separate groups and hide/show those groups with relevance.

It's not ideal as it adds possibly three more clicks for the respondent but it will work.


Thank you T.

Having the questions in different groups will not be feasible as I have a survey with over 200 questions and approximately 10-15 upload questions.
The topic has been locked.
  • cauhlins
  • cauhlins's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #196637 by cauhlins

holch wrote: Hmmm, I just had a look at your survey and saw that you managed what I explained already. So what is your actual problem, because I don't seem to get it.


Hello Holch. Thank you for your response.

I'm trying to create a single upload button to handle all the files needed as proof for questions that require them. The survey is a pretty long one and participants may not remember all the questions that require a file to be uploaded seeing that the upload question is only displayed at the end of the survey.

To make it easier, I want to store all questions that requires a file and the participant has answered "Yes" to in a sort of "container" and display the content of this container at the end of the survey. This way the participant does not need to remember which question requires proof as a list of all the questions is displayed right in front of him.

Hope you get my explanation?
The topic has been locked.
  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #196639 by holch
Ok, so I understood you correctly.

So your structure would be like this:

1) Do you have a car? Yes/No *requires upload*
2) Do you drive? Yes/No *requires upload*
3) Can you drive? Yes/No *does not require upload*
4) ...
5) ...
X) You previously mentioned that you have a car. Please upload a photo of your car.
X+1) You previously mentioned that you drive. Please upload a photo of your driving.

I personally would separate this into two upload questions. But similar like in your example survey linked above, you can just move the upload questions to the end of the survey. As I said, to keep it "clean" I would create 2 upload questions, then you can also just work with relevance equations and do not need to pipe the answers from the previous questions into the upload question.

But if you want to do it with various uploads within one question (not sure if this works as I never use this question type, but seems like it does as your sample survey offers the option to upload up to 2 files), you can use Expression Manager/Script to pipe in the responses from the previous questions.

Assuming your previous questions are Q1 (car) and Q2 (drive) you could do something like this in the Text of the upload question:
Code:
{if(Q1=="Y", "Please upload a photo of your car", "")}
{if(Q2=="Y", "Please upload a photo of you driving your car", "")}

Code is not tested, just for you to get an idea. If you did not use the YES/NO question (doesn't look like it in your example), then you need to subsitute "Y" with the answer code you have given to the answer "Yes", eg. 1 or A01 or something like 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.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #196640 by Joffm
Hi, you talked about a container.
This "old" solution of tpartner works in 4.x. as well





Here you may insert your questions or your text and display the rows by subquestion relevance.

The only thing is to get rid of the radio buttons (red). Actually it was a normal array.

File Attachment:

File Name: limesurvey...9378.lss
File Size:31 KB


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • cauhlins
  • cauhlins's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #196646 by cauhlins
Thank you Holch.

You did get my question correctly.

However, the code you provided may not be sustainable as I have a rather long list of upload questions.
The topic has been locked.
  • cauhlins
  • cauhlins's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #196647 by cauhlins

Joffm wrote: Hi, you talked about a container.
This "old" solution of tpartner works in 4.x. as well





Here you may insert your questions or your text and display the rows by subquestion relevance.

The only thing is to get rid of the radio buttons (red). Actually it was a normal array.


Joffm


I'd try this and revert
The topic has been locked.
  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #196648 by holch

However, the code you provided may not be sustainable as I have a rather long list of upload questions.


I don't really see why my code should not work for 10-15 upload questions as well.

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.

Lime-years ahead

Online-surveys for every purse and purpose