I'm using a simple Matrix type survey like this https://surveyjs.io/Examples/Library/?id=questiontype-matrix&platform=jQuery
How can I capture the number of questions displayed? I need to set this in a variable in order to do some calculations.
Each question is worth a potential 10 points, so I need to display the number of potential points available on the page, e.g 17 questions = 170 points.
I've tried to console.log(survey.data)
but I don't understand most of it.
Hello,
You can use the getAllQuestions of the
survey
object. You can use the pages and the visiblePages properties of the survey to iterate through pages. And you can use the questions property of a page to get all questions that belong this page.Each question has the isVisible property so you can calculate the exact count of the questions visible at the moment.
Thanks, Serge
SurveyJS Team