MDL-85049 question: complete border around table row for newest question

This commit is contained in:
Luca Bösch
2025-11-13 17:01:35 +01:00
parent 982a10e9cf
commit 9f2ce393be
4 changed files with 60 additions and 7 deletions
@@ -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);
}
}
+20 -3
View File
@@ -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;
}
}
+14 -2
View File
@@ -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;
+14 -2
View File
@@ -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;