Good morning,
We had this problem also. I changed the 'Number of pages (cards) to show' to a number greater than the number of pages in the lesson. For example, if the lesson contained 5 pages, I changed this setting to 15. After I did this, Moodle recognized that the end of lesson was reached.
Yolanda