Skip to content

Commit

Permalink
Merge pull request #18 from stopfstedt/dedupe-sorting-by-anoncode
Browse files Browse the repository at this point in the history
apply quiz scope when joining on usercodes table to prevent duplicate…
  • Loading branch information
lbailey-ucsf authored Jan 17, 2025
2 parents a586c71 + 449170f commit 7c885a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion report/grading/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ protected function get_usage_ids_where_question_in_state($summarystate, $slot,
) as tcreated";
$orderby = "tcreated";
} else if ($orderby === 'usercode') {
$qubaids->from .= " JOIN {local_quizanon_usercodes} lqau ON lqau.userid = quiza.userid";
$qubaids->from
.= " JOIN {local_quizanon_usercodes} lqau ON lqau.userid = quiza.userid AND quiza.quiz = lqau.quizid";
$orderby = 'lqau.code';
}
return $dm->load_questions_usages_where_question_in_state($qubaids, $summarystate,
Expand Down

0 comments on commit 7c885a4

Please sign in to comment.