Counting Pages Visited?

I'd like to get the number of pages in a book where the page "visited" property is true. I am assuming that the visited property would be restored by an LMS if the lesson is launched from an LMS.
In any case, I need to be able to produce a count of pages that have been visited. I am trying to come up with a way to show progress through a lesson using the couple of rectangles on the background.
So far, I can determine the count of "critical" pages in the lesson. This number is needed as part of the calculation to determine a user's progress. I am having trouble coming up with code to determine the number of those critical pages that have the visited property set to true.
I have a list of page names to check in an array but how can I construct a statement to return the 'visited' property of another page in the book?
Ideas?
In any case, I need to be able to produce a count of pages that have been visited. I am trying to come up with a way to show progress through a lesson using the couple of rectangles on the background.
So far, I can determine the count of "critical" pages in the lesson. This number is needed as part of the calculation to determine a user's progress. I am having trouble coming up with code to determine the number of those critical pages that have the visited property set to true.
I have a list of page names to check in an array but how can I construct a statement to return the 'visited' property of another page in the book?
Ideas?