1. Why aren’t you using an LMS? Moodle is FREE. It’ll properly track where your user left off and has an Attendance Register plugin that will do what you want at no cost.
2. If you do not want to use an LMS then why are you using Lectora at all? This sounds like a job much better suited to building from scratch without a rapid delivery authoring tool. Interfacing all what you are trying to pull off with Lectora, while possible, will be difficult.
You seem to be endeavoring to build your own little LMS. I assume you’ve already taken care of how you are tracking who’s actually taking the training (log-in system)?
If you were my client I would strongly advise the use of an LMS. Please do not take this the wrong way, I do not mean it to be disparaging in any way. The questions you ask lead me to believe that you are not an experienced programmer (front or back end) and therefore would need a lot of coding assistance. That means $$$. I’ll bet you can download, install and get something working with Moodle in a day without spending an additional dime even as a novice.
Switching gears now. To answer one of the questions from your first post, if you are receiving the content as JSON data from your database you can set up a loop and assign the retrieved data to pre-designated Lectora variables.
To answer your three questions from the last post:
1. How can i set the script to run on every button click?
2. How can I use the databse to setup the number of pages the client can already seen, so he/she do not have to go throught the timer again
Well, you could set up fields in your database to track the current page and last page visited. Your custom script would have to use this data to determine if the page has been visited BEFORE running the timer and skip the timer if it has.
3. How to set times on each page
Because there are different methods, you would need to elaborate on how you are tracking time to begin with.
Again, all this would be avoided and a lot more built in functionality would be available for your use if you used an LMS. Sorry, but I do not think you’ll find a simpler answer.