Goal:
So I have a survey that after it’s completed, I wish to show the user the results of the survey, showing all results on record in a pie chart. There are two types of questions, multiple choice, and write-in. I don’t want to show results for write-in answers, only multiple choice. So the user will only see question/answers of multiple choice questions in a pie chart. They will be able to navigate back and forward using buttons beneath the pie chart.
Basic Database Structure:
Survey (name, list of surveyquestions)
SurveyQuestion (question, list of survey answers, type (OS: Multiple Choice, Write-in), order)
SurveyAnswer (answer, surveyquestion)
SurveyResult (list of surveyanswers, survey)
So I have a RG Survey Result Questions, which uses the SurveyResult survey’s surveyQuestions, that is filtered to only contain question type Multiple Choice and sorted by question order, and the RG is set to a fixed number of rows and columns (1 & 1).
The buttons use WF element action to go to next or previous page.
Pie chart is in the RG and datasource is a search for SurveyResults (this survey), each item’s surveyAnswers: filtered by parent group question (the cell in the RG Survey Results) : grouped by answer.
Problem:
This works as I expected, EXCEPT that it seems there is a glitch that I have to click next twice to navigate from Q3 to Q5 or Q2. For example, I have 5 questions:
- Write-in
- Multiple Choice
- Multiple Choice
- Write-in
- Multiple Choice
When the results are shown, it starts at Q2 as it should. When I click next, it goes to Q3. When I click next again, nothing seems to happen. I click next a second time in a row, and then it goes to Q5.
If I go backwards from Q5, I click previous once I go to Q3. Then I have to press previous twice to get to Q2.
I’m not sure why it is requiring a double-click to paginate from Q3 to Q5 or Q3 to Q2, as Q1 and Q4 should be filtered out and not in the RG. When I use the inspector, it seems the double click is navigating to the next page, and the two middle pages are page 2 and page 3, but they have the same values.
I also realized that during the survey, the same issue happens, where it seems Q3 requires 2 “next” button clicks to move to Q4. Looking at the inspector, the final page of the survey (the fifth and final question) is listed as page 6, as it seems Q3 is both on page 4 and page 5.
I’m a bit stumped here, as there are only 5 questions on the SurveyQuestion table. What’s going on here?