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

get_qbank_ids_of_type_in_course also yields modules of other types

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 5.0
    • Quiz

      The query

                  $sql = "SELECT cm.id
                            FROM {course_modules} cm
                            JOIN {modules} m ON m.id = cm.module
                            JOIN {{$defaultyactivityname}} q ON q.id = cm.instance AND cm.module = m.id
                           WHERE cm.course = :course
                             AND q.type = :type";
      
      

      isn't precise enough.

      We experienced this query failing when using the qtype_coderunner.

      As this query does not restrict by the module name, any other modules with an instance ID the same as that of a qbank will also have its cmid returned. For example, if a qbank has ID 10 and there is also a wiki with id 10, the wiki will also be incorrectly matched.

            lucaboesch Luca Bösch
            lucaboesch Luca Bösch
            Mark Johnson Mark Johnson
            Tim Hunt Tim Hunt
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 48 minutes
                48m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.