I'm trying to modify lesson/locallib.php so that the lesson automatically goes straight to "end of lesson" as soon as the student's ongoing score reaches a certain percent (for my purposes, 60%)
Going directly to the PHP is for two reasons: first, that as far as I can tell this type of functionality doesn't exist, period, in stock Moodle (at least not 1.9), and second, we already have several hundred lessons in place when I got the word this needs to be implemented!
(If that first assumption is wrong, I'm all ears.)
The problem is that I can't grasp the logic flow in the PHP clearly enough to figure out where to do something like, say,
$gradeinfo = lesson_grade($lesson, $ntries);
if ($gradeinfo->grade >= 60){
$jumpto == LESSON_EOL;
}
Well, sort of like that, except $jumpto and $ntries seem to be local variables from completely separate functions... but I think you get what I'm trying to do.
Thanks!!