MDL-77685 grade: remove Behat specific report rendering hacks.

These changes follow the same approach as that taken elsewhere in
the Gradebook in 3643f48e0f.
This commit is contained in:
Paul Holden 2024-03-22 15:53:50 +00:00
parent f88dbfcafc
commit 2512e6b09e
No known key found for this signature in database
GPG Key ID: A81A96D6045F6164
2 changed files with 5 additions and 16 deletions

View File

@ -198,14 +198,9 @@ class user extends tablelike implements selectable_items {
$itemicon = html_writer::div($this->format_icon($item), 'mr-1');
$itemtype = \html_writer::span(\grade_helper::get_element_type_string($gradetreeitem),
'd-block text-uppercase small dimmed_text');
// If a behat test site is running avoid outputting the information about the type of the grade item.
// This additional information currently causes issues in behat particularly with the existing xpath used to
// interact with table elements.
if (!defined('BEHAT_SITE_RUNNING')) {
$itemcontent = html_writer::div($itemtype . $itemname);
} else {
$itemcontent = html_writer::div($itemname);
}
$itemtitle = html_writer::div($itemname, 'rowtitle');
$itemcontent = html_writer::div($itemtype . $itemtitle);
$line = [
html_writer::div($itemicon . $itemcontent, "{$type} d-flex align-items-center"),

View File

@ -598,14 +598,8 @@ class user extends grade_report {
}
// Generate the content for a cell that represents a grade item.
// If a behat test site is running avoid outputting the information about the type of the grade item.
// This additional information causes issues in behat particularly with the existing xpath used to
// interact with table elements.
if (!defined('BEHAT_SITE_RUNNING')) {
$content = \html_writer::div($itemtype . $fullname);
} else {
$content = \html_writer::div($fullname);
}
$itemtitle = \html_writer::div($fullname, 'rowtitle');
$content = \html_writer::div($itemtype . $itemtitle);
// Name.
$data['itemname']['content'] = \html_writer::div($itemicon . $content, "{$type} d-flex align-items-center");