From f910d4ff3499ab5b40ad2a7894fa4259de3a7d17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Czkewei19=E2=80=9D?= Date: Tue, 7 May 2024 21:34:34 -0400 Subject: [PATCH] fix the color --- .../Jsparson/exercise/simple/s10.html.erb | 51 ++++++++++++------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/app/views/exercises/Jsparson/exercise/simple/s10.html.erb b/app/views/exercises/Jsparson/exercise/simple/s10.html.erb index c3d34aad..16112113 100644 --- a/app/views/exercises/Jsparson/exercise/simple/s10.html.erb +++ b/app/views/exercises/Jsparson/exercise/simple/s10.html.erb @@ -13,25 +13,26 @@ height: 800px; } .fixed { - pointer-events: none; /* 禁用鼠标事件 */ - background-color: #f5f5f5; /* 与屏幕截图中的灰色相匹配 */ - color: #333; /* 文字颜色 */ - border: 1px solid #ddd; /* 边框颜色和样式 */ - margin: 0; /* 移除外边距 */ - padding: 10px; /* 内边距 */ - box-sizing: border-box; /* 确保宽度包含内边距和边框 */ + pointer-events: none; + background-color: #f5f5f5; + color: #333; + border: 1px solid + margin: 0; + padding: 10px; + box-sizing: border-box; } - - /* 可拖动行的样式 */ - .sortable-code li { - list-style-type: none; /* 移除列表项前的标记 */ - margin: 5px 0; /* 添加一点外边距 */ - padding: 10px; /* 内边距 */ - border: 1px solid #ddd; /* 边框颜色和样式 */ - background-color: #fff; /* 背景颜色 */ - cursor: move; /* 鼠标样式表示可以移动 */ + #fixedArea { + background-color: #f5f5f5; + padding: 10px; + margin-bottom: 10px; + } + #fixedFooterArea { + background-color: + padding: 10px; + margin-top: 10px; } + @@ -39,11 +40,14 @@

+
+
+

Get feedback

Feedback

@@ -165,9 +169,18 @@ var externalId = externalIdElement.getAttribute("data-external-id"); console.log(externalId) - - - parson.init(codeline); + const fixedArea = document.getElementById('fixedArea'); + const firstFixedLine = fixedLines[0]; + const codeBlock = document.createElement('div'); + codeBlock.textContent = firstFixedLine; + fixedArea.appendChild(codeBlock); + + const fixedFooterArea = document.getElementById('fixedFooterArea'); + const lastFixedLine = fixedLines[fixedLines.length - 1]; + const codeBlock2 = document.createElement('div'); + codeBlock2.textContent = lastFixedLine; + fixedFooterArea.appendChild(codeBlock2); + parson.init(shuffleLines); parson.shuffleLines();