Skip to content

Commit

Permalink
MDL-11835 Alternating row colours for grader report
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasconnault committed Dec 7, 2007
1 parent 0c87b5a commit 292e3e1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion grade/report/grader/lib.php
Expand Up @@ -642,6 +642,8 @@ function get_studentshtml() {
$scales_list = substr($scales_list, 0, -1);
$scales_array = get_records_list('scale', 'id', $scales_list);
}

$row_classes = array(' even ', ' odd ');

foreach ($this->users as $userid => $user) {

Expand All @@ -662,7 +664,8 @@ function get_studentshtml() {
$user_pic = '<div class="userpic">' . print_user_picture($user->id, $this->courseid, true, 0, true) . '</div>';
}

$studentshtml .= '<tr class="r'.$this->rowcount++.'"><th class="header c'.$columncount++.' user" scope="row" onclick="set_row(this.parentNode.rowIndex);">'.$user_pic
$studentshtml .= '<tr class="r'.$this->rowcount++ . $row_classes[$this->rowcount % 2] . '">'
.'<th class="header c'.$columncount++.' user" scope="row" onclick="set_row(this.parentNode.rowIndex);">'.$user_pic
.'<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$this->course->id.'">'
.fullname($user).'</a></th>';

Expand Down

0 comments on commit 292e3e1

Please sign in to comment.