Permalink
Browse files

Merge branch 'MDL-30677_21' of git://github.com/timhunt/moodle into M…

…OODLE_21_STABLE
  • Loading branch information...
2 parents e66237c + 13e3f4c commit d380faef5cd9f421dd15d90e9c40b925261f1f52 Sam Hemelryk committed Dec 12, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 mod/quiz/lib.php
View
@@ -1433,15 +1433,15 @@ function quiz_num_attempt_summary($quiz, $cm, $returnzero = false, $currentgroup
if (groups_get_activity_groupmode($cm)) {
$a->total = $numattempts;
if ($currentgroup) {
- $a->group = $DB->count_records_sql('SELECT count(1) FROM ' .
+ $a->group = $DB->count_records_sql('SELECT COUNT(DISTINCT qa.id) FROM ' .
'{quiz_attempts} qa JOIN ' .
'{groups_members} gm ON qa.userid = gm.userid ' .
'WHERE quiz = ? AND preview = 0 AND groupid = ?',
array($quiz->id, $currentgroup));
return get_string('attemptsnumthisgroup', 'quiz', $a);
} else if ($groups = groups_get_all_groups($cm->course, $USER->id, $cm->groupingid)) {
list($usql, $params) = $DB->get_in_or_equal(array_keys($groups));
- $a->group = $DB->count_records_sql('SELECT count(1) FROM ' .
+ $a->group = $DB->count_records_sql('SELECT COUNT(DISTINCT qa.id) FROM ' .
'{quiz_attempts} qa JOIN ' .
'{groups_members} gm ON qa.userid = gm.userid ' .
'WHERE quiz = ? AND preview = 0 AND ' .

0 comments on commit d380fae

Please sign in to comment.