- Posts: 18
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Dual array "no answer" exclusive response without "no answer" for all questions
- keithgoldstein
- Topic Author
- Offline
- New Member
- Joffm
- Offline
- LimeSurvey Community Team
- Posts: 12881
- Thank you received: 3965
????other than a very time consuming process of creating three distinct answer scales in an array, and then make the 3rd answer exclusive
I am confused.
In an array, answer options are always exclusive.
And "no answer" is an answer option like any other. You are free to translate as you like.
And "based on gender"? ypu may use EM "micro-tayloring".
Or do you use the built-in "no answer" option in on mandatory questions?
You shouldn't display this but use your own code and wording.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
- keithgoldstein
- Topic Author
- Offline
- New Member
- Posts: 18
- Thank you received: 1
Regarding gender, I also indeed do utilize EM to branch the questions. One problem with that method is that it creates 2 distinct columns of data that then need to be merged into the same column. Piping in text solves that problem, but it gets confusing. Developing a unique translation file for each survey would solve a lot of problems. In some languages we also formality issues, where a different level of language needs to be used depending on who is being addressed. In the meantime, it would be great to get some advice on a simple fix to the question theme of the dual array below as an example. If someone has a better solution that solves this issue more globally though, that's also great.
- Joffm
- Offline
- LimeSurvey Community Team
- Posts: 12881
- Thank you received: 3965
if you use an "array dual scale"of creating three distinct answer scales in an array
But that's easy.
Split the question into two arrays.
Either you insert the "no answer" option into both or only in the first and display the second array using subquestion relevance.
And the very last option because your installation is hosted at LimeSurvey GmbH.
Host it yourself; no problem to translate.
And this
Why?Regarding gender, I also indeed do utilize EM to branch the questions. One problem with that method is that it creates 2 distinct columns of data
If your answer text is "{if(gender==1,"answer for males",if(gender==2,"answer for females","answer for others"))}
you get only one column.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
- keithgoldstein
- Topic Author
- Offline
- New Member
- Posts: 18
- Thank you received: 1
And the issue with gender is that also the questions, tips, everything needs to be translated to female and male, so it becomes easier to just set up duplicates of question groups and make them relevant based on the gender question. My solution works, but again I get two columns for every question, which I can also work around. For now my question is simply how can I create a dual array table as I showed in the picture that either adds text to the section in yellow or changes the text in the dashed border?
- tpartner
- Offline
- LimeSurvey Community Team
- Posts: 10098
- Thank you received: 3589
Can someone provide a simple solution to creating a dual array table as I have shown in the image that either changes the "no answer" text or allows me to type in text in the yellow area?
You should be able to insert the text via JavaScript.
Something like this in the question source for the cell indicated with yellow (untested as I am responding via phone).
<script type="text/javascript" charset="utf-8"> $(document).on('ready', function(){ var text1 = "My inserted text"; $('#question{QID} table.subquestions-list thead:first tr:first > *:last-child').text(text1); }); </script>
Something like this in the question source for the cell indicated with a dotted border.
<script type="text/javascript" charset="utf-8"> $(document).on('ready', function(){ var text1 = "My inserted text"; $('#question{QID} table.subquestions-list thead:first tr:last > *:last-child').text(text1); }); </script>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
- keithgoldstein
- Topic Author
- Offline
- New Member
- Posts: 18
- Thank you received: 1
The following forum post comes close to accomplishing the solution in a normal array, but not in the dual array, and it does not add text above the "no answer" option, but rather above the question column and not the no answer column, as a row is missing. I am trying to add text to clarify that text that states "no answer":
forums.limesurvey.org/forum/can-i-do-thi...in-array-subquestion
I paste two pictures, a copy of the picture with the above manipulation in RTL, but showing where I want the explanatory text to be. The second picture shows my earlier example, as if this was LTF.
- keithgoldstein
- Topic Author
- Offline
- New Member
- Posts: 18
- Thank you received: 1
- tpartner
- Offline
- LimeSurvey Community Team
- Posts: 10098
- Thank you received: 3589
Can you attach a small sample survey (.lss file) containing only the relevant question?I am working in RTL, so the outline and highlighted text are the "no answer" option column. This would be the far right column in English, LTR. Javascript is enabled and other source manipulations do work. I think the issue is that last-child is not the correct reference to the no answer column, but I am not sure.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
- keithgoldstein
- Topic Author
- Offline
- New Member
- Posts: 18
- Thank you received: 1
- keithgoldstein
- Topic Author
- Offline
- New Member
- Posts: 18
- Thank you received: 1
This is complex work for something that seems quite basic. I am really hoping that someone has a very simple solution.
This solution no longer works in Limesurvey 3: manual.limesurvey.org/Workarounds:_Quest...stion_types_in_array
This solution seems to indicate an outdated solution, as it would require massive rewriting of the template:
forums.limesurvey.org/forum/can-i-do-thi...e-triple-scale-array
This solution is basically the same, but again it is working with only dropdown, and it is not really replicating the function like the no answer button:
forums.limesurvey.org/forum/can-i-do-thi...more-than-two-scales
This solution seems to be the concise resolution to the above, but I have not figured out how to convert it to radio buttons, and even if I do it does not entirely solve the issue.
forums.limesurvey.org/forum/can-i-do-thi...lti-array-dual-scale
This post indirectly seems to show how I could make the replacement for "no answer" an exclusive answer checkbox that will remove the answers from tthe other arrays: forums.limesurvey.org/forum/can-i-do-thi...heckbox-style#138890
This post shows directly how to make a checkbox answer exclusive in a single array.
forums.limesurvey.org/forum/can-i-do-thi...eckbox-type-question
Combining the above workarounds with the following suggestions, might do the trick?
forums.limesurvey.org/forum/can-i-do-thi...dual-scale-questions
forums.limesurvey.org/forum/design-issue...-dual-scale?start=15
forums.limesurvey.org/forum/can-i-do-thi...ray-question-problem
All of these confusing solutions though seem to be going way overboard for what should be a simple solution. It seems that I should be able to add a header above the "no answer". This way I could just clarify that did not participate above "no answer", and the problem is solved. dualscale_headerC (no answer).
- tpartner
- Offline
- LimeSurvey Community Team
- Posts: 10098
- Thank you received: 3589
(tested in version 3.22.19)
<script type="text/javascript" charset="utf-8"> $(document).on('ready', function(){ var text1 = "My inserted text 1"; var text2 = "My inserted text 2"; if($('#question{QID} table.subquestion-list th.header_no_answer').length > 0) { // Cell above "No Answer" label $('#question{QID} table.subquestion-list th.header_no_answer').text(text1); // "No Answer" label at top of table $('#question{QID} table.subquestion-list th.noanswer-text').text(text2); // "No Answer" label in block view (smaller devices) $('#question{QID} table.subquestion-list td.noanswer-item label').text(text2); } }); </script>
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.