How Do I Get The Link In The Gradebook List To Directly Go To The Users Blog
Charles Kelly's Moodle Things

What I wanted to do

  • Get a way teachers can more easily check each student's blogs. In our English courses, blogging is part of the grade.
  • So, I put a link directly to each student's blog from the "gradebook."

What This "Tweak" Does

It puts a link "Blog" in front of the students name on the far right of the "grades."

File to Edit


What to Change

Near line 2107, (It looks something like this in Moodle 1.8+)

if (has_capability('moodle/course:viewcoursegrades', $context)) {
 if ($view_by_student != -1) {
$studentviewlink = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$student.'&amp;course='.$course->id.'">'.$grades_by_student[$student]['student_data']['lastname'].', '.$grades_by_student[$student]['student_data']['firstname'].'</a>';
 else {
$studentviewlink = '<a href="?id='.$course->id.'&amp;action=view_student_grades&amp;user='.$student.'">'.$grades_by_student[$student]['student_data']['lastname'].', '.$grades_by_student[$student]['student_data']['firstname'].'</a>';

....add this....

$blog_link = '<a target="ck" href="'.$CFG->wwwroot.'/blog/index.php?userid='.$student.'&amp;course=61">Blog</a>'; //CK070704

... I also changed the following line, just for appearance sake, to ...

$row .= '<td scope="row">'. $studentviewlink .'</td>'; //CK070704

Near line 2277, if (has_capability('moodle/course:viewcoursegrades', $context)) {

...comment out the next line (I used //CK to comment out the line.) Then add the line which follows it.

 //CK $row .= '<td>'. $studentviewlink .'</td></tr>';
 $row .= '<td>'. $blog_link .' - '. $studentviewlink .'</td></tr>'; // CK 070704

How do I also add in a link to the "all blogs" for each student?

Near line 2107, Just under the line with $blog_link, add this line.

$all_longs_link = '<a target="ck" href="'.$CFG->wwwroot.'/course/user.php?user='.$student.'&amp;id='.$course->id.'&mode=alllogs">Logs</a>'; //CK070717

Near line 2277, Instead of the line in the above section, use this one.

$row .= '<td>'. $blog_link.' - '.$all_longs_link.' - '. $studentviewlink .'</td></tr>'; // CK 070704

Page last modified on July 17, 2007, at 09:41 AM
Copyright © 2006-2008 by Charles Kelly