Detect if question is answered

Mehr
1 Monat 4 Tage her #183448 von flobau
COM_KUNENA_MESSAGE_CREATED_NEW
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 an der Konversation teilzunehmen.

LimeSurvey Partners
Mehr
1 Monat 4 Tage her #183449 von DenisChenu
COM_KUNENA_MESSAGE_REPLIED_NEW
?

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 an der Konversation teilzunehmen.

Mehr
1 Monat 4 Tage her #183450 von flobau
COM_KUNENA_MESSAGE_REPLIED_NEW
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 an der Konversation teilzunehmen.

Mehr
1 Monat 4 Tage her #183451 von DenisChenu
COM_KUNENA_MESSAGE_REPLIED_NEW

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 an der Konversation teilzunehmen.

Mehr
1 Monat 4 Tage her #183453 von flobau
COM_KUNENA_MESSAGE_REPLIED_NEW
Thanks. What if i don't know the question code now and i want it for all question codes?

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
1 Monat 4 Tage her #183464 von tpartner
COM_KUNENA_MESSAGE_REPLIED_NEW
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 an der Konversation teilzunehmen.

Mehr
1 Monat 4 Tage her #183466 von flobau
COM_KUNENA_MESSAGE_REPLIED_NEW
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 an der Konversation teilzunehmen.

Mehr
1 Monat 4 Tage her #183467 von tpartner
COM_KUNENA_MESSAGE_REPLIED_NEW
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 an der Konversation teilzunehmen.

Mehr
1 Monat 4 Tage her #183471 von DenisChenu
COM_KUNENA_MESSAGE_REPLIED_NEW
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 an der Konversation teilzunehmen.

Mehr
1 Monat 4 Tage her #183475 von flobau
COM_KUNENA_MESSAGE_REPLIED_NEW
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 an der Konversation teilzunehmen.

Mehr
3 Wochen 6 Tage her #183718 von flobau
COM_KUNENA_MESSAGE_REPLIED_NEW
{% 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 an der Konversation teilzunehmen.

Mehr
3 Wochen 6 Tage her - 3 Wochen 6 Tage her #183720 von tpartner
COM_KUNENA_MESSAGE_REPLIED_NEW
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
Last edit: 3 Wochen 6 Tage her by tpartner.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
3 Wochen 6 Tage her - 3 Wochen 6 Tage her #183723 von flobau
COM_KUNENA_MESSAGE_REPLIED_NEW
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.
Last edit: 3 Wochen 6 Tage her by flobau.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
3 Wochen 6 Tage her - 3 Wochen 6 Tage her #183734 von flobau
COM_KUNENA_MESSAGE_REPLIED_NEW
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?
Last edit: 3 Wochen 6 Tage her by flobau.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
3 Wochen 6 Tage her - 3 Wochen 6 Tage her #183737 von DenisChenu
COM_KUNENA_MESSAGE_REPLIED_NEW
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 .
Last edit: 3 Wochen 6 Tage her by DenisChenu.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

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