Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added logic in function quiz_get_recent_mod_activity for groups

  • Loading branch information...
commit 6a0c9cf8a3673b3199ce36ed6e5422e214a5dfa8 1 parent 587510b
selliott authored
Showing with 23 additions and 19 deletions.
  1. +23 −19 mod/quiz/lib.php
42 mod/quiz/lib.php
View
@@ -2539,36 +2539,40 @@ function quiz_get_recent_mod_activity(&$activities, &$index, $sincetime, $course
AND q.course = cm.course
ORDER BY qa.timefinish ASC");
- if (empty($quizzes))
- return;
+ if (empty($quizzes))
+ return;
- foreach ($quizzes as $quiz) {
- $tmpactivity->type = "quiz";
- $tmpactivity->defaultindex = $index;
- $tmpactivity->instance = $quiz->quiz;
+ foreach ($quizzes as $quiz) {
+ if (empty($groupid) || ismember($groupid, $quiz->userid)) {
- $tmpactivity->name = $quiz->name;
- $tmpactivity->section = $quiz->section;
+ $tmpactivity->type = "quiz";
+ $tmpactivity->defaultindex = $index;
+ $tmpactivity->instance = $quiz->quiz;
- $tmpactivity->content->attemptid = $quiz->id;
- $tmpactivity->content->sumgrades = $quiz->sumgrades;
- $tmpactivity->content->maxgrade = $quiz->maxgrade;
- $tmpactivity->content->attempt = $quiz->attempt;
+ $tmpactivity->name = $quiz->name;
+ $tmpactivity->section = $quiz->section;
- $tmpactivity->user->userid = $quiz->userid;
- $tmpactivity->user->fullname = fullname($quiz);
- $tmpactivity->user->picture = $quiz->picture;
+ $tmpactivity->content->attemptid = $quiz->id;
+ $tmpactivity->content->sumgrades = $quiz->sumgrades;
+ $tmpactivity->content->maxgrade = $quiz->maxgrade;
+ $tmpactivity->content->attempt = $quiz->attempt;
- $tmpactivity->timestamp = $quiz->timefinish;
+ $tmpactivity->user->userid = $quiz->userid;
+ $tmpactivity->user->fullname = fullname($quiz);
+ $tmpactivity->user->picture = $quiz->picture;
- $activities[] = $tmpactivity;
+ $tmpactivity->timestamp = $quiz->timefinish;
- $index++;
- }
+ $activities[] = $tmpactivity;
+
+ $index++;
+ }
+ }
return;
}
+
function quiz_print_recent_mod_activity($activity, $course, $detail=false) {
global $CFG, $THEME;
Please sign in to comment.
Something went wrong with that request. Please try again.