-
Bug
-
Resolution: Fixed
-
Minor
-
2.6.4, 2.7
-
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) {
|