NPS Colorscale in Limesurvey?

Plus d'informations
il y a 1 semaine 2 jours #183259 par LimeRay
COM_KUNENA_MESSAGE_CREATED_NEW
Hi,
I have made myself a NPS (Net Promotor Score) survey and it works just fine.
When I browsed for some help I came across this Add Colors in question"Add Colors in questions" And it got me thinking.
Would it be possible to make an array question look like the attached file?



I have been trying to split the "headerrow in my question" but not been lucky yet. The closest I've gotten so far is



I don't care for the emojis but I would love if the "colorbar could be as one"

Thanks for any help in advance!
Pièces jointes :

Connexion ou Créer un compte pour participer à la conversation.

LimeSurvey Partners
Plus d'informations
il y a 6 jours 4 heures #183331 par tpartner
COM_KUNENA_MESSAGE_REPLIED_NEW
LimeSurvey version?

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 6 jours 1 heure #183341 par LimeRay
COM_KUNENA_MESSAGE_REPLIED_NEW
Version 3.7

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 5 jours 20 heures - il y a 5 jours 20 heures #183356 par tpartner
COM_KUNENA_MESSAGE_REPLIED_NEW
You can do it with a combination of JavaScript and CSS.

Add something like this script to the question source:

<script type="text/javascript" charset="utf-8">
 
	$(document).on('ready pjax:scriptcomplete',function(){
 
		// Identify this question
		var thisQuestion = $('#question{QID}');
 
		// Add a question class
		thisQuestion.addClass('custom-array');
 
		// Column-specific classes
		$('table.subquestion-list tr', thisQuestion).each(function(i) {
			$('th, td', this).each(function(i) {
				$(this).addClass('column-'+i);
			});
		});
 
		// Listener on the radios
		$('input:radio', thisQuestion).on('click', function(i) {
			$(this).closest('tr').find('.active-item').removeClass('active-item');
			$(this).closest('td').addClass('active-item');
		});
	});
</script>

Add some CSS rules like this to the question source (or custom.css file):

<style type="text/css">
	.custom-array table.subquestion-list thead td,
	.custom-array table.subquestion-list thead th {
		border-bottom-width: 8px;
		border-bottom-style: solid;
	}
 
	.custom-array table.subquestion-list thead .column-1 { border-bottom-color: #00A800; }
	.custom-array table.subquestion-list thead .column-2 { border-bottom-color: #5AC100; }
	.custom-array table.subquestion-list thead .column-3 { border-bottom-color: #9DD600; }
	.custom-array table.subquestion-list thead .column-4 { border-bottom-color: #9CE400; }
	.custom-array table.subquestion-list thead .column-5 { border-bottom-color: #E2EC00; }
	.custom-array table.subquestion-list thead .column-6 { border-bottom-color: #ECEC00; }
	.custom-array table.subquestion-list thead .column-7 { border-bottom-color: #ECE200; }
	.custom-array table.subquestion-list thead .column-8 { border-bottom-color: #E4C900; }
	.custom-array table.subquestion-list thead .column-9 { border-bottom-color: #D69D00; }
	.custom-array table.subquestion-list thead .column-10 { border-bottom-color: #C15A00; }
	.custom-array table.subquestion-list thead .column-11 { border-bottom-color: #A80200; }
 
	.custom-array td.column-1:hover,
	.custom-array td.active-item.column-1 { background-color: #00A800; }
 
	.custom-array td.column-2:hover,
	.custom-array td.active-item.column-2 { background-color: #5AC100; }
 
	.custom-array td.column-3:hover,
	.custom-array td.active-item.column-3 { background-color: #9DD600; }
 
	.custom-array td.column-4:hover,
	.custom-array td.active-item.column-4 { background-color: #9CE400; }
 
	.custom-array td.column-5:hover,
	.custom-array td.active-item.column-5 { background-color: #E2EC00; }
 
	.custom-array td.column-6:hover,
	.custom-array td.active-item.column-6 { background-color: #ECEC00; }
 
	.custom-array td.column-7:hover,
	.custom-array td.active-item.column-7 { background-color: #ECE200; }
 
	.custom-array td.column-8:hover,
	.custom-array td.active-item.column-8 { background-color: #E4C900; }
 
	.custom-array td.column-9:hover,
	.custom-array td.active-item.column-9 { background-color: #D69D00; }
 
	.custom-array td.column-10:hover,
	.custom-array td.active-item.column-10 { background-color: #C15A00; }
 
	.custom-array td.column-11:hover,
	.custom-array td.active-item.column-11 { background-color: #A80200; }
</style>

Sample survey attached:

Fichier attaché :

Nom du fichier : limesurvey...4-15.lss
Taille du ficher :22 ko

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Pièces jointes :
Last edit: il y a 5 jours 20 heures by tpartner.
Les utilisateur(s) suivant ont remercié: krosser

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 5 jours 19 heures #183358 par LimeRay
COM_KUNENA_MESSAGE_REPLIED_NEW
Tony, this was unbelievably good!!!
A huge thank you! You have just made my day!

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 5 jours 20 minutes #183393 par holch
COM_KUNENA_MESSAGE_REPLIED_NEW
Didn't work for me when used in the question text, will need to make a test with a special template. could be helpful in the future.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 jours 23 heures #183399 par tpartner
COM_KUNENA_MESSAGE_REPLIED_NEW
@holch, did you try the sample .lss?

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 jours 23 heures #183403 par holch
COM_KUNENA_MESSAGE_REPLIED_NEW
Yes, imported your sample LSS and pasted the CSS code into the question text. No colors appeared. Will need to check with a custom template. Maybe the problem is actually the template. I used bootstrap. Will need to check a little bit further today.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 jours 23 heures #183404 par tpartner
COM_KUNENA_MESSAGE_REPLIED_NEW
Hmm...both JS and CSS are already in the question source in that .lss. You shouldn't need to paste anything.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 jours 21 heures #183405 par holch
COM_KUNENA_MESSAGE_REPLIED_NEW
OK, the problem was the missing Javascript. I somehow had the impression that the Javascript must already be there, but the CSS needs to be pasted.

I don't know why, but when I imported the LSS there was no CSS and no JS in the question text. However, the Editor was on as default, might have deleted the CSS and the JS. Strange. Will try to import it again and see what happens.

At least I am sure that I did NOT delete it personally, because the first thing I did when importing I previewed the question and nothing happend. Then I went in to put the scripts.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 jours 21 heures #183406 par holch
COM_KUNENA_MESSAGE_REPLIED_NEW
By the way: Looks pretty great! (besides my personal dislike of the NPS as a sole measure, but that is a different topic ;-) )

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 jours 5 heures #183417 par jelo
COM_KUNENA_MESSAGE_REPLIED_NEW

holch écrit: Will try to import it again and see what happens.

Was the import issue reproducible?

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 jours 57 minutes #183426 par holch
COM_KUNENA_MESSAGE_REPLIED_NEW
I did a quick import again and the colors don't show in preview, but somehow the code shows in the question.

Unfortunately I did it in between other things, stopped a while, went back, etc. So I can't really tell 100% what I did, etc.

But I can tell one thing: After importing the LSS file and looking at the preview, the colors don't show. When I did insert the codes from the post manually, the colors showed.

Will see if I find some time to test over the holiday with a little bit more controlled settings and a clearer approach to check what is happening.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 jours 34 minutes #183429 par tpartner
COM_KUNENA_MESSAGE_REPLIED_NEW
Hmm...I just imported to 3.17 and it worked as expected without any editing.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 jours 17 minutes #183430 par holch
COM_KUNENA_MESSAGE_REPLIED_NEW
As I said, I will do a new test when things are calmer and I can focus purely on this, not doing 3 things at the same time. Might be something I did, might be something with my installation (though it is the latest version, updated right before I imported this LSS for the first time).

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Connexion ou Créer un compte pour participer à la conversation.

Commencez dès maintenant !

Créez simplement un compte et commencez à utiliser LimeSurvey dès aujourd'hui.

Inscrivez-vous maintenant

Inscrivez-vous à notre Newsletter!