Welcome to the LimeSurvey Community Forum

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

Conditions on columns in array numbers with checkboxes

  • Oterito
  • Oterito's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 months 1 week ago #243423 by Oterito
Please help us help you and fill where relevant:
Your LimeSurvey version: 5.6.18
Own server or LimeSurvey hosting: LimeSurvey Hosting
Survey theme/template: Vanilla
==================Hi! I need to create an array by column with a multiple choice. I know I can use array numbers with checkboxes, but I need to set a condition on the columns to show each one depending on if the option was selected in a previous multiple choice question. With the number array with checkboxes I can only set those conditions on the rows.
Can anybody help me? Thank you in advance!

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 months 1 week ago #243426 by Joffm
Hi,
to do this there is the plugin "hideEmptyColumn"
[url] gitlab.com/SondagesPro/QuestionSettingsType/hideEmptyColumn [/url]

As your installation is hosted at LimeSurvey GmbH you are not allowed to install plugins
But fortunately there is an easy workaround.
Just insert the content of the two files in the asset folder of the plugin into the question text,
the javascript file surrounded by
Code:
<script type="text/javascript" charset="utf-8">    
$(document).on('ready pjax:scriptcomplete',function(){ 
// Here the content of the file
});
</script>

and the css file surrounded by the <style></style> tags.

Now you have to produce "empty columns"
Well, somewhere there is a conbdition to decide which columns are to be displayed.
So it is like this
{if(Q1_SQ001=="Y","Arthur","")}
{if(Q1_SQ002=="Y","Bert","")}
...

If the condition is not fulfilled the x-axis subquestion text is empty.

 



 

File Attachment:

File Name: limesurvey...7171.lss
File Size:39 KB


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu, maxersloan

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 months 1 week ago #243525 by DenisChenu

Hi,

Just insert the content of the two files in the asset folder of the plugin into the question text,
the javascript file surrounded by
Joffm
 
Great to know it can work like that :)

But maybe it's better to add it in theme ;)

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.

Please Log in to join the conversation.

More
11 months 1 week ago - 11 months 1 week ago #243597 by andrej.lindic
Replied by andrej.lindic on topic Conditions on columns in array numbers with checkboxes
Hi!

First of all thank you for the above solution regarding hidecolumn plugin.

I hope it's ok to post my question in this topic.

I implemented it in our survey and it works great.

However I found an issue. Actually I'm not sure if it's related to the sctipt but when I try to do a survey on a mobile phone the if sentenses in the column headers are   not calculated.

We're hosting on Limesurvey, current version is 5.6.18.

I'm attaching the picture.I tried 2 different metods, none of the work. Columns which need to be hidden, are. I just can't display thr ones that aren't.

Does anybody know why this happens?

Thank you,

Andrej

p.s.: just found out it works until you turn on checkbox layout
Last edit: 11 months 1 week ago by andrej.lindic.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 months 1 week ago #243599 by Joffm
Please, send the lss export of the relevant questions.

Joffm 

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

Please Log in to join the conversation.

More
11 months 1 week ago - 11 months 1 week ago #243602 by andrej.lindic
Replied by andrej.lindic on topic Conditions on columns in array numbers with checkboxes
Hi!

I'm attaching the survey .lss file. Base language is Checz.

Thank you,

Andrej

File Attachment:

File Name: limesurvey...19-4.lss
File Size:107 KB
Last edit: 11 months 1 week ago by andrej.lindic.

Please Log in to join the conversation.

  • Oterito
  • Oterito's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 months 1 week ago #243608 by Oterito
Hi, Thank Joffm for the solution. It worked perfectly, but i checked on mobile and i have the same problem than andrej.lindic.
I've attached an image. 

Thank you in advance. 
Attachments:

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 months 1 week ago #243609 by Joffm
Yes, it's reproducable.

But not related to the plugin.
If you display the question without the script you see the same behaviour, even in the latest 5.6.18.

So, it seems to be a bug.
File a bug report.

Joffm

@Oterito
Did you ceck a simple array(numbers) with equation in the x-axis? What were YOUR findings.

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

Please Log in to join the conversation.

  • Oterito
  • Oterito's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 months 1 week ago #243611 by Oterito
You mean without check boxes?

I was thinking that i can change columns by rows for a mobile version and is actually better. How i can identify if the respondant is on mobile o web? And depending on that show one question or other?

Thanks

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 months 1 week ago #243612 by Joffm
We only talk about array(numbers) with checkbox layout, nothing else.

There is a script here in the forum to gather a lot of characteristics of the respondent's device.

Search for it.
I am not able to do this because I answer from my phone.

You also find it in my Tutorial 3: Gimmicks, which you find in the German section.
(If you're able to read German or to use "Google translate")

Joffm 

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

Please Log in to join the conversation.

More
11 months 5 days ago - 11 months 5 days ago #243633 by andrej.lindic
Replied by andrej.lindic on topic Conditions on columns in array numbers with checkboxes

Yes, it's reproducable.

But not related to the plugin.
If you display the question without the script you see the same behaviour, even in the latest 5.6.18.

So, it seems to be a bug.
File a bug report.

Joffm


 

I filed a bug report but unfortunately our survey is now on hold due to this problem. 

I am trying to find some solution. Since I know very little about scripting I was thinking about something else. This bug occurs when resolution of device is such that array numbers question is displayed statement by statement not as a whole array. It doesn’t matter if it's computer or a mobile device.

Is there a way to figure out on which resolution this happens (without guessing). This way for these instances I can formulate this array numbers question as set of multiple choice questions.

Thank you,
Andrej
Last edit: 11 months 5 days ago by andrej.lindic.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 months 5 days ago #243634 by Joffm
Investigate with the webdevelopment tool of your browser (usually F12)

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: andrej.lindic

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose