diff --git a/mod/feedback/item/multichoice/lib.php b/mod/feedback/item/multichoice/lib.php
index 925ed01f52d..dc9c25c5bbf 100644
--- a/mod/feedback/item/multichoice/lib.php
+++ b/mod/feedback/item/multichoice/lib.php
@@ -319,7 +319,7 @@ class feedback_item_multichoice extends feedback_item_base {
$class = 'multichoice-' . $info->subtype;
$inputname = $item->typ . '_' . $item->id;
$options = $this->get_options($item);
- $separator = !empty($info->horizontal) ? ' ' : '
';
+ $separator = !empty($info->horizontal) ? ' ' : \html_writer::div('', 'w-100');
$tmpvalue = $form->get_item_value($item) ?? 0; // Used for element defaults, so must be a valid value (not null).
// Subtypes:
diff --git a/mod/feedback/item/multichoicerated/lib.php b/mod/feedback/item/multichoicerated/lib.php
index 54e62ccafc8..781510114df 100644
--- a/mod/feedback/item/multichoicerated/lib.php
+++ b/mod/feedback/item/multichoicerated/lib.php
@@ -324,7 +324,7 @@ class feedback_item_multichoicerated extends feedback_item_base {
}
// Span to hold the element id. The id is used for drag and drop reordering.
$objs[] = ['static', '', '', html_writer::span('', '', ['id' => 'feedback_item_' . $item->id])];
- $separator = $info->horizontal ? ' ' : '
';
+ $separator = $info->horizontal ? ' ' : \html_writer::div('', 'w-100');
$class .= ' multichoicerated-' . ($info->horizontal ? 'horizontal' : 'vertical');
$el = $form->add_form_group_element($item, 'group_'.$inputname, $name, $objs, $separator, $class);
$form->set_element_type($inputname, PARAM_INT);