From 9f2ce393be4e23c64cc6dd5c17e441fb4116a3d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20B=C3=B6sch?= Date: Sun, 26 Oct 2025 15:10:00 +0100 Subject: [PATCH] MDL-85049 question: complete border around table row for newest question --- public/question/classes/local/bank/view.php | 12 ++++++++++ public/theme/boost/scss/moodle/question.scss | 23 +++++++++++++++++--- public/theme/boost/style/moodle.css | 16 ++++++++++++-- public/theme/classic/style/moodle.css | 16 ++++++++++++-- 4 files changed, 60 insertions(+), 7 deletions(-) diff --git a/public/question/classes/local/bank/view.php b/public/question/classes/local/bank/view.php index 4f608ba0bcc..afec3a755d2 100644 --- a/public/question/classes/local/bank/view.php +++ b/public/question/classes/local/bank/view.php @@ -1370,6 +1370,14 @@ class view { } if ($rowclasses) { $attributes['class'] = $rowclasses; + // Add firstrow class to highlighted row if it does not already have it. + if (str_contains($attributes['class'], 'highlight') && !str_contains($attributes['class'], 'firstrow')) { + $attributes['class'] .= ' firstrow'; + // If question_text is not visible, add class onlyhighlightrow. + if (!isset($this->extrarows['question_text_row']) || !($this->extrarows['question_text_row']->isvisible)) { + $attributes['class'] .= ' onlyhighlightrow'; + } + } } echo \html_writer::start_tag('tr', $attributes); foreach ($this->visiblecolumns as $column) { @@ -1377,6 +1385,10 @@ class view { } echo \html_writer::end_tag('tr'); foreach ($this->extrarows as $row) { + if (str_contains($attributes['class'], 'highlight')) { + // Add extrarow class to highlighted row. + $rowclasses .= ' extrarow' . ' ' . $this->extrarows[0]; + } $row->display($question, $rowclasses); } } diff --git a/public/theme/boost/scss/moodle/question.scss b/public/theme/boost/scss/moodle/question.scss index a30d698a491..b57be57defe 100644 --- a/public/theme/boost/scss/moodle/question.scss +++ b/public/theme/boost/scss/moodle/question.scss @@ -164,8 +164,25 @@ table.question-bank-table { background-color: $table-accent-bg; } - & > tbody > tr.highlight { - border: $border-width solid $info; + + &.generaltable > tbody > tr.highlight.firstrow td { + border-top: map-get($border-widths, 3) solid $info; + } + + & > tbody > tr.highlight.firstrow { + border-right: map-get($border-widths, 2) solid $info; + border-left: map-get($border-widths, 2) solid $info; + } + + &.generaltable > tbody > tr.highlight.extrarow td, + &.generaltable > tbody > tr.highlight.firstrow.onlyhighlightrow td { + border-bottom: map-get($border-widths, 2) solid $info; + } + + & > tbody > tr.highlight.extrarow { + border-top: 0; + border-right: map-get($border-widths, 2) solid $info; + border-left: map-get($border-widths, 2) solid $info; } .checkbox input[type="checkbox"] { @@ -699,4 +716,4 @@ body.path-question-type .mform fieldset.hidden { .qbank_managecategories-newchild.qbank_managecategories-droptarget { border-color: $link-color; color: $link-color; -} \ No newline at end of file +} diff --git a/public/theme/boost/style/moodle.css b/public/theme/boost/style/moodle.css index dd5a6bffb80..39fb21ffbb0 100644 --- a/public/theme/boost/style/moodle.css +++ b/public/theme/boost/style/moodle.css @@ -34100,8 +34100,20 @@ table.question-bank-table th { table.question-bank-table > tbody > tr.r1 { background-color: transparent; } -table.question-bank-table > tbody > tr.highlight { - border: 1px solid #008196; +table.question-bank-table.generaltable > tbody > tr.highlight.firstrow td { + border-top: 3px solid #008196; +} +table.question-bank-table > tbody > tr.highlight.firstrow { + border-right: 2px solid #008196; + border-left: 2px solid #008196; +} +table.question-bank-table.generaltable > tbody > tr.highlight.extrarow td, table.question-bank-table.generaltable > tbody > tr.highlight.firstrow.onlyhighlightrow td { + border-bottom: 2px solid #008196; +} +table.question-bank-table > tbody > tr.highlight.extrarow { + border-top: 0; + border-right: 2px solid #008196; + border-left: 2px solid #008196; } table.question-bank-table .checkbox input[type=checkbox] { margin-left: 0; diff --git a/public/theme/classic/style/moodle.css b/public/theme/classic/style/moodle.css index b215c819d2d..1244443fe62 100644 --- a/public/theme/classic/style/moodle.css +++ b/public/theme/classic/style/moodle.css @@ -34100,8 +34100,20 @@ table.question-bank-table th { table.question-bank-table > tbody > tr.r1 { background-color: transparent; } -table.question-bank-table > tbody > tr.highlight { - border: 1px solid #008196; +table.question-bank-table.generaltable > tbody > tr.highlight.firstrow td { + border-top: 3px solid #008196; +} +table.question-bank-table > tbody > tr.highlight.firstrow { + border-right: 2px solid #008196; + border-left: 2px solid #008196; +} +table.question-bank-table.generaltable > tbody > tr.highlight.extrarow td, table.question-bank-table.generaltable > tbody > tr.highlight.firstrow.onlyhighlightrow td { + border-bottom: 2px solid #008196; +} +table.question-bank-table > tbody > tr.highlight.extrarow { + border-top: 0; + border-right: 2px solid #008196; + border-left: 2px solid #008196; } table.question-bank-table .checkbox input[type=checkbox] { margin-left: 0;