Show survey data total

Plus d'informations
il y a 1 mois 4 semaines #174096 par flasher44
flasher44 a répondu au sujet : Show survey data total
OK I did it as you said this way and I still have the error message : Unknown "getAllTokenAnswers" function.


{#
    LimeSurvey
    Copyright (C) 2007-2017 The LimeSurvey Project Team / Louis Gac
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.
 
    (¯`·._.·(¯`·._.· Submit Content  ·._.·´¯)·._.·´¯)
 
    This page is displayed after user submits the survey.
    It could be, visually, very different (no header, etc).
 
    It shows the end text, assessments, print answer, and statistics.
 
    Data are in: aSurveyInfo.aCompleted and aSurveyInfo.aAssessments.
    To show this data, turn debug mode on and copy the following line to the end of the <body> element in this file:
    {{ dump(aSurveyInfo.aCompleted ) }}
 
    NOTE: This content is included inside mainrow.twig
    NOTE: see layout_global.twig for more infos
#}
 
{# include the form opening tag #}
<!-- main form -->
{{ include('./subviews/header/start_form.twig') }}
 
    {# This will display the script and the hidden inputs needed for Expression Manager #}
    {{ aSurveyInfo.EM.ScriptsAndHiddenInputs  }}
 
    <div class="{{ aSurveyInfo.class.submitwrapper }}" {{ aSurveyInfo.attr.submitwrapper }}>
        <div class='{{ aSurveyInfo.class.submitwrappertext }}' {{ aSurveyInfo.attr.submitwrappertext }}>
            {% if (aSurveyInfo.aCompleted.showDefault == true) %}
                <p {{ aSurveyInfo.attr.submitwrappertextpa }}>{{ gT("Thank you!") }}</p>
                <p {{ aSurveyInfo.attr.submitwrappertextpb }}>{{ gT("Your survey responses have been recorded.") }}</p>
            {% else %}
                {{ aSurveyInfo.aCompleted.sEndText }}
            {% endif %}
 
            {# Assessments #}
            {% if (aSurveyInfo.aAssessments.show) %}
                {{ include('./subviews/messages/assessments.twig') }}
            {% endif %}
 
            {#  Link to Print Answer Preview #}
            {% if (aSurveyInfo.aCompleted.aPrintAnswers.show == true) %}
                <!--  Link to Print Answer Preview -->
                <div class="{{ aSurveyInfo.class.submitwrapperdiva }}" {{ aSurveyInfo.attr.submitwrapperdiv }}>
                    <a href="{{ aSurveyInfo.aCompleted.aPrintAnswers.sUrl }}" class="{{ aSurveyInfo.class.submitwrapperdivaa }}" {{ aSurveyInfo.attr.submitwrapperdivaa }}>
                        {{ gT("Print your answers.") }}
                    </a>
                </div>
            {% endif %}
 
            <div> 
    {% set aResponses = getAllTokenAnswers(aSurveyInfo.sid) %}
    {% set responseSum = 0 %}
    {% set responseCount = 0 %}
    {% set responseToken = '' %}
 
    {% for response in aResponses %}
        {% if (response['111111X22X33'] != '') %}
            {% set responseSum = responseSum + response['111111X22X33']|number_format %}
            {% set responseCount = responseCount + 1 %}
        {% endif %}
 
        {% if (loop.index == 1) %}
            {% set responseToken = response['token'] %}
        {% endif %}
    {% endfor %}
 
    {% if (responseCount > 0) %}
        There are {{ responseCount }} valid responses for Q1 with token value {{ responseToken }}.
        <br />
        The sum of all valid responses  is {{ responseSum }}.
        <br />
        The average of all valid responses is {{ (responseSum/responseCount) }}.
    {% endif %}
</div>
 
            {# Link to Public statistics #}
            {% if (aSurveyInfo.aCompleted.aPublicStatistics.show == true) %}
                <!-- Link to Public statistics -->
                <div class="{{ aSurveyInfo.class.submitwrapperdivb }}" {{ aSurveyInfo.attr.submitwrapperdivb }}>
                    <a href="{{ aSurveyInfo.aCompleted.aPublicStatistics.sUrl }}" class="{{ aSurveyInfo.class.submitwrapperdivba }}" {{ aSurveyInfo.attr.submitwrapperdivba }}>
                        {{ gT("View the statistics for this survey.") }}
                    </a>
                </div>
            {% endif %}
 
            {# Before LS3 Master, this should be replace by a Twig block logic #}
            {{ aSurveyInfo.aCompleted.sPluginHTML }}
 
            {# NOTE: not very clear what the old replacement keyword {URL} was doing  #}
            {% if (aSurveyInfo.aCompleted.sSurveylsUrl) %}
                <a href="{{ aSurveyInfo.aCompleted.sSurveylsUrl }}">{{ aSurveyInfo.aCompleted.sSurveylsUrlDescription }}</a>
            {% endif %}
        </div>
    </div>
</form> <!-- main form -->

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 4 semaines #174103 par LouisGac
LouisGac a répondu au sujet : Show survey data total
the function is not released yet.
I can do it today if you're in a hurry (you will have to update your installation to use Tpartner code)

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 4 semaines #174104 par tpartner
tpartner a répondu au sujet : Show survey data total
Yes, as Louis said when he introduced the function:

It will be available in next release, you can still implement the commit in your local version.


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

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 4 semaines #174128 par flasher44
flasher44 a répondu au sujet : Show survey data total
If you can release it ASAP, thanks...

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 4 semaines - il y a 1 mois 4 semaines #174168 par flasher44
flasher44 a répondu au sujet : Show survey data total

tpartner écrit: you can still implement the commit in your local version.



How to do this ?
Dernière édition: il y a 1 mois 4 semaines par flasher44.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 4 semaines #174175 par LouisGac
LouisGac a répondu au sujet : Show survey data total
ok I will release today

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 3 semaines #174275 par flasher44
flasher44 a répondu au sujet : Show survey data total
Is it this version : 3.14.9+180917

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 3 semaines - il y a 1 mois 3 semaines #174290 par jelo
jelo a répondu au sujet : Show survey data total

flasher44 écrit: Is it this version : 3.14.9+180917

No, not in this version. 180917 indicates 17. Sept 2018 as release date.

And LouisGac is not Marty McFly ;)

Are you a student conducting a survey? If yes, tell me why you use LimeSurvey?
www.limesurvey.org/forum/development/116...y-you-use-limesurvey
Dernière édition: il y a 1 mois 3 semaines par jelo.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 3 semaines #174301 par LouisGac
LouisGac a répondu au sujet : Show survey data total
yes and we're friday... I will release it Monday

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 3 semaines #174443 par flasher44
flasher44 a répondu au sujet : Show survey data total
Here what I did, I just replace the question CODE, and it return … NOTHING

Where is the problem ?

{#
    LimeSurvey
    Copyright (C) 2007-2017 The LimeSurvey Project Team / Louis Gac
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.
 
    (¯`·._.·(¯`·._.· Submit Content  ·._.·´¯)·._.·´¯)
 
    This page is displayed after user submits the survey.
    It could be, visually, very different (no header, etc).
 
    It shows the end text, assessments, print answer, and statistics.
 
    Data are in: aSurveyInfo.aCompleted and aSurveyInfo.aAssessments.
    To show this data, turn debug mode on and copy the following line to the end of the <body> element in this file:
    {{ dump(aSurveyInfo.aCompleted ) }}
 
    NOTE: This content is included inside mainrow.twig
    NOTE: see layout_global.twig for more infos
#}
 
{# include the form opening tag #}
<!-- main form -->
{{ include('./subviews/header/start_form.twig') }}
 
    {# This will display the script and the hidden inputs needed for Expression Manager #}
    {{ aSurveyInfo.EM.ScriptsAndHiddenInputs  }}
 
    <div class="{{ aSurveyInfo.class.submitwrapper }}" {{ aSurveyInfo.attr.submitwrapper }}>
        <div class='{{ aSurveyInfo.class.submitwrappertext }}' {{ aSurveyInfo.attr.submitwrappertext }}>
            {% if (aSurveyInfo.aCompleted.showDefault == true) %}
                <p {{ aSurveyInfo.attr.submitwrappertextpa }}>{{ gT("Thank you!") }}</p>
                <p {{ aSurveyInfo.attr.submitwrappertextpb }}>{{ gT("Your survey responses have been recorded.") }}</p>
            {% else %}
                {{ aSurveyInfo.aCompleted.sEndText }}
            {% endif %}
 
            {# Assessments #}
            {% if (aSurveyInfo.aAssessments.show) %}
                {{ include('./subviews/messages/assessments.twig') }}
            {% endif %}
 
            {#  Link to Print Answer Preview #}
            {% if (aSurveyInfo.aCompleted.aPrintAnswers.show == true) %}
                <!--  Link to Print Answer Preview -->
                <div class="{{ aSurveyInfo.class.submitwrapperdiva }}" {{ aSurveyInfo.attr.submitwrapperdiv }}>
                    <a href="{{ aSurveyInfo.aCompleted.aPrintAnswers.sUrl }}" class="{{ aSurveyInfo.class.submitwrapperdivaa }}" {{ aSurveyInfo.attr.submitwrapperdivaa }}>
                        {{ gT("Print your answers.") }}
                    </a>
                </div>
            {% endif %}
 
            <div> 
    {% set aResponses = getAllTokenAnswers(aSurveyInfo.sid) %}
    {% set responseSum = 0 %}
    {% set responseCount = 0 %}
    {% set responseToken = '' %}
 
    {% for response in aResponses %}
        {% if (response['BIRD'] != '') %}
            {% set responseSum = responseSum + response['BIRD']|number_format %}
            {% set responseCount = responseCount + 1 %}
        {% endif %}
 
        {% if (loop.index == 1) %}
            {% set responseToken = response['token'] %}
        {% endif %}
    {% endfor %}
 
    {% if (responseCount > 0) %}
        There are {{ responseCount }} valid responses for Q1 with token value {{ responseToken }}.
        <br />
        The sum of all valid responses  is {{ responseSum }}.
        <br />
        The average of all valid responses is {{ (responseSum/responseCount) }}.
    {% endif %}
</div>
 
            {# Link to Public statistics #}
            {% if (aSurveyInfo.aCompleted.aPublicStatistics.show == true) %}
                <!-- Link to Public statistics -->
                <div class="{{ aSurveyInfo.class.submitwrapperdivb }}" {{ aSurveyInfo.attr.submitwrapperdivb }}>
                    <a href="{{ aSurveyInfo.aCompleted.aPublicStatistics.sUrl }}" class="{{ aSurveyInfo.class.submitwrapperdivba }}" {{ aSurveyInfo.attr.submitwrapperdivba }}>
                        {{ gT("View the statistics for this survey.") }}
                    </a>
                </div>
            {% endif %}
 
            {# Before LS3 Master, this should be replace by a Twig block logic #}
            {{ aSurveyInfo.aCompleted.sPluginHTML }}
 
            {# NOTE: not very clear what the old replacement keyword {URL} was doing  #}
            {% if (aSurveyInfo.aCompleted.sSurveylsUrl) %}
                <a href="{{ aSurveyInfo.aCompleted.sSurveylsUrl }}">{{ aSurveyInfo.aCompleted.sSurveylsUrlDescription }}</a>
            {% endif %}
        </div>
    </div>
</form> <!-- main form -->

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 3 semaines #174444 par LouisGac
LouisGac a répondu au sujet : Show survey data total
I've just released, did you update?

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 3 semaines #174454 par flasher44
flasher44 a répondu au sujet : Show survey data total
Yes I updated, I don't have the error message anymore, but the script is not doing anything …

Could you tell me what I'm supposed to change in the original script to get it working ?

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 3 semaines #174463 par flasher44
flasher44 a répondu au sujet : Show survey data total
What do represent these numbers ? Token, question name ?

Do I have to edit it ?


Thanks for the help, I 'm not a programmer at all ...


Pièces jointes :

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 3 semaines #174476 par tpartner
tpartner a répondu au sujet : Show survey data total
As I said in my earlier post:

Q1 has, for example, an SGQA identifier of "111111X22X33".


See the manual here - manual.limesurvey.org/SGQA_identifier/en...gle_Choice_Questions

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

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 3 semaines #174530 par flasher44
flasher44 a répondu au sujet : Show survey data total
OK I finaly get ti working, but it's not doing exactly what I want, because in my first post, I wanted to get the total number of bird and frog seen for the day, and the grand total of animals seen, from the begining.

Connexion ou Créer un compte pour participer à la conversation.

Commencez dès maintenant !

Créez simplement un compte et commencez à utiliser LimeSurvey dès aujourd'hui.

Inscrivez-vous maintenant

Inscrivez-vous à notre Newsletter!