Skip to content

Commit

Permalink
Issue #78: Show in upcomming quizzes graph inprogress quizzes that ar…
Browse files Browse the repository at this point in the history
…e upcomming quizzes with override
  • Loading branch information
guillogo committed Mar 10, 2021
1 parent 47cbb23 commit 83fcb60
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion classes/output/upcomming_quizzes.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,17 @@ public function get_upcomming_quizzes_chart(int $now): array {
$participantcount += $quiz->participants;
}

// Check if inprogress quizzes are upcomming quizzes with overrides.
foreach ($quizzes['inprogress'] as $inprogress) {
if ($inprogress->timestampopen >= $timestamp && $inprogress->timestampopen < $timestamp + HOURSECS) {
$quizcount++;
$participantcount += $inprogress->participants;
}
}

$quizseriesdata[] = $quizcount;
$participantseriesdata[] = $participantcount;
$labels[] = userdate($timestamp, get_string('inprogressdatetime', 'local_assessfreq'));
$labels[] = userdate($timestamp + HOURSECS, get_string('inprogressdatetime', 'local_assessfreq'));
}

// Create chart object.
Expand Down

0 comments on commit 83fcb60

Please sign in to comment.