Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Hiding the main question of array type questions

Hiding the main question of array type questions 2 years 2 months ago #109274

  • Foram
  • Foram's Avatar
  • Offline
  • Junior Lime
  • Posts: 24
  • Karma: 0
Hi,

I have added array type question in my survey. I only have sub-questions for it.No Main question. So I have left the question field blank when I created the survey. But now when I am testing the survey that blank field is being displayed. Can I remove this space ?
Attachments:
The administrator has disabled public write access.

Hiding the main question of array type questions 2 years 2 months ago #109275

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 6126
  • Thank you received: 1359
  • Karma: 534
LimeSurvey version?

Template being used?


.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

Hiding the main question of array type questions 2 years 2 months ago #109281

  • Foram
  • Foram's Avatar
  • Offline
  • Junior Lime
  • Posts: 24
  • Karma: 0
LimeSurvey Version : 2.05+
Template used : basic

I have created the copy of basic template and I am changing it according to our requirement.
The administrator has disabled public write access.

Hiding the main question of array type questions 2 years 1 month ago #109318

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9269
  • Thank you received: 1321
  • Karma: 383
Hi,

I think you can do it like this, without any system, in question.pstpl:

replace
<span class="asterisk">{QUESTION_MANDATORY}</span><span class="qnumcode">{QUESTION_NUMBER} {QUESTION_CODE} </span>{QUESTION_TEXT}<br /><span class="questionhelp">{QUESTION_HELP}</span>
by
{if(trim(QUESTION_TEXT)!="","<span class='asterisk'>"+QUESTION_MANDATORY+"</span><span class='qnumcode'>"+QUESTION_NUMBER+" "+QUESTION_CODE+" </span>"+QUESTION_TEXT+"<br /><span class='questionhelp'>"+QUESTION_HELP+"</span>","")}

Maybe some correction to do.
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.

Hiding the main question of array type questions 2 years 1 month ago #109324

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 6126
  • Thank you received: 1359
  • Karma: 534
Good tip Denis but I think that will still leave the row visible with some padding.

Another solution would be to set up your survey to use JavaScript and add this to the source of the question text:

<script type="text/javascript" charset="utf-8">	
	$(document).ready(function() { 
		$('#question{QID} td.be').closest('tr').hide();
	});
</script>


.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 2 years 1 month ago by tpartner.
The administrator has disabled public write access.

Hiding the main question of array type questions 2 years 1 month ago #109326

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9269
  • Thank you received: 1321
  • Karma: 383
tpartner wrote:
Good tip Denis but I think that will still leave the row visible with some padding.
I use it a lot in SkeletonQuest but more for 'question help' then we can use padding on question help without any other javasript.

git.sondages.pro/?p=skeletonquest.git/.g...lob;f=question.pstpl
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
Last Edit: 2 years 1 month ago by DenisChenu.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.206 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form