Welcome to the LimeSurvey Community Forum

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

How to check if a question is answered and/or visible

  • BBSR-SR5
  • BBSR-SR5's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 weeks 6 days ago #260130 by BBSR-SR5
Please help us help you and fill where relevant:
Your LimeSurvey version: Version 6.5.2
Own server or LimeSurvey hosting: LimeSurvey Cloud
Survey theme/template: modified Fruity 23 Blueberry Template
==================
Hello everyone,

I'm working on a custom navigation menu (for an organisation survey). For this purpose I'm trying to find out if a question has already been answered.

The "normal" question index menu has the following code:
Code:
{% for step, indexItem in aSurveyInfo.aQuestionIndex.items %}
                    {% set statusClass = '' %}
                    {% if attribute(indexItem.stepStatus, 'index-item-unanswered') is defined and attribute(indexItem.stepStatus, 'index-item-unanswered') == true %}
                        {% set statusClass = statusClass ~ ' index-warning' %}
                    {% endif %}
                    {% if attribute(indexItem.stepStatus, 'index-item-error') is defined and attribute(indexItem.stepStatus, 'index-item-error') == true %}
                        {% set statusClass = statusClass ~ ' index-danger' %}
                    {% endif %}
                    {% if attribute(indexItem.stepStatus, 'index-item-current') is defined and attribute(indexItem.stepStatus, 'index-item-current') == true %}
                        {% set statusClass = statusClass ~  ' disabled' %}
                    {% endif %}
                    <li class="list-group-item {{ indexItem.coreClass }}">
                        <a href='{{ indexItem.url }}' data-limesurvey-submit='{{ indexItem.submit }}'
                           class='dropdown-item  {{ statusClass }}'>
                            {{ indexItem.text }}
                        </a>
                    </li>
                {% endfor %}
This seems to check wether a question has been opened but not answered ('index-item-unanswered'), if a question is the currently opened question ('index-item-current') and some other attribute I don't know ('index-item-error')

Is it possible to see if a question is actually answered? 

Furthermore is it possible to see if a question is currently visible or filtered?

 

Please Log in to join the conversation.

  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
2 weeks 3 days ago #260255 by Mazi
To my knowledge there is also a class applied if all questions on a page have been answered. At least for LimeSurvey 5.x we developed a theme which indicates such a status (current/answered/not answered) at a colored question index.

If a question is visible or filtered is not indicated at the index.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com

Please Log in to join the conversation.

  • BBSR-SR5
  • BBSR-SR5's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 weeks 10 hours ago #260315 by BBSR-SR5
Hm, so it's always all questions on a page? No way to go through the questions individually to check?

Anyway, what's the class for "all questions answered"?

Please Log in to join the conversation.

  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
2 weeks 7 hours ago - 2 weeks 7 hours ago #260322 by Mazi
The index depends on the survey mode. If you run it group by group, each group is a list item.

I checked our theme with the colored index. For "all questions answered" there is no special class. But you can identify them anyway. It's the item which will NOT have a class "index-item-seen" and "index-item-unanswered":

Attachment not found


Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
Last edit: 2 weeks 7 hours ago by Mazi.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose