diff --git a/stack/cas/castext2/blocks/parsons.block.php b/stack/cas/castext2/blocks/parsons.block.php index 6764b573fe9..fc5734259e3 100644 --- a/stack/cas/castext2/blocks/parsons.block.php +++ b/stack/cas/castext2/blocks/parsons.block.php @@ -61,6 +61,9 @@ public function compile($format, $options): ? MP_Node { if (isset($xpars['overridejs'])) { unset($xpars['overridejs']); } + if (isset($xpars['orientation'])) { + unset($xpars['orientation']); + } // Set default width and height here, we want to push forward to overwrite the iframe defaults // if they are not provided in the block parameters @@ -118,11 +121,14 @@ public function compile($format, $options): ? MP_Node { } } - // Add container divs for the proof lists to be accessed by sortable. + // Add correctly oriented container divs for the proof lists to be accessed by sortable. + $orientation = isset($this->params['orientation']) ? $this->params['orientation'] : 'horizontal'; + $outer = $orientation === 'horizontal' ? 'row' : 'col'; + $inner = $orientation === 'horizontal' ? 'col' : 'row'; $r->items[] = new MP_String('
-
- - +
+
    +
      '); @@ -284,11 +290,11 @@ public function validate ( $valids = null; foreach ($this->params as $key => $value) { if ($key !== 'width' && $key !== 'height' && $key !== 'aspect-ratio' && - $key !== 'version' && $key !== 'overridecss' && $key !== 'input') { + $key !== 'version' && $key !== 'overridecss' && $key !== 'input' && $key !== 'orientation') { $err[] = "Unknown parameter '$key' for Parson's block."; $valid = false; if ($valids === null) { - $valids = ['width', 'height', 'aspect-ratio', 'version', 'overridecss', 'overridejs', 'input']; + $valids = ['width', 'height', 'aspect-ratio', 'version', 'overridecss', 'overridejs', 'input', 'orientation']; $err[] = stack_string('stackBlock_parsons_param', [ 'param' => implode(', ', $valids)]); }