Hide HELP by default

More
2 months 1 week 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

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

LimeSurvey Partners
More
2 months 1 week 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 .
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: cdorin

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

More
2 months 1 week 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-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)!

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

More
2 months 1 week 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 .
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: cdorin

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

More
2 months 1 week ago - 2 months 1 week 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-toggle="collapse" data-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!
Last edit: 2 months 1 week ago by cdorin. Reason: small correction
The following user(s) said Thank You: DenisChenu

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

More
2 months 1 week ago - 2 months 1 week 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
{{ 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 .
An error happen ? Before make a new topic : remind the Debug mode .
Last edit: 2 months 1 week ago by DenisChenu. Reason: \o/ partial url encoding link

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

More
2 months 1 week ago - 2 months 1 week 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: 2 months 1 week ago by BITCNI.

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

More
2 months 1 week ago #183337 by tpartner
Replied by tpartner on topic Hide HELP by default
Try this in survey_question_help.twig:

<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.
Official LimeSurvey Partner - partnersurveys.com
The following user(s) said Thank You: DenisChenu, cdorin

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

More
2 months 1 week 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!

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

More
2 months 1 week 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 .
An error happen ? Before make a new topic : remind the Debug mode .

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!