Welcome to the LimeSurvey Community Forum

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

Issues implementing example for shuffling rows in array

  • emmadewil
  • emmadewil's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 7 months ago #225737 by emmadewil
Please help us help you and fill where relevant:
Your LimeSurvey version: 3.27.19
Own server or LimeSurvey hosting: University affiliated account
Survey theme/template: Vanilla
==================

Hello everyone! I was hoping to get some help with an issue I am having implementing an example that JoffM kindly posted in response to an earlier question about shuffling the rows in an array: here is the original post , and here is his example code - 

File Attachment:

File Name: limesurvey...9169.lss
File Size:46 KB
.

Like the original poster, I am trying to implement a choice-based conjoint analysis. I started by importing JoffM's example, which worked perfectly, and then attempted to recreate the questions in a separate survey (which I'll refer to as my duplicate survey) before modifying the content of them for my project. Here is my duplicate survey:

File Attachment:

File Name: Conjoint_D1.lss
File Size:25 KB
. However, this has not been working as expected. When previewing the duplicate survey, the default answers I add in H1 are not appearing in the array created in Q1 as they should be. This is my main issue and any advice would be greatly appreciated.

I also started having a second issue this morning with the survey preview. For some reason, the preview automatically skips every question and goes to the end screen. Any advice on this issue would also be amazing, but I am not sure if it is related to the first!

Thank you so much in advance, searching this forum has already been extremely helpful in my work with LimeSurvey so far so I am helping I can get this issue resolved! Let me know if any more details are needed.
 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 7 months ago #225740 by Joffm
Hi,
you did not follow the example.
In the example the survey is displayed "question by question".
Therefore there is the line
    $('#ls-button-submit').trigger('click');
to proceed automatically to the next question, because you can't hide this question by "Always hide this question"
It is hidden by this line
  //$('#question{QID}').hide();
where you should remove the slashes.

So either you display "question by question" or you move the two question "H0" and "H1" to other groups. (It is really unimportant where they are.)

Joffm

To explain:
You see this line in the script
$(document).on('ready pjax:scriptcomplete',function(){
It means the script starts when the document is ready.
Meaning the script starts when your array is displayed already.
So these things have to be on two separate pages.

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose