From 2512e6b09ee9da46f911202376979729984dee71 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Fri, 22 Mar 2024 15:53:50 +0000 Subject: [PATCH] MDL-77685 grade: remove Behat specific report rendering hacks. These changes follow the same approach as that taken elsewhere in the Gradebook in 3643f48e0f. --- grade/report/singleview/classes/local/screen/user.php | 11 +++-------- grade/report/user/classes/report/user.php | 10 ++-------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/grade/report/singleview/classes/local/screen/user.php b/grade/report/singleview/classes/local/screen/user.php index c49ddd9e58e..5a228cdf83c 100644 --- a/grade/report/singleview/classes/local/screen/user.php +++ b/grade/report/singleview/classes/local/screen/user.php @@ -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"), diff --git a/grade/report/user/classes/report/user.php b/grade/report/user/classes/report/user.php index c9cfc11682f..3b45568efe8 100644 --- a/grade/report/user/classes/report/user.php +++ b/grade/report/user/classes/report/user.php @@ -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");