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
/grade/lib.php
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.'&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.'&action=view_student_grades&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.'&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.'&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