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

Assignment count for groups not working

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9
    • Component/s: Groups
    • Labels:
      None
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      In the function assignment_count_real_submissions, if the group ID is selected, there is the following SQL query:

      return count_records_sql("SELECT COUNT(DISTINCT gm.userid, gm.groupid)
      FROM {$CFG->prefix}assignment_submissions a,
      {$CFG->prefix}groups_members g
      WHERE a.assignment = $assignment->id
      AND a.timemodified > 0
      AND g.groupid = '$groupid'
      AND a.userid = g.userid ");

      Notice that the arguments to DISTINCT are gm.something, but the table is named "g". I am not a SQL expert by any means, but I printed out the precise query being run, typed it into the mysql command line prompt, and this is indeed not a valid query. I fixed it by changing "gm" to "g", and now 1.9 behaves like I think it should.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              skodak Petr Skoda
              Reporter:
              humper Greg Humphreys
              Tester:
              Nicolas Martignoni
              Participants:
              Component watchers:
              Andrew Nicols, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                3/Mar/08