Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-12972 Added icons next to each student name in the grader report,…

… which link to the student's user grades report
  • Loading branch information...
commit 80aafa81c2d118ab63afecf1019a18dd69f95f77 1 parent 5e150ff
@nicolasconnault nicolasconnault authored
View
38 grade/report/grader/lib.php
@@ -561,7 +561,7 @@ function get_headerhtml() {
} else {
$headerhtml .= '<tr class="heading r'.$this->rowcount++.'">';
if ($key == $numrows - 1) {
- $headerhtml .= '<th class=" c'.$columncount++.'" scope="col"><a href="'.$this->baseurl.'&amp;sortitemid=firstname">'
+ $headerhtml .= '<th class=" header c'.$columncount++.'" scope="col" colspan="2"><a href="'.$this->baseurl.'&amp;sortitemid=firstname">'
. $strfirstname . '</a> '
. $firstarrow. '/ <a href="'.$this->baseurl.'&amp;sortitemid=lastname">' . $strlastname . '</a>'. $lastarrow .'</th>';
if ($showuseridnumber) {
@@ -574,13 +574,13 @@ function get_headerhtml() {
} else {
$idnumberarrow = '';
}
- $headerhtml .= '<th class=" c'.$columncount++.' useridnumber" scope="col"><a href="'.$this->baseurl.'&amp;sortitemid=idnumber">'
+ $headerhtml .= '<th class="header c'.$columncount++.' useridnumber" scope="col"><a href="'.$this->baseurl.'&amp;sortitemid=idnumber">'
. get_string('idnumber') . '</a> ' . $idnumberarrow . '</th>';
}
} else {
- $colspan='';
+ $colspan = 'colspan="2" ';
if ($showuseridnumber) {
- $colspan = 'colspan="2" ';
+ $colspan = 'colspan="3" ';
}
$headerhtml .= '<td '.$colspan.'class="cell c'.$columncount++.' topleft">&nbsp;</td>';
@@ -708,8 +708,6 @@ function get_studentshtml() {
$row_classes = array(' even ', ' odd ');
- $row_classes = array(' even ', ' odd ');
-
foreach ($this->users as $userid => $user) {
if ($this->canviewhidden) {
@@ -732,10 +730,18 @@ function get_studentshtml() {
$user_pic = '<div class="userpic">' . print_user_picture($user, $this->courseid, null, 0, true) . '</div>';
}
+ $userreportcell = '';
+ if (has_capability('gradereport/user:view', $this->context)) {
+ $a->user = fullname($user);
+ $strgradesforuser = get_string('gradesforuser', 'grades', $a);
+ $userreportcell = '<th class="userreport"><a href="'.$CFG->wwwroot.'/grade/report/user/index.php?id='.$this->courseid.'&amp;userid='.$user->id.'">'
+ .'<img src="'.$CFG->pixpath.'/t/grades.gif" alt="'.$strgradesforuser.'" title="'.$strgradesforuser.'" /></a></th>';
+ }
+
$studentshtml .= '<tr class="r'.$this->rowcount++ . $row_classes[$this->rowcount % 2] . '">'
.'<th class="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>';
+ .fullname($user)."</a>$userreportcell</th>\n";
if ($showuseridnumber) {
$studentshtml .= '<th class="c'.$columncount++.' useridnumber" onclick="set_row(this.parentNode.rowIndex);">'.
@@ -957,9 +963,9 @@ function get_studentnameshtml() {
<table id="fixed_column" class="fixed_grades_column">
<tbody class="leftbody">';
- $colspan = '';
+ $colspan = 'colspan="2"';
if ($showuseridnumber) {
- $colspan = 'colspan="2"';
+ $colspan = 'colspan="3"';
}
$levels = count($this->gtree->levels) - 1;
@@ -973,7 +979,7 @@ function get_studentnameshtml() {
';
}
- $studentshtml .= '<tr class="heading"><th id="studentheader" class="header c0" scope="col"><a href="'.$this->baseurl.'&amp;sortitemid=firstname">'
+ $studentshtml .= '<tr class="heading"><th id="studentheader" colspan="2" class="header c0" scope="col"><a href="'.$this->baseurl.'&amp;sortitemid=firstname">'
. $strfirstname . '</a> '
. $firstarrow. '/ <a href="'.$this->baseurl.'&amp;sortitemid=lastname">' . $strlastname . '</a>'. $lastarrow .'</th>';
@@ -1006,13 +1012,21 @@ function get_studentnameshtml() {
$user_pic = '<div class="userpic">' . print_user_picture($user, $this->courseid, NULL, 0, true) . "</div>\n";
}
+ $userreportcell = '';
+ if (has_capability('gradereport/user:view', $this->context)) {
+ $a->user = fullname($user);
+ $strgradesforuser = get_string('gradesforuser', 'grades', $a);
+ $userreportcell = '<th class="userreport"><a href="'.$CFG->wwwroot.'/grade/report/user/index.php?id='.$this->courseid.'&amp;userid='.$user->id.'">'
+ .'<img src="'.$CFG->pixpath.'/t/grades.gif" alt="'.$strgradesforuser.'" title="'.$strgradesforuser.'" /></a></th>';
+ }
+
$studentshtml .= '<tr class="r'.$this->rowcount++ . $row_classes[$this->rowcount % 2] . '">'
.'<th class="c0 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>\n";
+ .fullname($user)."</a>$userreportcell</th>\n";
if ($showuseridnumber) {
- $studentshtml .= '<th class="header c0 useridnumber" onclick="set_row(this.parentNode.rowIndex);">'. $user->idnumber."</th>\n";
+ $studentshtml .= '<th class="c0 useridnumber" onclick="set_row(this.parentNode.rowIndex);">'. $user->idnumber."</th>\n";
}
$studentshtml .= "</tr>\n";
}
View
43 grade/report/grader/styles.php
@@ -372,6 +372,10 @@
border-right-color:#000;
}
+.grade-report-grader table#fixed_column th.user{
+border-right-color:#cecece;
+}
+
.grade-report-grader table#fixed_column {
padding-top:20px;
border-top:1px solid #cecece;
@@ -433,46 +437,14 @@
}
.grade-report-grader tr.avg,tr.controls,td.controls,th.controls,.grade-report-grader tr.groupavg,tr.range,th.range,td.range,tr.heading th.range {
-height:2em!important;
+height:2.8em!important;
white-space:nowrap;
}
-
.heading_name_row th {
white-space:nowrap;
width:2000px;
}
-.ie .right_scroller {
-padding-bottom:15px;
-overflow-y:hidden;
-}
-
-.ie table#fixed_column th {
-height:40.5px;
-}
-
-.ie table#fixed_column tr.avg th {
-height:21px;
-}
-
-.ie div.left_scroller td {
-height:42px;
-}
-
-.ie6 div.left_scroller {
-margin-top:40px;
-}
-
-.ie6 div.right_scroller {
-margin-top:40px;
-width:auto;
-position:absolute;
-}
-
-.ie6 .excludedfloater {
-font-size:7px;
-}
-
.grade_icons img.ajax {
float:right;
}
@@ -511,7 +483,7 @@
border-width:0;
}
-.grade-report-grader table#user-grades td.useridnumber,.grade-report-grader table#user-grades th,.grade-report-grader div.gradeparent,.ie6 form,.grade-report-grader table#user-grades td.ajax {
+.grade-report-grader table#user-grades td.useridnumber,.grade-report-grader table#user-grades th,.grade-report-grader div.gradeparent,.grade-report-grader table#user-grades td.ajax {
text-align:left;
}
@@ -520,7 +492,7 @@
}
.grade-report-grader div.left_scroller tr,.grade-report-grader div.right_scroller tr,.grade-report-grader div.left_scroller td,.grade-report-grader div.right_scroller td,.grade-report-grader div.left_scroller th,.grade-report-grader div.right_scroller th {
-height:4em;
+height:4.4em;
font-size:10px;
}
@@ -572,4 +544,3 @@
display: none;
}
-
View
1  lang/en_utf8/grades.php
@@ -256,6 +256,7 @@
$string['gradepreferences'] = 'Grade preferences';
$string['gradepreferenceshelp'] = 'Grade preferences Help';
$string['grades'] = 'Grades';
+$string['gradesforuser'] = 'Grades for $a->user';
$string['gradesonly'] = 'Grades only';
$string['gradetype'] = 'Grade type';
$string['gradetypehelp'] = 'Specifies the type of grade used: none (no grading possible), value (enables the maximum and minimum grade settings), scale (enables the scale setting) or text (feedback only). Only value and scale grade types may be aggregated. The grade type for an activity-based grade item is set on the update activity page.';
Please sign in to comment.
Something went wrong with that request. Please try again.