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

order of subquestions in report of ranked question varies

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 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

    Description

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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:
              12/May/14