MDL-46565 gradereport_*: moved report viewed event to bottom of page
authorMark Nelson <markn@moodle.com>
Wed, 6 Aug 2014 02:41:33 +0000 (19:41 -0700)
committerMark Nelson <markn@moodle.com>
Tue, 12 Aug 2014 19:27:50 +0000 (12:27 -0700)
grade/report/grader/index.php
grade/report/outcomes/index.php

index 90ebdf6..3870778 100644 (file)
@@ -125,14 +125,6 @@ if (!empty($target) && !empty($action) && confirm_sesskey()) {
 
 $reportname = get_string('pluginname', 'gradereport_grader');
 
-$event = \gradereport_grader\event\grade_report_viewed::create(
-    array(
-        'context' => $context,
-        'courseid' => $courseid,
-    )
-);
-$event->trigger();
-
 // Print header
 print_grade_page_head($COURSE->id, 'report', 'grader', $reportname, false, $buttons);
 
@@ -205,4 +197,13 @@ if ($USER->gradeediting[$course->id] && ($report->get_pref('showquickfeedback')
 if (!empty($studentsperpage) && $studentsperpage >= 20) {
     echo $OUTPUT->paging_bar($numusers, $report->page, $studentsperpage, $report->pbarurl);
 }
+
+$event = \gradereport_grader\event\grade_report_viewed::create(
+    array(
+        'context' => $context,
+        'courseid' => $courseid,
+    )
+);
+$event->trigger();
+
 echo $OUTPUT->footer();
index df78908..7ffc08e 100644 (file)
@@ -170,6 +170,12 @@ foreach ($report_info as $outcomeid => $outcomedata) {
     $row++;
 }
 
+$html .= '</table>';
+
+print_grade_page_head($courseid, 'report', 'outcomes');
+
+echo $html;
+
 $event = \gradereport_outcomes\event\grade_report_viewed::create(
     array(
         'context' => $context,
@@ -178,12 +184,4 @@ $event = \gradereport_outcomes\event\grade_report_viewed::create(
 );
 $event->trigger();
 
-$html .= '</table>';
-
-print_grade_page_head($courseid, 'report', 'outcomes');
-
-
-echo $html;
 echo $OUTPUT->footer();
-
-