Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-25561 grade: made the student names clickable on the user report

  • Loading branch information...
commit 1a35796fba8999ad0859ad533e1fef9bbf5b748d 1 parent 01f7f6f
@andyjdavis andyjdavis authored
Showing with 14 additions and 3 deletions.
  1. +8 −1 grade/lib.php
  2. +6 −2 grade/report/user/index.php
View
9 grade/lib.php
@@ -626,6 +626,7 @@ public function __construct($id, $link, $string, $parent=null) {
* @param boolean $return Whether to return (true) or echo (false) the HTML generated by this function
* @param string $bodytags Additional attributes that will be added to the <body> tag
* @param string $buttons Additional buttons to display on the page
+ * @param boolean $shownavigation should the gradebook navigation drop down (or tabs) be shown?
*
* @return string HTML code or nothing if $return == false
*/
@@ -673,7 +674,13 @@ function print_grade_page_head($courseid, $active_type, $active_plugin=null,
if ($CFG->grade_navmethod == GRADE_NAVMETHOD_COMBO || $CFG->grade_navmethod == GRADE_NAVMETHOD_DROPDOWN) {
$returnval .= print_grade_plugin_selector($plugin_info, $active_type, $active_plugin, $return);
}
- $returnval .= $OUTPUT->heading($heading);
+
+ if ($return) {
+ $returnval .= $OUTPUT->heading($heading);
+ } else {
+ echo $OUTPUT->heading($heading);
+ }
+
if ($CFG->grade_navmethod == GRADE_NAVMETHOD_COMBO || $CFG->grade_navmethod == GRADE_NAVMETHOD_TABS) {
$returnval .= grade_print_tabs($active_type, $active_plugin, $plugin_info, $return);
}
View
8 grade/report/user/index.php
@@ -109,7 +109,9 @@
while ($userdata = $gui->next_user()) {
$user = $userdata->user;
$report = new grade_report_user($courseid, $gpr, $context, $user->id);
- echo $OUTPUT->heading(get_string('pluginname', 'gradereport_user'). ' - '.fullname($report->user));
+
+ $studentnamelink = html_writer::link(new moodle_url('/user/view.php', array('id' => $report->user->id, 'course' => $courseid)), fullname($report->user));
+ echo $OUTPUT->heading(get_string('pluginname', 'gradereport_user') . ' - ' . $studentnamelink);
if ($report->fill_table()) {
echo '<br />'.$report->print_table(true);
@@ -119,7 +121,9 @@
$gui->close();
} else { // Only show one user's report
$report = new grade_report_user($courseid, $gpr, $context, $userid);
- print_grade_page_head($courseid, 'report', 'user', get_string('pluginname', 'gradereport_user'). ' - '.fullname($report->user));
+
+ $studentnamelink = html_writer::link(new moodle_url('/user/view.php', array('id' => $report->user->id, 'course' => $courseid)), fullname($report->user));
+ print_grade_page_head($courseid, 'report', 'user', get_string('pluginname', 'gradereport_user') . ' - ' . $studentnamelink);
groups_print_course_menu($course, $gpr->get_return_url('index.php?id='.$courseid, array('userid'=>0)));
if ($user_selector) {
Please sign in to comment.
Something went wrong with that request. Please try again.