Closed freeradicalx closed 1 year ago
I don't aggree because the query have to return one row per userid. Try ORDER BY max(score) DESC I don't have postgres to test it, so do the test please and tell me if it works.
Agreed, that is probably the actual correct solution! I've changed the query to your suggestion and it is working fine.
SELECT userid, MAX(score) as maxscore". " FROM {$CFG->prefix}game_attempts ". " WHERE gameid={$game->id} AND score > 0". " GROUP BY userid". " ORDER BY max(score) DESC";
Hi there, in my Moodle I just fixed what appears to be a code issue in version 2020081901 of this plugin. When attempting to view a game assignment I get the following error output:
By changing line 356 of view.php from: " GROUP BY userid". To: " GROUP BY userid,score".
I was able to resolve the error. If it matters, my database type is postgres and Moodle version is 2020061501.00 / 3.9.1 (Build: 20200713). Thanks!