Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Hiding the main question of array type questions

Hiding the main question of array type questions 1 Jahr 1 Tag her #109274

  • Foram
  • Forams Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 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 ?
Anhang:
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Hiding the main question of array type questions 1 Jahr 1 Tag her #109275

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4846
  • Dank erhalten: 989
  • Karma: 417
LimeSurvey version?

Template being used?


.
Cheers,
Tony Partner

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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Hiding the main question of array type questions 1 Jahr 1 Tag her #109281

  • Foram
  • Forams Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Hiding the main question of array type questions 1 Jahr 7 Stunden her #109318

  • DenisChenu
  • DenisChenus Avatar
  • ONLINE
  • Moderator Lime
  • Beiträge: 7162
  • Dank erhalten: 983
  • Karma: 287
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Hiding the main question of array type questions 1 Jahr 4 Stunden her #109324

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4846
  • Dank erhalten: 989
  • Karma: 417
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Letzte Änderung: 1 Jahr 4 Stunden her von tpartner.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Hiding the main question of array type questions 1 Jahr 4 Stunden her #109326

  • DenisChenu
  • DenisChenus Avatar
  • ONLINE
  • Moderator Lime
  • Beiträge: 7162
  • Dank erhalten: 983
  • Karma: 287
tpartner schrieb:
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
Letzte Änderung: 1 Jahr 4 Stunden her von DenisChenu.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.285 Sekunden
Donation Image