You are right, time spent in successive attempts at a lesson is not cumulative. It starts at zero with each new attempt.
The best solution to this problem would be the development of a new "stop-watch/chronometer" feature, as described in this other discussion: .Measuring "Time spent" in Lesson
EDIT.- Just found out a very simple hack to make time spent in successive attempts at a lesson cumulative. This is for current version 2.7 of Moodle, but should work in previous versions too.
In file yourmoodle/mod/lesson/view.php, around line 105, locate this comment: "// check for the timespent condition". A few lines below, replace line:
$duration = $attempttime->lessontime - $attempttime->starttime;
with:
$duration += $attempttime->lessontime - $attempttime->starttime;
That's it! Of course, usual warning applies that it may be risky to hack a moodle core file and cause problems when updating your moodle site. So use at own rixk.