MDL-56395 Gradebook: Make long item titles more accessible

This commit is contained in:
John Beedell 2016-10-13 10:07:36 +01:00
parent 919b9dfabd
commit 89eacee7a2
4 changed files with 15 additions and 5 deletions

View File

@ -1542,7 +1542,8 @@ class grade_structure {
$header .= $this->get_element_icon($element, $spacerifnone);
}
$header .= $element['object']->get_name($fulltotal);
$title = $element['object']->get_name($fulltotal);
$header .= $title;
if ($element['type'] != 'item' and $element['type'] != 'categoryitem' and
$element['type'] != 'courseitem') {
@ -1552,11 +1553,12 @@ class grade_structure {
if ($withlink && $url = $this->get_activity_link($element)) {
$a = new stdClass();
$a->name = get_string('modulename', $element['object']->itemmodule);
$a->title = $title;
$title = get_string('linktoactivity', 'grades', $a);
$header = html_writer::link($url, $header, array('title' => $title));
$header = html_writer::link($url, $header, array('title' => $title, 'class' => 'gradeitemheader'));
} else {
$header = html_writer::span($header);
$header = html_writer::span($header, 'gradeitemheader', array('title' => $title, 'tabindex' => '0'));
}
if ($withdescription) {

View File

@ -877,7 +877,7 @@ class grade_report_grader extends grade_report {
}
$itemcell->colspan = $colspan;
$itemcell->text = shorten_text($headerlink) . $arrow . $singleview;
$itemcell->text = $headerlink . $arrow . $singleview;
$itemcell->header = true;
$itemcell->scope = 'col';

View File

@ -98,6 +98,14 @@
vertical-align: middle;
}
.path-grade-report-grader .gradeitemheader {
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
max-width: 200px;
vertical-align: bottom;
}
/**
* The additional user fields.
*/

View File

@ -436,7 +436,7 @@ $string['letterreal'] = 'Letter (real)';
$string['letters'] = 'Letters';
$string['linkedactivity'] = 'Linked activity';
$string['linkedactivity_help'] = 'This setting specifies an activity to which this outcome item is linked. This may be used to measure student performance on criteria not assessed by the activity grade.';
$string['linktoactivity'] = 'Link to {$a->name} activity';
$string['linktoactivity'] = 'Link to {$a->name} activity {$a->title}';
$string['lock'] = 'Lock';
$string['locked'] = 'Locked';
$string['locked_help'] = 'If ticked, grades can no longer be automatically updated by the related activity.';