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

order of subquestions in report of ranked question varies

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.6.4, 2.7
    • 2.6.4, 2.7
    • Module: Questionnaire
    • None
    • MOODLE_26_STABLE, MOODLE_27_STABLE
    • MOODLE_26_STABLE, MOODLE_27_STABLE

      A ranked question has two report tables one showing the average results and showing the absolute and relative values. The responses in both tables might vary. e.g. first response is third response in second result table.
      This is observed on a postgresql database and occurs due to a missing order by statement:

      --- a/mod/questionnaire/questiontypes/questiontypes.class.php
      +++ b/mod/questionnaire/questiontypes/questiontypes.class.php
      @@ -587,7 +589,9 @@ class questionnaire_question {
                                    (SELECT c2.id, AVG(a2.rank+1) AS average, COUNT(a2
                                     FROM {questionnaire_quest_choice} c2, {$CFG->pref
                                     WHERE c2.question_id = ? AND a2.question_id = ? A
      -                              GROUP BY c2.id) a ON a.id = c.id";
      +                              GROUP BY c2.id) a ON a.id = c.id
      +                        order by c.id
      +                        ";
                       $results = $DB->get_records_sql($sql, array($this->id, $this->i
                       if (!empty ($rankvalue)) {
                           foreach ($results as $key => $result) {
      

            rezeau Joseph Rézeau
            super3d Claus A. Us.
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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