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

Lesson - Email graded essays not working

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3.7, 2.4.4, 2.5
    • 2.4.6, 2.5.2
    • Lesson
    • MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • MOODLE_24_STABLE, MOODLE_25_STABLE
    • 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.

    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)) {

      Attachments

        Issue Links

          Activity

            People

              jmvedrine Jean-Michel Vedrine
              amanda.doughty Amanda Doughty
              Rajesh Taneja Rajesh Taneja
              Sam Hemelryk Sam Hemelryk
              Jérôme Mouneyrac Jérôme Mouneyrac
              Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/Sep/13