Skip to content

Commit

Permalink
Merge branch 'MDL-36009-27' of git://github.com/jethac/moodle into MO…
Browse files Browse the repository at this point in the history
…ODLE_27_STABLE
  • Loading branch information
David Monllao committed Feb 9, 2015
2 parents 2b8b2e8 + 3be4c87 commit abb41a5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
3 changes: 3 additions & 0 deletions grade/report/grader/lang/en/gradereport_grader.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@
$string['grader:view'] = 'View the grader report';
$string['pluginname'] = 'Grader report';
$string['preferences'] = 'Grader report preferences';
$string['summarygrader'] = 'A table with the names of students in the first column, with assessable activities grouped by course and category across the top.';
$string['summarygraderleft'] = "A table with the names of students in the first column, with student-specific metadata such as email addresses in the others.";
$string['summarygraderright'] = "A table of assessable activities, grouped by course and category across the top.";
$string['useractivitygrade'] = '{$a} grade';
$string['useractivityfeedback'] = '{$a} feedback';
35 changes: 22 additions & 13 deletions grade/report/grader/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -603,12 +603,18 @@ public function get_left_rows($displayaverages) {

$levels = count($this->gtree->levels) - 1;

for ($i = 0; $i < $levels; $i++) {
$fillercell = new html_table_cell();
$fillercell->attributes['class'] = 'fixedcolumn cell topleft';
$fillercell->text = ' ';
$fillercell->colspan = $colspan;
$row = new html_table_row(array($fillercell));
$fillercell = new html_table_cell();
$fillercell->header = true;
$fillercell->attributes['scope'] = 'col';
$fillercell->attributes['class'] = 'cell topleft';
$fillercell->text = html_writer::span(get_string('participants'), 'accesshide');
$fillercell->colspan = $colspan;
$fillercell->rowspan = $levels;
$row = new html_table_row(array($fillercell));
$rows[] = $row;

for ($i = 1; $i < $levels; $i++) {
$row = new html_table_row();
$rows[] = $row;
}

Expand Down Expand Up @@ -650,7 +656,7 @@ public function get_left_rows($displayaverages) {
$userrow->attributes['class'] = 'r'.$this->rowcount++.' '.$rowclasses[$this->rowcount % 2];

$usercell = new html_table_cell();
$usercell->attributes['class'] = 'user';
$usercell->attributes['class'] = 'header user';

$usercell->header = true;
$usercell->scope = 'row';
Expand All @@ -677,7 +683,7 @@ public function get_left_rows($displayaverages) {
if (has_capability('gradereport/'.$CFG->grade_profilereport.':view', $this->context)) {
$userreportcell = new html_table_cell();
$userreportcell->attributes['class'] = 'userreport';
$userreportcell->header = true;
$userreportcell->header = false;
$a = new stdClass();
$a->user = fullname($user);
$strgradesforuser = get_string('gradesforuser', 'grades', $a);
Expand All @@ -688,9 +694,8 @@ public function get_left_rows($displayaverages) {

foreach ($extrafields as $field) {
$fieldcell = new html_table_cell();
$fieldcell->attributes['class'] = 'header userfield user' . $field;
$fieldcell->header = true;
$fieldcell->scope = 'row';
$fieldcell->attributes['class'] = 'userfield user' . $field;
$fieldcell->header = false;
$fieldcell->text = $user->{$field};
$userrow->cells[] = $fieldcell;
}
Expand Down Expand Up @@ -767,8 +772,9 @@ public function get_right_rows($displayaverages) {
$fillercell->attributes['class'] = $type . ' ' . $catlevel;
$fillercell->colspan = $colspan;
$fillercell->text = '&nbsp;';
$fillercell->header = true;
$fillercell->scope = 'col';

// This is a filler cell; don't use a <th>, it'll confuse screen readers.
$fillercell->header = false;
$headingrow->cells[] = $fillercell;
} else if ($type == 'category') {
// Element is a category
Expand Down Expand Up @@ -1109,17 +1115,20 @@ public function get_grade_table($displayaverages = false) {
$fixedcolumntable = new html_table();
$fixedcolumntable->id = 'fixed_column';
$fixedcolumntable->data = $leftrows;
$fixedcolumntable->summary = get_string('summarygraderleft', 'gradereport_grader');
$html .= $OUTPUT->container(html_writer::table($fixedcolumntable), 'left_scroller');

$righttable = new html_table();
$righttable->id = 'user-grades';
$righttable->data = $rightrows;
$righttable->summary = get_string('summarygraderright', 'gradereport_grader');

$html .= $OUTPUT->container(html_writer::table($righttable), 'right_scroller');
} else {
$fulltable = new html_table();
$fulltable->attributes['class'] = 'gradestable flexible boxaligncenter generaltable';
$fulltable->id = 'user-grades';
$fulltable->summary = get_string('summarygrader', 'gradereport_grader');

// Extract rows from each side (left and right) and collate them into one row each
foreach ($leftrows as $key => $row) {
Expand Down

0 comments on commit abb41a5

Please sign in to comment.