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

Lesson - Email graded essays not working

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.7, 2.4.4, 2.5
    • Fix Version/s: 2.4.6, 2.5.2
    • Component/s: Lesson
    • Labels:
    • Testing Instructions:
      Hide
      1. add a Lesson activity to a course
      2. add a question page of type "essay" to the lesson
      3. as a student, submit an answer for the essay.
      4. as a teacher, go to "Grade essay" tab, and grade the students essays
      5. there should be a link called "Email ALL graded essays"
      6. clicking on "Email ALL graded essays" should not result in "Error reading from database". It should display "Emails sent successfully" instead.
      Show
      add a Lesson activity to a course add a question page of type "essay" to the lesson as a student, submit an answer for the essay. as a teacher, go to "Grade essay" tab, and grade the students essays there should be a link called "Email ALL graded essays" clicking on "Email ALL graded essays" should not result in "Error reading from database". It should display "Emails sent successfully" instead.
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull Master Branch:

      Description

      Error reading from database

      More information about this error
      Debug info: Unknown column 'ui.id' in 'on clause'

      SELECT u.*
      FROM m_user u
      JOIN (
      SELECT DISTINCT userid
      FROM m_lesson_attempts
      WHERE lessonid = ?
      ) ui ON u.id = ui.id
      [array (
      0 => '2',
      )]
      Error code: dmlreadexception
      Stack trace:

      line 426 of /lib/dml/moodle_database.php: dml_read_exception thrown
      line 1023 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 166 of /mod/lesson/essay.php: call to mysqli_native_moodle_database->get_records_sql()

      Solution
      In mod/lesson/essay.php line 166:
      Change:

      ) ui ON u.id = ui.id", $params)) {

      to:

      ) ui ON u.id = ui.userid", $params)) {

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  9/Sep/13