Moodle
  1. Moodle
  2. MDL-29702

Course completion block report error

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.1.1
    • Fix Version/s: None
    • Component/s: Course completion
    • Labels:
      None
    • Environment:
      XAMPP 1.7.4 localhost, Moodle
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      See attached notes on how I set up the 1st course and 2nd and 3rd course. Assume for this error, only the 1st course needs to be checked.

      Show
      See attached notes on how I set up the 1st course and 2nd and 3rd course. Assume for this error, only the 1st course needs to be checked.
    • Affected Branches:
      MOODLE_21_STABLE
    • Rank:
      19212

      Description

      Attached notes detail how I set up the course completion test. After setting up, I attempted to run my first student through the first course. I am trying to learn how to use this feature (developer's beware).

      Student (I think this also happened to admin) received this error in course completion status block and clicking on "more details". The student had passed the Lesson and Quiz and a check marked appeared next to each activity. No teacher had checked that the course was complete. Received a red block warning. I turned on dev debug level and got:

      Status: Not yet started
      Required: All criteria below are required Then red box
      Notice: Trying to get property of non-object in C:\xampp174\htdocs\moodle21\lib\completion\completion_criteria_course.php on line 213

      Can not find data record in database table course.

      More information about this error
      Debug info: SELECT * FROM

      {course}

      WHERE id IS NULL
      [array (
      )]
      Stack trace:

      line 1265 of \lib\dml\moodle_database.php: dml_missing_record_exception thrown
      line 1242 of \lib\dml\moodle_database.php: call to moodle_database->get_record_select()
      line 1807 of \lib\accesslib.php: call to moodle_database->get_record()
      line 2218 of \lib\accesslib.php: call to create_context()
      line 213 of \lib\completion\completion_criteria_course.php: call to get_context_instance()
      line 186 of \blocks\completionstatus\details.php: call to completion_criteria_course->get_details()

      Below this was the header for the report, with no rows of data below it.

        Activity

        Hide
        Chris Collman added a comment -

        I revisited this here at home after playing with in on my production server yesterday. First I ran cron.php. Still got the error message. I looked at the settings again.

        I went to course administration > completion tracking and changed the Activities completed, Aggregation method to Any instead of All, I ran cron.php. Went in as a student and the red box error message went away when I clicked on the Course Completion block "more information". I could see the student completion report.

        Do not really know why I choose that to change, nor why it fixed it. Guess I thought that Any was less restrictive than All, buy clueless as to why that would generate an error message for a student. Evidently I do not understand this feature completely AND an the error message was not very helpful.

        Show
        Chris Collman added a comment - I revisited this here at home after playing with in on my production server yesterday. First I ran cron.php. Still got the error message. I looked at the settings again. I went to course administration > completion tracking and changed the Activities completed, Aggregation method to Any instead of All, I ran cron.php. Went in as a student and the red box error message went away when I clicked on the Course Completion block "more information". I could see the student completion report. Do not really know why I choose that to change, nor why it fixed it. Guess I thought that Any was less restrictive than All, buy clueless as to why that would generate an error message for a student. Evidently I do not understand this feature completely AND an the error message was not very helpful.
        Hide
        Aaron Barnes added a comment -

        Hi Chris,

        Wondering if you had deleted an activity in the course after setting up course completion criteria?

        Thanks,
        Aaron

        Show
        Aaron Barnes added a comment - Hi Chris, Wondering if you had deleted an activity in the course after setting up course completion criteria? Thanks, Aaron
        Hide
        Chris Collman added a comment -

        No, I do not think so. The course just had a 1 question lesson and a 1 question quiz I may not have assigned the course a teacher at that point. Thus the "All" setting might have done it.

        I have spent many hours now documenting and getting my head around course completion and related subjects. That is the only crash I have found. I have not tried to duplicate it again in a new course

        Show
        Chris Collman added a comment - No, I do not think so. The course just had a 1 question lesson and a 1 question quiz I may not have assigned the course a teacher at that point. Thus the "All" setting might have done it. I have spent many hours now documenting and getting my head around course completion and related subjects. That is the only crash I have found. I have not tried to duplicate it again in a new course

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: