Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Hide HELP by default

  • BITCNI
  • BITCNI's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
4 years 11 months ago #183257 by BITCNI
Hide HELP by default was created by BITCNI
We use the 'Help' feature in each question extensively, as the Survey we're carrying out relates to Environmental Best Practice, so we need to ensure there is sufficient guidance.
However, this is always visible by default, and it makes the Survey very long on the screen, and it will not be required by every participant.
Can we change the behavior so that a user can hover over a Question mark or can click to expand the Help section to see the Guidance instead of it always being on the screen by default?

Many thanks
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 11 months ago #183260 by DenisChenu
Replied by DenisChenu on topic Hide HELP by default

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: cdorin
The topic has been locked.
  • BITCNI
  • BITCNI's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
4 years 11 months ago #183279 by BITCNI
Replied by BITCNI on topic Hide HELP by default
Thanks for your reply.
When I go into theme options, all I see is "inherit" in every box.
Which one contains the Survey Question Help code you put on GitHub?
Do you have to go into the code of every question to add this, eg,
<a class="collapsed" role="button" data-bs-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
Collapsible Group Item #3
</a>
And where does the JavaScript code go?
<button type="button" id="myStateButton" data-complete-text="finished!" class="btn btn-primary" autocomplete="off">
...
</button>

<script>
$('#myStateButton').on('click', function () {
$(this).button('complete') // button text will be "finished!"
})
</script>
Sorry, but I'm a bit out of my depth here (as I'm sure you can tell)!
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 11 months ago #183284 by DenisChenu
Replied by DenisChenu on topic Hide HELP by default
Not option : editor manual.limesurvey.org/Theme_editor

In Question part : you can hack survey_question_help.twig

But : i don't hack it for you , it can be done, but need done experimentation and (maybe) knowledge

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: cdorin
The topic has been locked.
More
4 years 11 months ago - 4 years 11 months ago #183325 by cdorin
Replied by cdorin on topic Hide HELP by default
Not sure if you have done it already. So, a really simple/basic solution is this:


<div class="{{ aSurveyInfo.class.helpcontainer }} text-info col-xs-12 " {{ aSurveyInfo.attr.helpcontainer }}>
{% if aQuestion.help.show %}
<div class="{{ aSurveyInfo.class.lsquestionhelp }}">
<button class="btn btn-primary" type="button" data-bs-toggle="collapse" data-bs-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
Help
</button>
<div class="collapse" id="collapseExample">
<div class="well">
{{ aQuestion.help.text | raw }}
</div>
</div>
</div>
{% else %}
{{ aQuestion.help.text | raw }}
{% endif %}
</div>


Please note that I haven't spent time customizing it. I just followed the links provided by Denis :).

To access the area Denis is talking about: Themes -> extend Fruity -> Access the new extended theme (click on Theme editor) -> Screen -> Question -> Survey_question_help.twig -> save the old text/comment it out and add the one from above.

Hope it helps!

Manual: manual.limesurvey.org/LimeSurvey_Manual
Bugs tracker: bugs.limesurvey.org/my_view_page.php
If you self-host and need help, contact one of our partners: limesurvey.com
Please do not contact me via PM - thank you.
Last edit: 4 years 11 months ago by cdorin. Reason: small correction
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 11 months ago - 4 years 11 months ago #183330 by DenisChenu
Replied by DenisChenu on topic Hide HELP by default

cdorin wrote: …
Please note that I haven't spent time customizing it. I just followed the links provided by Denis :).

Great :)

Just an idea about Help translation, maybe replace the Hard Coded Help by
Code:
{{ gT("Question help") }}
in translate.limesurvey.org

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 4 years 11 months ago by DenisChenu. Reason: \o/ partial url encoding link
The topic has been locked.
  • BITCNI
  • BITCNI's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
4 years 11 months ago - 4 years 11 months ago #183332 by BITCNI
Replied by BITCNI on topic Hide HELP by default
Hi. Thanks for your reply.
I went into the code and replaced it with the one you specified. I now have a 'Help' button, which looks good. However, when I click any Help button, the only help that expands is the first question at the top of the page. :(
Is it because I'm in the Survey Preview, or does this have to be applied to each question somehow?
Cheers
Last edit: 4 years 11 months ago by BITCNI.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 11 months ago #183337 by tpartner
Replied by tpartner on topic Hide HELP by default
Try this in survey_question_help.twig:

Code:
<div class="{{ aSurveyInfo.class.helpcontainer }} text-info col-xs-12 " {{ aSurveyInfo.attr.helpcontainer }}>
    {% if aQuestion.help.show %}
    <div class="{{ aSurveyInfo.class.lsquestionhelp }}">
        <button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#help{{ aQuestion.qid }}" aria-expanded="false" aria-controls="help{{ aQuestion.qid }}">
            {{ gT("Question help") }}
        </button>
        <div class="collapse" id="help{{ aQuestion.qid }}">
            <div class="well">
          {{ aQuestion.help.text | raw }}
        </div>
      </div>
    </div>
    {% else %}
    {{ aQuestion.help.text | raw }}
    {% endif %}
</div>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu, cdorin
The topic has been locked.
  • BITCNI
  • BITCNI's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
4 years 11 months ago #183342 by BITCNI
Replied by BITCNI on topic Hide HELP by default
Yep: that seems to be it!
Thank you SO much :)
Hope to see this in a future version of LimeSurvey (ie, the ability to toggle Help so it's collapsed by default) :)
Thank again
You're a star!
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 11 months ago #183343 by DenisChenu
Replied by DenisChenu on topic Hide HELP by default

BITCNI wrote: …
Hope to see this in a future version of LimeSurvey (ie, the ability to toggle Help so it's collapsed by default) :)

My posityion on such system that : It must not be done for all instalation and not deactivatable, and surely not in question settings …

Because limesurvey have already a lot of Question settings : simple user didn't know 20% of this settings … adding more make more hard to understand what settings are usuable.

But more :
1. Here it's Survey Theme related : it muts be a Survey theme option
2. If need different option by question : Survey theme must be allowed to extend Question seetings.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose