- Posts: 14
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Multiple choice table - Discrete choice Models
- Rexha
- Topic Author
- Offline
- New Member
Less
More
5 years 9 months ago - 5 years 9 months ago #170354
by Rexha
Replied by Rexha on topic Multiple choice table - Discrete choice Models
Hello,
So I have made a new questionnaire of Discrete choice.
However, now I have different problems than before.
The displacement between the question and the answer row is too big.
Aswell the tables display in phone screen sucks.
Here is a link with an example that I prepared:
surveys.uc.pt/index.php/488679?lang=pt
Basically i have inserted the table in the question infobox, then the subquestion field is empty ( and i think that's why there is a big space between the question and the answer row).
Regarding the display problem I have no idea, besides i don't have access to the platform programming files. Still, i have contacted the administrator and he told me that my LimeSurvey version is compatible with mobile phone display (LimeSurvey
Versão 2.73.0+171219).
Thanks in advance for any help or time spent on this subject.
So I have made a new questionnaire of Discrete choice.
However, now I have different problems than before.
The displacement between the question and the answer row is too big.
Aswell the tables display in phone screen sucks.
Here is a link with an example that I prepared:
surveys.uc.pt/index.php/488679?lang=pt
Basically i have inserted the table in the question infobox, then the subquestion field is empty ( and i think that's why there is a big space between the question and the answer row).
Regarding the display problem I have no idea, besides i don't have access to the platform programming files. Still, i have contacted the administrator and he told me that my LimeSurvey version is compatible with mobile phone display (LimeSurvey
Versão 2.73.0+171219).
Thanks in advance for any help or time spent on this subject.
Last edit: 5 years 9 months ago by Rexha.
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10631
- Thank you received: 3696
5 years 9 months ago #170356
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Multiple choice table - Discrete choice Models
I think it will be almost impossible to get things to line up correctly on mobile devices if using separate tables. I would add another row to your info table and then use JavaScript to move the radios into that row.
Can you attach a small test survey containing only a single question?
Can you attach a small test survey containing only a single question?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- Rexha
- Topic Author
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 0
5 years 9 months ago #170360
by Rexha
Replied by Rexha on topic Multiple choice table - Discrete choice Models
Here is a new link as requested, with only one question:
surveys.uc.pt/index.php/797519?lang=pt
I dunno that it will help, but this is my table code:
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse;">
<tbody>
<tr>
<td style="text-align: center;" width="0%"> </td>
<td style="text-align: center;" width="0%"> </td>
<td bgcolor="#D4D7E4" style="text-align: center;" width="40%"><br />
<span style="font-size:24px;"><strong>BANANAS</strong></span><br />
</td>
<td style="text-align: center;" width="0%"> </td>
<td bgcolor="#D4D7E4" style="text-align: center;" width="40%"><span style="font-size:24px;"><strong>GREEN APPLES</strong></span></td>
</tr>
<tr style="height: 6px; text-align: center;">
</tr>
<tr>
<td bgcolor="#f2f2f2" style="text-align: center;">
<p><span style="font-size:12px;"> </span><br />
<span style="font-size:18px;">Type of Vitamins</span><span style="font-size:12px;"> </span></p>
</td>
<td style="text-align: center;" width="0%"> </td>
<td bgcolor="#f2f2f2" style="text-align: center;">
<p> </p>
<div><span style="font-size:20px;"><strong>XX</strong></span></div>
<p> </p>
</td>
<td style="text-align: center;" width="0%"> </td>
<td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:20px;"><strong>XXXX</strong></span></td>
</tr>
<tr style="height: 6px; text-align: center;">
</tr>
<tr>
<td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:18px;">Hidratos</span></td>
<td style="text-align: center;" width="0%"> </td>
<td bgcolor="#f2f2f2" style="text-align: center;">
<p><span style="font-size:20px;"><strong>SUGAR</strong></span><br />
<br />
<span style="font-size:16px;">Bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla blabla bla bla bla bla bla bla bla blabla bla bla bla bla bla bla bla blabla bla bla bla bla bla bla bla bla blabla .</span></p>
</td>
<td style="text-align: center;" width="0%"> </td>
<td bgcolor="#f2f2f2">
<p style="text-align: center;"><span style="font-size: 20px;"><b>ACID JUICE</b></span><br />
<span style="font-size:16px;">Bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla blabla bla bla bla bla bla bla bla blabla bla bla bla bla bla bla bla blabla bla bla bla bla bla bla bla bla blabla .</span></p>
</td>
</tr>
<tr>
<td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:18px;">Price</span></td>
<td style="text-align: center;" width="1%"> </td>
<td bgcolor="#f2f2f2" style="text-align: center;"><br />
<b>1 Kg - 1€</b><br />
</td>
<td style="text-align: center;" width="1%"> </td>
<td bgcolor="#f2f2f2" style="text-align: center;"><strong>1Kg - 0.95 €</strong></td>
</tr>
</tbody>
</table>
surveys.uc.pt/index.php/797519?lang=pt
I dunno that it will help, but this is my table code:
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse;">
<tbody>
<tr>
<td style="text-align: center;" width="0%"> </td>
<td style="text-align: center;" width="0%"> </td>
<td bgcolor="#D4D7E4" style="text-align: center;" width="40%"><br />
<span style="font-size:24px;"><strong>BANANAS</strong></span><br />
</td>
<td style="text-align: center;" width="0%"> </td>
<td bgcolor="#D4D7E4" style="text-align: center;" width="40%"><span style="font-size:24px;"><strong>GREEN APPLES</strong></span></td>
</tr>
<tr style="height: 6px; text-align: center;">
</tr>
<tr>
<td bgcolor="#f2f2f2" style="text-align: center;">
<p><span style="font-size:12px;"> </span><br />
<span style="font-size:18px;">Type of Vitamins</span><span style="font-size:12px;"> </span></p>
</td>
<td style="text-align: center;" width="0%"> </td>
<td bgcolor="#f2f2f2" style="text-align: center;">
<p> </p>
<div><span style="font-size:20px;"><strong>XX</strong></span></div>
<p> </p>
</td>
<td style="text-align: center;" width="0%"> </td>
<td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:20px;"><strong>XXXX</strong></span></td>
</tr>
<tr style="height: 6px; text-align: center;">
</tr>
<tr>
<td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:18px;">Hidratos</span></td>
<td style="text-align: center;" width="0%"> </td>
<td bgcolor="#f2f2f2" style="text-align: center;">
<p><span style="font-size:20px;"><strong>SUGAR</strong></span><br />
<br />
<span style="font-size:16px;">Bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla blabla bla bla bla bla bla bla bla blabla bla bla bla bla bla bla bla blabla bla bla bla bla bla bla bla bla blabla .</span></p>
</td>
<td style="text-align: center;" width="0%"> </td>
<td bgcolor="#f2f2f2">
<p style="text-align: center;"><span style="font-size: 20px;"><b>ACID JUICE</b></span><br />
<span style="font-size:16px;">Bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla blabla bla bla bla bla bla bla bla blabla bla bla bla bla bla bla bla blabla bla bla bla bla bla bla bla bla blabla .</span></p>
</td>
</tr>
<tr>
<td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:18px;">Price</span></td>
<td style="text-align: center;" width="1%"> </td>
<td bgcolor="#f2f2f2" style="text-align: center;"><br />
<b>1 Kg - 1€</b><br />
</td>
<td style="text-align: center;" width="1%"> </td>
<td bgcolor="#f2f2f2" style="text-align: center;"><strong>1Kg - 0.95 €</strong></td>
</tr>
</tbody>
</table>
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10631
- Thank you received: 3696
5 years 9 months ago #170361
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Multiple choice table - Discrete choice Models
Can you please attach an export (.lss file) of a survey, not a link?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- Rexha
- Topic Author
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 0
5 years 9 months ago #170362
by Rexha
Replied by Rexha on topic Multiple choice table - Discrete choice Models
There you go, and thank you for all the help.
Attachments:
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10631
- Thank you received: 3696
5 years 9 months ago #170368
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Multiple choice table - Discrete choice Models
I would do something like this. You can see that I have added a row to the table in the question text and inserted a script to move the radios up into that row.
You may still need some CSS tweaks for phones in portrait mode but test as-is first.
Here is your test survey back with those changes:
You may still need some CSS tweaks for phones in portrait mode but test as-is first.
Code:
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse;"> <tbody> <tr> <td style="text-align: center;" width="0%"> </td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#D4D7E4" style="text-align: center;" width="40%"><br /> <span style="font-size:24px;"><strong>BANANAS</strong></span><br /> </td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#D4D7E4" style="text-align: center;" width="40%"><span style="font-size:24px;"><strong>GREEN APPLES</strong></span></td> </tr> <tr style="height: 6px; text-align: center;"> </tr> <tr> <td bgcolor="#f2f2f2" style="text-align: center;"> <p><span style="font-size:12px;"> </span><br /> <span style="font-size:18px;">Type of Vitamins</span><span style="font-size:12px;"> </span></p> </td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"> <p> </p> <div><span style="font-size:20px;"><strong>XX</strong></span></div> <p> </p> </td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:20px;"><strong>XXXX</strong></span></td> </tr> <tr style="height: 6px; text-align: center;"> </tr> <tr> <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:18px;">Hidratos</span></td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"> <p><span style="font-size:20px;"><strong>SUGAR</strong></span><br /> <br /> <span style="font-size:16px;">Bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla blabla bla bla bla bla bla bla bla blabla bla bla bla bla bla bla bla blabla bla bla bla bla bla bla bla bla blabla .</span></p> </td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2"> <p style="text-align: center;"><span style="font-size: 20px;"><b>ACID JUICE</b></span><br /> <span style="font-size:16px;">Bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla blabla bla bla bla bla bla bla bla blabla bla bla bla bla bla bla bla blabla bla bla bla bla bla bla bla bla blabla .</span></p> </td> </tr> <tr> <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:18px;">Price</span></td> <td style="text-align: center;" width="1%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"><br /> <b>1 Kg - 1€</b><br /> </td> <td style="text-align: center;" width="1%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"><strong>1Kg - 0.95 €</strong></td> </tr> <tr style="height: 6px; text-align: center;"> <td colspan="5"></td> </tr> <tr> <td bgcolor="#f2f2f2" style="text-align: center;"></td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"></td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2"></td> </tr> </tbody> </table> <script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify this question var thisQuestion = $('#question{QID}'); // Move the radios $('.question-text table:eq(0) tr:last td:eq(2)', thisQuestion).append($('.subquestion-list .answers-list:eq(0) .answer-item:eq(0) *', thisQuestion)); $('.question-text table:eq(0) tr:last td:eq(4)', thisQuestion).append($('.subquestion-list .answers-list:eq(0) .answer-item:eq(1) *', thisQuestion)); // Some classes for presentation $('.question-text table:eq(0) input:radio', thisQuestion).closest('td').addClass('answer-item radio-item text-center radio'); $('.question-text table:eq(0) .radio-item label', thisQuestion).show(); // Click event on the table cells $('.question-text table:eq(0) .radio-item', thisQuestion).on('click', function(e) { $('input:radio', this).trigger('click'); }); $('.question-text table:eq(0) input:radio', thisQuestion).on('click', function(e) { e.stopPropagation(); }); // Clean-up styles $('.answer-container', thisQuestion).hide(); $('.question-text table:eq(0) .label-text', thisQuestion).remove(); $('.question-text table:eq(0) .radio-text', thisQuestion).css({ 'cursor': 'pointer' }); }); </script>
Here is your test survey back with those changes:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The topic has been locked.
- tapinho
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
5 years 8 months ago #171479
by tapinho
Replied by tapinho on topic Multiple choice table - Discrete choice Models
Hey guys, I was trying to implement this code above, since I also need to create a discrete choice survey, but it does not quite look the same. The clickable dots underneath each option do not appear. I tried several options of question types, but none of them seem to do the trick.
I am using the Version 2.50+ Build 160620 in my browser which is made available by my university.
I am using the Version 2.50+ Build 160620 in my browser which is made available by my university.
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10631
- Thank you received: 3696
5 years 8 months ago #171482
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Multiple choice table - Discrete choice Models
Did you try the test survey attached to the previous post?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- tapinho
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
5 years 8 months ago #171484
by tapinho
Replied by tapinho on topic Multiple choice table - Discrete choice Models
I am not able to open the attachment since I don't have a programm to open it with. I tried the code provided by Rexha and it gives me more or less the same result.
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10631
- Thank you received: 3696
5 years 8 months ago #171485
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Multiple choice table - Discrete choice Models
Don't try to open it, it's an export of a survey, simply import it into LimeSurvey.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: tapinho
The topic has been locked.
- tapinho
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
5 years 8 months ago #171487
by tapinho
Replied by tapinho on topic Multiple choice table - Discrete choice Models
I was able to import the file and I tried to recreate it in my own survey but I was not able to get the same result. Underneath the "Banana&Apple" table, I get the following code:
'); $('#question93143 table.subquestions-list .inserted-row td:eq(0)').html($('#question93143 th.answertext:eq(0)').html()); $('#question93143 th.answertext:eq(0)').html(''); }); '); $('#question93143 table.subquestions-list .inserted-row td:eq(0)').html($('#question93143 th.answertext:eq(0)').html()); $('#question93143 th.answertext:eq(0)').html(''); });
and only one clickable radio(if that is what it's called).
Thank you, by the way, for the quick response time.
'); $('#question93143 table.subquestions-list .inserted-row td:eq(0)').html($('#question93143 th.answertext:eq(0)').html()); $('#question93143 th.answertext:eq(0)').html(''); }); '); $('#question93143 table.subquestions-list .inserted-row td:eq(0)').html($('#question93143 th.answertext:eq(0)').html()); $('#question93143 th.answertext:eq(0)').html(''); });
and only one clickable radio(if that is what it's called).
Thank you, by the way, for the quick response time.
The topic has been locked.
- tapinho
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
5 years 8 months ago #171489
by tapinho
Replied by tapinho on topic Multiple choice table - Discrete choice Models
I also tried to attach my export file, but it is a .lsq file instead of a .lss file. How do I convert it?
The topic has been locked.