Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-35227

error enrolling users if scorm modules present

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.3.3
    • 2.3, 2.4
    • SCORM
    • MOODLE_23_STABLE, MOODLE_24_STABLE
    • MOODLE_23_STABLE
    • master_MDL-35227
    • Hide

      The AJAX form calls enrol/manual/ajax.php, which (line 126) calls lib/gradelib/grade_recover_history_grades() -> lib/gradelib/grade_grab_course_grades() -> lib/gradelib/grade_update_mod_grades(). There, at last, if a SCORM module is present, the mod/scorm/lib/scorm_grade_item_update() is called and tries to create a New completion_info() without including completionlib.php.
      Workaround: use patch displayed in the Description of this issue.

      Show
      The AJAX form calls enrol/manual/ajax.php, which (line 126) calls lib/gradelib/grade_recover_history_grades() -> lib/gradelib/grade_grab_course_grades() -> lib/gradelib/grade_update_mod_grades(). There, at last, if a SCORM module is present, the mod/scorm/lib/scorm_grade_item_update() is called and tries to create a New completion_info() without including completionlib.php. Workaround: use patch displayed in the Description of this issue.
    • Hide

      I couldn't reproduce this problem as it arises in some courses but not in other courses. It seems that the "recover grades" option has something to do with it.

      Show
      I couldn't reproduce this problem as it arises in some courses but not in other courses. It seems that the "recover grades" option has something to do with it.

      In a course containing one or several SCORM module instances, if one tries to enrol users manually (from the Settings Block -> Course administration -> Users -> Enrolled users), we get a "Syntax error" Javascript modal. The error logged in the Apache error log is: PHP Fatal error: Class 'completion_info' not found in /***/mod/scorm/lib.php on line 691, referer: http://***/enrol/users.php?id=514
      The following hack fixes the issue :

      --- a/mod/scorm/lib.php
      +++ b/mod/scorm/lib.php
      @@ -688,6 +688,9 @@ function scorm_grade_item_update($scorm, $grades=null, $updatecompletion=true) {
       
               $cm = get_coursemodule_from_instance('scorm', $scorm->id, $course->id);
               if (!empty($cm)) {
      +            if (!class_exists('completion_info')) { //workaround for buggy PHP versions
      +                require_once($CFG->libdir.'/completionlib.php');
      +            }
                   $completion = new completion_info($course);
                   $completion->update_state($cm, COMPLETION_COMPLETE);
               }
       

            danmarsden Dan Marsden
            monidu Nicolas Dunand
            Dan Poltawski Dan Poltawski
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.