Welcome to the LimeSurvey Community Forum

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

Detecting if user is on last question group

  • phinpope
  • phinpope's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 9 months ago #218449 by phinpope
Is there an variable in template system to check if you are on the last group (submit button instead of next)?

 
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 9 months ago #218450 by tpartner
Replied by tpartner on topic Detecting if user is on last question group
You can check if the progress is 100% something like this:

Code:
{# Only in the last group #}
{% if aSurveyInfo.progress.currentstep/aSurveyInfo.progress.total == 1 %}
  <p>This is the last group!</p>
{% endif %}

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, phinpope
The topic has been locked.
  • phinpope
  • phinpope's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 9 months ago #218452 by phinpope
Replied by phinpope on topic Detecting if user is on last question group
Hadn't thought of doing it that way. Thanks.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 8 months ago - 2 years 8 months ago #218483 by DenisChenu
Replied by DenisChenu on topic Detecting if user is on last question group
Or
Code:
{% if aSurveyInfo.aNavigator.aMoveNext.value == "movesubmit" %}
    <p>This is submit group!</p>
{% endif %}
See github.com/LimeSurvey/LimeSurvey/blob/27...n/navigator.twig#L45

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: 2 years 8 months ago by DenisChenu. Reason: type=php
The following user(s) said Thank You: phinpope
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose