Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Creating Multiple Treatments in a Single Survey?

Creating Multiple Treatments in a Single Survey? 3 years 2 months ago #60595

  • dgc11
  • dgc11's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 1
  • Karma: 0
I'm new to limesurvey and previously used SurveyMonkey to create surveys. In SurveyMonkey, if I wanted to survey people on six different treatments, I'd create six different surveys...all of which were the same until I got to the one question that changed.

For example, person A, B, C, and D are all working on a survey. Person A needs to receive the survey where question 8 has graphic 1 with questions, Person B needs to receive the survey where question 8 has graphic 2 with questions, etc.

I've read up on the wiki about setting conditions, but I really don't think that setting hide/show or jumping conditions is what I need. Because all the questions before this question are the same...for everyone. And no matter what the person answers to the previous question, they still need to advance to this graphic question...it's just that I need to randomize the graphic questions so each survey taker only sees one graphic question..and not all four.

I guess what I need to know is is it possible to create just one survey in limesurvey and test 6 different treatments in that one survey? (I hope this makes sense)
The administrator has disabled public write access.

Re: Creating Multiple Treatments in a Single Survey? 3 years 2 months ago #60687

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4072
  • Thank you received: 748
  • Karma: 341
You can load a random number into a hidden short-text question with JavaScript and then use conditions to display the appropriate graphic questions depending on the value of the hidden question.

The script to hide and load the hidden question would be something like this, where "QQ" is the short-text question ID.
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
 
		var qHidden = QQ;
		var maxNum = 6;
 
		// Hide the hidden question
		$('#question'+qHidden+'').hide();
 
		if ($('#question'+qHidden+' input.text').val() == '') {
 
			// Find a random number between 1 and "maxNum"
			randNum = Math.floor(Math.random()*maxNum + 1);
 
			// Load the random number into the hidden question
			$('#question'+qHidden+' input.text').val(randNum);
		}
 
	});
 
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Aw: Re: Creating Multiple Treatments in a Single Survey? 3 years 2 months ago #60864

  • Zappes
  • Zappes's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 20
  • Karma: 0
Hello TPartner! I had last time the same problem. Your script is not working for me ( I am using limesurves 1.90). The script is fine but if I want to use conditions it doesnt show me anything... Do I have to write instead of QQ the Question ID? In which form? I think it does not load the answer of the randomization in the answer text...
Last Edit: 3 years 2 months ago by Zappes. Reason: exakter
The administrator has disabled public write access.

Re: Aw: Re: Creating Multiple Treatments in a Single Survey? 3 years 2 months ago #60866

  • lovepade
  • lovepade's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 93
  • Karma: 0
Are you using tokens? I'd create e.g. a "type" token for each respondent, and then make question 8 conditional on that? I think this is possible?
The administrator has disabled public write access.

Re: Aw: Re: Creating Multiple Treatments in a Single Survey? 3 years 2 months ago #60876

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4072
  • Thank you received: 748
  • Karma: 341
Do I have to write instead of QQ the Question ID?
Yes. See the image below.
Capture.JPG


You can check that the hidden question is being loaded by commenting out the hide() function.

Change:
$('#question'+qHidden+'').hide();

To:
//$('#question'+qHidden+'').hide();
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Aw: Creating Multiple Treatments in a Single Survey? 2 years 11 months ago #64761

  • MaLu
  • MaLu's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 35
  • Karma: 0
Hi TPartner,

basically, I have the same isue as described above. However, after inserting the script (copy/paste), changing QQ and unhiding the question, it won't appear prefilled with a random value.
I am using Version 1.91 Build 10089 if that matter...

Can you help me on this?

Thank,
Marie
The administrator has disabled public write access.

Re: Aw: Creating Multiple Treatments in a Single Survey? 2 years 11 months ago #64765

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4072
  • Thank you received: 748
  • Karma: 341
Are there any JavaScript errors in the console? Can you activate a sample survey?
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Aw: Creating Multiple Treatments in a Single Survey? 2 years 11 months ago #64801

  • MaLu
  • MaLu's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 35
  • Karma: 0
Hi Tony,
here's an activates sample survey: www.panel.statista.com/befragung/index.p...37&newtest=Y&lang=de

I set conditions on questions 2, 3 and 4 to appear when Q1 is 1,2 respective 3.

Thank you!
Marie
The administrator has disabled public write access.

Re: Aw: Creating Multiple Treatments in a Single Survey? 2 years 11 months ago #64806

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4072
  • Thank you received: 748
  • Karma: 341
You have a syntax error.

Remove this from the second last line of the script:
script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Aw: Creating Multiple Treatments in a Single Survey? 2 years 11 months ago #64872

  • MaLu
  • MaLu's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 35
  • Karma: 0
Oh, that's it...

Thank you!
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.139 seconds
Donation Image