Detect if question is answered

Mehr
3 Monate 4 Wochen her #183448 von flobau
Hey,

is there a way i can check if a question has been answered? The intention is to give the user a visual indication when he has completed an answer.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

LimeSurvey Partners
Mehr
3 Monate 4 Wochen her #183449 von DenisChenu
?

Adding a string like this
{if(!is_empty(QCODE.NAOK),"<span class='text-danger'>You don't answer</span>","<span class='text-success'>You answer to this question</span>")}

But more detail can be interesting
manual.limesurvey.org/Expression_Manager

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 .

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
3 Monate 4 Wochen her #183450 von flobau
Thanks for your answer, that's kinda what i want. Where would i put this line, e.g. where do i have access to
QCODE.NAOK
?

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
3 Monate 4 Wochen her #183451 von DenisChenu

Where would i put this line

Where you want it …

where do i have access to

I put a link : read it …
manual.limesurvey.org/Expression_Manager#Qcode_Variable_Naming

It's the code of the question …

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 .

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
3 Monate 4 Wochen her #183453 von flobau
Thanks. What if i don't know the question code now and i want it for all question codes?

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
3 Monate 4 Wochen her #183464 von tpartner
How would you not know the question codes? You are the survey author.

Cheers,
Tony Partner

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

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
3 Monate 4 Wochen her #183466 von flobau
Because i don't know yet what survey's i am going to create. I am currently just editing a template, and template are not for a specific surveys i suppose?

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
3 Monate 4 Wochen her #183467 von tpartner
The solution supplied by Denis is to be placed in survey question or group text, not in a template.

Cheers,
Tony Partner

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

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
3 Monate 4 Wochen her #183471 von DenisChenu
For template :
Something like this
{% if(processString("{self.NAOK}") == 0)) %}
You don't answer to this question
{% endif %}
in github.com/LimeSurvey/LimeSurvey/blob/ma..._text_container.twig for example

See manual.limesurvey.org/Theme_editor

I don't answer to next question if you don't explain more what do you want exactly and what did you try …

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 .

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
3 Monate 4 Wochen her #183475 von flobau
Thank you Denis!
I didn't know that you can do that inside a survey question or group text, sorry for that. And sorry for my bad explanation.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
3 Monate 3 Wochen her #183718 von flobau
{% if(processString("{self.NAOK}") != 0) %}
        <span>question answered</span>
{% endif %}

I tried this code, but the condition is never true. My goal is to show a visual indication after the user successfully chose a answer from a single choice question - in the moment the user clicks on an answer.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
3 Monate 3 Wochen her - 3 Monate 3 Wochen her #183720 von tpartner
Try:

{% if(processString("{!is_empty(self)}")) %}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Letzte Änderung: 3 Monate 3 Wochen her von tpartner.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
3 Monate 3 Wochen her - 3 Monate 3 Wochen her #183723 von flobau
Thanks for your answer. This seems to be true everytime. Even when the question isn't answered yet.
{% if(processString("{is_empty(self)}")) %}
        <div class="{{ aSurveyInfo.class.questionasterix }} pull-left" {{ aSurveyInfo.attr.questionasterix }} >
            <small style="margin-right: 3px; font-size: 65%;" class="{{ aSurveyInfo.class.questionasterixsmall }} text-danger fa fa-asterisk small" {{ aSurveyInfo.attr.questionasterixsmall }}></small>
            <span class="{{ aSurveyInfo.class.questionasterixspan }} sr-only text-danger" {{ aSurveyInfo.attr.questionasterixspan }} >
                {{ gT("(This question is mandatory)") }}
            </span>
        </div>
    {% endif %}
 
    {% if(processString("{!is_empty(self)}")) %}
        <div class="{{ aSurveyInfo.class.questionasterix }} pull-left" {{ aSurveyInfo.attr.questionasterix }} >
            {{ image('./files/haken.png', 'Question answered') }} 
        </div>
    {% endif %}

Both of the if's equal to 'true' and the content is shown for both.
Letzte Änderung: 3 Monate 3 Wochen her von flobau.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
3 Monate 3 Wochen her - 3 Monate 3 Wochen her #183734 von flobau
I now tried multiple variables of aQuestion, but there seems to be no indication variable if a question has been answered. Do you guys have any ideas for another approach? Maybe with JavaScript?
Letzte Änderung: 3 Monate 3 Wochen her von flobau.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
3 Monate 3 Wochen her - 3 Monate 3 Wochen her #183737 von DenisChenu
Right … it get it when loadong and don't update it …

Can do like that :
{{ processString("{if(is_empty(self.NAOK),'<span class=\"text-danger\">Mandatory question not answered</span>',' <span class=\"text-success\">question answered</span>')}")  }}

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 .
Letzte Änderung: 3 Monate 3 Wochen her von DenisChenu.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha