I wanted to run it here before reporting in the bug in tracker. I'm looking at the 2 related problems with the lesson module in Moodle 1.9.
1. Sometimes it happens that report page mod/lesson/report.php?id=NNN is showing entries with 0 timestamp, that is: "Thursday, 1 January 1970, 12:00 AM, (now)".
2. In other cases a date shown on the report page mod/lesson/report.php?id=NNN is a different date then when you follow the link to detailed report on mod/lesson/report.php?id=NNN&action=reportdetail&userid=NNN&try=NNN.
The first issue happens when there are not enough entries in lesson_timer table, e.g. if there are 10 tries but only 7 records in lesson_timer.
The direct reason for the second issue was reverse - there was 1 try recorded but 3 entries in lesson_timer. First report page took the first entry from lesson_timer but second report grabbed the last one.
I assume that this happens because of some weird error condition (broken connectivity, stopped, script, etc). It's also caused by lack of transactions in the code.
But the biggest (and probably easiest to fix) issue here is that entries in lesson_timer do not use any foreign ID to refer to the relevant try in other tables. The code simply takes the tries, takes the entries from lesson_timer and matches them "manually" (first try == first row from lesson_timer). This is working very unreliably, to my surprise I couldn't find any issues related to it and logged in the tracker.
Would you have any thoughts on this? I see that the lesson_timer table is the same in latest Moodle 2.2dev, are there any plans by HQ to work on lesson mod?
Tomasz (Tomek) Muras