Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.9
-
Fix Version/s: None
-
Component/s: Lesson
-
Labels:None
-
Affected Branches:MOODLE_19_STABLE
Description
I'm not sure if this is a bug report or an improvement request ![]()
A client of ours has a Moodle in which they use lessons extensively. They created a sort of table-of-contents from hand, with links to various pages inside of each lesson. http://docs.moodle.org/en/Lesson#Other_unusual_ways_to_link suggests that this should be possible.
Anyway, they ran into the problem that if you try to link to a page within a lesson, and you haven't previously started this lesson in the traditional way (e.g. by clicking on the link to the lesson activity itself), you get the error message "Error: could not find records".
For example, there's a link to a page within a lesson:
.../mod/lesson/view.php?id=154&pageid=329
But, unless you've already visited .../mod/lesson/view.php?id=154 <-- no pageid parameter, you'll get the error.
This is because in view.php it looks for a record in the lesson_timer table (also for untimed lessons) when there is a pageid parameter, but it only creates an entry in the lesson_timer table when there is no pageid parameter.
Attached are two small patch files that provide a fix.
Note if you try to reproduce the behavior: This only happens for normal users (e.g. students), not superusers and editing teachers.