From fbdf6e3cbaab123a94bf9b73330c952a6ebfdb2e Mon Sep 17 00:00:00 2001 From: smmercuri Date: Mon, 13 Nov 2023 12:35:03 +0000 Subject: [PATCH] move bootstrap css to sortable css --- corsscripts/sortable.min.css | 2 +- stack/cas/castext2/blocks/parsons.block.php | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/corsscripts/sortable.min.css b/corsscripts/sortable.min.css index a55761d787d..f5fbf05d1ca 100644 --- a/corsscripts/sortable.min.css +++ b/corsscripts/sortable.min.css @@ -1 +1 @@ -body{background-color:inherit;}#usedList:empty{height:50px;background-color:floralwhite}#availableList>li{background-color:lightcoral}#availableList:empty{height:50px;background-color:lightpink} \ No newline at end of file +@import url("https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css");body{background-color:inherit;}#usedList:empty{height:50px;background-color:floralwhite}#availableList>li{background-color:lightcoral}#availableList:empty{height:50px;background-color:lightpink} \ No newline at end of file diff --git a/stack/cas/castext2/blocks/parsons.block.php b/stack/cas/castext2/blocks/parsons.block.php index fc5734259e3..9fbd4169510 100644 --- a/stack/cas/castext2/blocks/parsons.block.php +++ b/stack/cas/castext2/blocks/parsons.block.php @@ -1,18 +1,18 @@ . +// along with STACK. If not, see . defined('MOODLE_INTERNAL') || die(); require_once(__DIR__ . '/../block.interface.php'); @@ -94,10 +94,6 @@ public function compile($format, $options): ? MP_Node { // Plug in some style and scripts. $r->items[] = new MP_String(''); - $r->items[] = new MP_List([ - new MP_String('style'), - new MP_String(json_encode(['href' => 'https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css'])) - ]); $r->items[] = new MP_List([ new MP_String('style'), new MP_String(json_encode(['href' => $css])) @@ -138,8 +134,8 @@ public function compile($format, $options): ? MP_Node { $importCode = "\nimport {stack_js} from '" . stack_cors_link('stackjsiframe.min.js') . "';\n"; $importCode .= "import {Sortable} from '" . stack_cors_link('sortable.min.js') . "';\n"; $importCode .= "import {preprocess_steps, stack_sortable} from '" . stack_cors_link('stacksortable.min.js') . "';\n"; - $r->items[] = new MP_String($importCode); + // Extract the proof steps from the inner content $r->items[] = new MP_String('var proofSteps = '); @@ -158,7 +154,7 @@ public function compile($format, $options): ? MP_Node { } } - // parse steps and options separately if they exist + // parse steps and Sortable options separately if they exist $code = 'var userOpts;' . "\n"; $code .= '[proofSteps, userOpts] = preprocess_steps(proofSteps, userOpts);' . "\n";