Example #1
0
            echo $OUTPUT->header();
            if ($report->fill_table(true, true)) {
                echo html_writer::tag('h3', get_string('coursesiamtaking', 'grades'));
                echo '<br />' . $report->print_table(true);
            }
        } else {
            // We have a course context. We must be navigating from the gradebook.
            print_grade_page_head($courseid, 'report', 'overview', get_string('pluginname', 'gradereport_overview') . ' - ' . fullname($report->user));
            if ($report->fill_table()) {
                echo '<br />' . $report->print_table(true);
            }
        }
    } else {
        $PAGE->set_pagelayout('standard');
        $header = get_string('grades', 'grades') . ' - ' . fullname($report->user);
        $PAGE->set_title($header);
        $PAGE->set_heading(fullname($report->user));
        echo $OUTPUT->header();
    }
    if (count($report->teachercourses)) {
        echo html_writer::tag('h3', get_string('coursesiamteaching', 'grades'));
        $report->print_teacher_table();
    }
    if (empty($report->studentcourseids) && empty($report->teachercourses)) {
        // We have no report to show the user. Let them know something.
        echo $OUTPUT->notification(get_string('noreports', 'grades'), 'notifymessage');
    }
}
$event = \gradereport_overview\event\grade_report_viewed::create(array('context' => $context, 'courseid' => $courseid, 'relateduserid' => $userid));
$event->trigger();
echo $OUTPUT->footer();
Example #2
0
File: lib.php Project: dg711/moodle
 /**
  * Trigger the grade_report_viewed event
  *
  * @param  stdClass $context  course context
  * @param  int $courseid      course id
  * @param  int $userid        user id
  * @since Moodle 3.2
  */
 public static function viewed($context, $courseid, $userid)
 {
     $event = \gradereport_overview\event\grade_report_viewed::create(array('context' => $context, 'courseid' => $courseid, 'relateduserid' => $userid));
     $event->trigger();
 }