Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-6082

block_configurable_reports Filter issues

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.9.3
    • Fix Version/s: None
    • Labels:
      None
    • Plugin Version:
      2011040119
    • Affected Branches:
      MOODLE_29_STABLE

      Description

      I have tried to run this query

      SELECT c.id AS c_id, c.shortname, et.etcount, certiss.certcount, feedcomp.evalcount
      FROM prefix_course AS c
      LEFT JOIN
      (

      1. Step 1. Get the total count of enrolments for a course
        SELECT e.courseid, count(ue.id) AS etcount
        FROM prefix_enrol AS e
        JOIN prefix_user_enrolments AS ue ON ue.enrolid = e.id
        %%FILTER_STARTTIME:ue.timestart:>%% %%FILTER_ENDTIME:ue.timeend:<%%
        GROUP BY 1
        ) AS et ON et.courseid = c.id
        LEFT JOIN
        (
      2. Step 5. Get the total count of certificates issued for a course
        SELECT cert.course, count(ci.id) AS certcount
        FROM prefix_certificate AS cert
        JOIN prefix_certificate_issues AS ci ON ci.certificateid = cert.id
        %%FILTER_STARTTIME:ci.timecreated:>%% %%FILTER_ENDTIME:ci.timecreated:<%%
        GROUP BY 1
        ) AS certiss ON certiss.course = c.id
        LEFT JOIN
        (
      3. Step 6. Get the total count of completed evaluations for a course
        SELECT f.course, count(fc.id) AS evalcount
        FROM prefix_feedback AS f
        JOIN prefix_feedback_completed AS fc ON fc.feedback = f.id
        %%FILTER_STARTTIME:fc.timemodified:>%% %%FILTER_ENDTIME:fc.timemodified:<%%
        GROUP BY 1
        ) AS feedcomp ON feedcomp.course = c.id

      and the results come back differently than if I run the individual joined queries.

      If I hard code the whole query, I get the results that come back from the individual queries.

      So it seems that the filters have a bug, or I am not using them in the correct manner.

      Please advise what I can do to fix this if anything.

      Thanks

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: