New Lime Version won't let me use the same script for array headings

More
1 month 3 weeks ago #188989 by drbray
On my old limesurvey i could use this in the 'source' question box to create headers for an array (without subquestions in the array)...
<script type="text/javascript" charset="utf-8">		
	$(document).ready(function(){
 
		// IDENTIFY THIS QUESTION
		var thisQuestion = $('#question{QID}');
 
		// HIDE SUB-QUESTION
		$('.subquestions-list .col-responses .col-answers', thisQuestion).hide();
		$('.subquestions-list thead td', thisQuestion).hide();
		$('.subquestions-list .answertext', thisQuestion).hide();
		$('.subquestions-list col', thisQuestion).attr('width', (100/$('.subquestions-list col', thisQuestion).length)+'%');
 
		// ADD HEADER ROW
		$('table.subquestions-list thead', thisQuestion).prepend('<tr class="new-header">\
		<th colspan="11" style="text-align:left;">Poor<span style="float:right">Excellent</span></th>\
		</tr>');
	});
</script>

But this does not work in my new version of LimeSurvey (Version 3.17.16+190906)

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
1 week 6 days ago #190631 by drbray

Please Log in or Create an account to join the conversation.

More
1 week 5 days ago #190632 by tpartner
Can you attach a small sample survey (.lss file) containing only that question?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

More
1 week 5 days ago #190633 by drbray
I think the problem is that i can't get the "addScriptToQuestion" plugin to properly show up in my admin plugins menu. I have v. 4 Limesurvey running...i guess it doesn't recognize the plugin when i put it into the proper server directory. Any ideas?

Please Log in or Create an account to join the conversation.

More
1 week 5 days ago #190634 by Joffm

i can't get the "addScriptToQuestion" plugin to properly show up in my admin plugins menu. I have v. 4 Limesurvey running


As far as I see in the LimeStore this script is not LS v4.x compatible
Compatibility: 2.73, 3.x

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in or Create an account to join the conversation.

More
1 week 5 days ago - 1 week 4 days ago #190635 by tpartner
Don't bother with that plugin, simply place the script on the source of the question text.

Note that version 4 is not a stable release and should NOT be used for production.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Last edit: 1 week 4 days ago by tpartner.
The following user(s) said Thank You: DenisChenu

Please Log in or Create an account to join the conversation.

More
1 week 5 days ago #190636 by drbray
Yes, i'm just using it for testing purposes...thank you for making sure that i knew it was a beta version; i appreciate it.

When i put the script into the 'source' question text it doesn't work. The script is in my OP.

Please Log in or Create an account to join the conversation.

More
1 week 4 days ago #190639 by tpartner
I say again, can you attach a small sample survey (.lss file) containing only that question?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

More
1 week 1 day ago #190825 by drbray
I have an lsq file...

File Attachment:

File Name: limesurvey..._138.lsq
File Size:7 KB
Attachments:

Please Log in or Create an account to join the conversation.

More
1 week 1 day ago #190828 by jelo

drbray wrote: I have an lsq file...

Which is not what Tpartner asked for.
An LSS export is needed to have a working survey with all the settings you use. An LSQ files is not working without creating a new survey with the correct language and then importing the LSQ into that new survey. Additional work for helping hands.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: tpartner

Please Log in or Create an account to join the conversation.

More
1 week 8 hours ago #190876 by drbray
He asked for an LSS of only that question....the only thing i was permitted to export it as question was to use LSQ. I'm unable to upload the whole survey because of client privileges.

Please Log in or Create an account to join the conversation.

More
1 week 8 hours ago - 1 week 8 hours ago #190877 by tpartner
Yes, I did ask for a .lss file (a survey export). I don't want to waste my volunteer time creating surveys.

If you can provide a question export, surely you can copy the survey and remove everything except for the relevant question(s).

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Last edit: 1 week 8 hours ago by tpartner.

Please Log in or Create an account to join the conversation.

More
1 week 8 hours ago #190878 by drbray
so this script does work (though it doesn't get me exactly what i need)...
<script type="text/javascript" charset="utf-8">		
	$(document).on('ready pjax:scriptcomplete',function(){
 
		// IDENTIFY THIS QUESTION
		var thisQuestion = $('#question{QID}');
 
		// HIDE SUB-QUESTION
		$('.subquestions-list .col-responses .col-answers', thisQuestion).hide();
		$('.subquestions-list thead td', thisQuestion).hide();
		$('.subquestions-list .answertext', thisQuestion).hide();
		$('.subquestions-list col', thisQuestion).attr('width', (100/$('.subquestions-list col', thisQuestion).length)+'%');
 
		// ADD HEADER ROW
		$('table.subquestions-list thead', thisQuestion).prepend('<tr class="new-header">\
		<th colspan="11" style="text-align:left;">Poor<span style="float:right">Excellent</span></th>\
		</tr>');
	});
</script>

But this code doesn't work...
<script type="text/javascript" charset="utf-8">
 
	$(document).on('ready pjax:scriptcomplete',function(){
		// Insert the column categories
		$('#question{QID} table.subquestion-list thead tr:eq(0) td:eq(0)').remove();
		$('#question{QID} table.subquestion-list thead').prepend('<tr class="ls-heading">\
																	<td rowspan="2" colspan="2"></td>\
																	<th class="answer-text inserted-header" colspan="3">Dissatisfied</th>\
			<th class="answer-text inserted-header" colspan="5"> </th>\
																	<th class="answer-text inserted-header" colspan="3">Very Satisfied</th>\
																</tr>');
	});	
</script>

Please Log in or Create an account to join the conversation.

More
1 week 8 hours ago #190879 by drbray
The LSS file...

File Attachment:

File Name: limesurvey...1001.lss
File Size:222 KB
Attachments:

Please Log in or Create an account to join the conversation.

More
6 days 17 hours ago #190902 by tpartner
Seriously? You provide a survey with 50 mandatory questions displayed question-by-question. Why are you making it so difficult for us to help you.

I say again, can you attach a small sample survey (.lss file) containing only that question?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!