- Posts: 12943
- Thank you received: 3979
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Random Brand selection for Multi Choice
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
2 years 6 months ago #220506
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Random Brand selection for Multi Choice
And there is a solution without "installing" the plugin.
As you might have seen, the php-file only registers the js-file and the css-file.
So you can insert the code of these files directly into your question (in source code mode) or your theme (custom.js, custom.css).
Like:
and
Joffm
As you might have seen, the php-file only registers the js-file and the css-file.
Code:
$oEvent = $this->event; $iSurveyId = $oEvent->get('surveyId'); $assetUrl = Yii::app()->assetManager->publish(dirname(__FILE__) . '/assets'); Yii::app()->clientScript->registerScriptFile($assetUrl . '/hideemptycolumn.js',CClientScript::POS_END); Yii::app()->clientScript->registerCssFile($assetUrl . '/hideemptycolumn.css');
So you can insert the code of these files directly into your question (in source code mode) or your theme (custom.js, custom.css).
Like:
Code:
<script> $(document).on('ready pjax:scriptcomplete',function(){ $("table.question,table.ls-answers").each(function(){ var basetable=$(this); basetable.find('col.odd,col.even,col.ls-col-odd,col.ls-col-even').addClass('havewidth'); $(this).find("thead tr:last-child th").each(function(){ if($.trim($(this).html())==""){ if(basetable.find('col.havewidth').length){ basetable.find('col.havewidth').removeAttr('width').removeClass('havewidth'); } var colindex=$(this).parent('tr').find('td,th').index($(this)); basetable.find('col').eq(colindex).css('width',0); basetable.find('col').eq(colindex).width(0); basetable.find('tr').each(function(){ $(this).find('td,th').eq(colindex).addClass('hideEmptyColumn-hiddencolumn').children().hide(); }); basetable.addClass('hideEmptyColumn-widthhiddencolumn'); } }); }); }); </script>
and
Code:
<style type="text/css">td.hideEmptyColumn-hiddencolumn,th.hideEmptyColumn-hiddencolumn{ overflow:hidden !important; border-spacing:0 !important; border-collapse:collapse !important; padding:0 !important; width: 0 !important; height: 0 !important; min-width: 0 !important; } td.hideEmptyColumn-hiddencolumn *,th.hideEmptyColumn-hiddencolumn * { display:none; } table.ls-answers > tbody > tr > td.hideEmptyColumn-hiddencolumn{border-collapse:collapse !important;} table.hideEmptyColumn-widthhiddencolumn{ border-collapse:collapse !important; } </style>
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- scene143
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 57
- Thank you received: 1
2 years 6 months ago #220510
by scene143
Replied by scene143 on topic Random Brand selection for Multi Choice
Thank you very much Joffm ...
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
2 years 6 months ago #220522
by DenisChenu
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.
Replied by DenisChenu on topic Random Brand selection for Multi Choice
Yep,Still need to create a plugin with question settings for this
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.
The topic has been locked.