- Posts: 6
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
LouisGac wrote: Hi,
It should be possible to adapt old survey template with the new system without too much difficulties.
We're working on it for the future.
Here basically the work that must be done (you can help with it) :
1. All the question types, less arrays, have now separated views :
github.com/LimeSurvey/LimeSurvey/tree/ma...ews/survey/questions
In a close future, this will give the possibility to any LimeSurvey user with some skill in PHP/JS/CSS to add new question rendering, with its own HTML, JS files, and CSS, and to share them as question modules.
Have a look to the YES/NO question or GENDER question and their new question attribute to see how it works. Basically, for gender question, you can see that we added new 'button' views :
github.com/LimeSurvey/LimeSurvey/tree/ma...vey/questions/gender
accessible via the 'display' question attribute.
2. So, we must finish to export the array question HTML to view
3. Then we must add the old question HTML of 2.0x as views accessible via a display option
For now, I will advise you just to build new template on the base of one of the new ones. They use Bootstrap (easy to use), and are fully responsive.
<style type="text/css"> .answer_cell_001, .answer_cell_1 { Background-color: red !important; } .answer_cell_003, .answer_cell_3 { Background-color: yellow !important; } .answer_cell_006, .answer_cell_6 { Background-color: #DDDDDD !important; } </style>
$(document).ready(function() { $('.coloured-array').each(function(i) { // Assign column-specific classes $('table.subquestion-list tr', this).each(function(i) { $('> *:gt(0)', this).each(function(i){ $(this).addClass('column-'+(i+1)); }); }); }); });
.coloured-array .column-1 { background-color: #FF5B5B;} .coloured-array .column-2 { background-color: #FF9B57;} .coloured-array .column-3 { background-color: #F4F781;} .coloured-array .column-4 { background-color: #99FDA3;} .coloured-array .column-5 { background-color: #53C170;}
/*** Array Colors are defined here***/ .coloured-array .column-1 { background-color: #FF5B5B;} .coloured-array .column-2 { background-color: #FF9B57;} .coloured-array .column-3 { background-color: #F4F781;} .coloured-array .column-4 { background-color: #99FDA3;} .coloured-array .column-5 { background-color: #53C170;}
$('.coloured-array').each(function(i) { // Assign column-specific classes $('table.subquestion-list tr', this).each(function(i) { $('> *:gt(0)', this).each(function(i){ $(this).addClass('column-'+(i+1)); }); }); });
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ $('.coloured-array.array-flexible-duel-scale').each(function(i) { // Assign column-specific classes $('table.subquestion-list tr.ls-heading:not(.groups)', this).each(function(i) { $('.answer-text', this).each(function(i){ $(this).addClass('column-'+(i+1)); }); }); }); }); </script>
<style type="text/css"> .coloured-array.array-flexible-duel-scale .column-1 { background-color: #FF9B57;} /* Orange */ .coloured-array.array-flexible-duel-scale .column-2 { background-color: #F4F781;} /* Yellow*/ .coloured-array.array-flexible-duel-scale .column-3 { background-color: #53C170;} /* Green*/ .coloured-array.array-flexible-duel-scale .column-4 { background-color: #FF9B57;} /* Orange */ .coloured-array.array-flexible-duel-scale .column-5 { background-color: #F4F781;} /* Yellow*/ .coloured-array.array-flexible-duel-scale .column-6 { background-color: #53C170;} /* Green*/ .coloured-array.array-flexible-duel-scale .column-7 { background-color: #FF5B5B;} /* Red*/ </style>