From 19df1c7ea2dbd475386d36c09533d74e7f05d756 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 --- question/classes/local/bank/view.php | 12 ++++++++++++ theme/boost/scss/moodle/question.scss | 22 +++++++++++++++++++--- theme/boost/style/moodle.css | 16 ++++++++++++++-- theme/classic/style/moodle.css | 16 ++++++++++++++-- 4 files changed, 59 insertions(+), 7 deletions(-) diff --git a/question/classes/local/bank/view.php b/question/classes/local/bank/view.php index 1ece6f564e1..8915f66da56 100644 --- a/question/classes/local/bank/view.php +++ b/question/classes/local/bank/view.php @@ -1414,6 +1414,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) { @@ -1421,6 +1429,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/theme/boost/scss/moodle/question.scss b/theme/boost/scss/moodle/question.scss index a30d698a491..3fcfabb1b10 100644 --- a/theme/boost/scss/moodle/question.scss +++ b/theme/boost/scss/moodle/question.scss @@ -164,8 +164,24 @@ 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 +715,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/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index b4e03fd9e97..5ede3f61a22 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -33887,8 +33887,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/theme/classic/style/moodle.css b/theme/classic/style/moodle.css index 5bb29023b3d..c37171d3ea1 100644 --- a/theme/classic/style/moodle.css +++ b/theme/classic/style/moodle.css @@ -33887,8 +33887,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;