Skip to content

Commit f910d4f

Browse files
committed
fix the color
1 parent e8fdc26 commit f910d4f

File tree

1 file changed

+32
-19
lines changed

1 file changed

+32
-19
lines changed

app/views/exercises/Jsparson/exercise/simple/s10.html.erb

+32-19
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,41 @@
1313
height: 800px;
1414
}
1515
.fixed {
16-
pointer-events: none; /* 禁用鼠标事件 */
17-
background-color: #f5f5f5; /* 与屏幕截图中的灰色相匹配 */
18-
color: #333; /* 文字颜色 */
19-
border: 1px solid #ddd; /* 边框颜色和样式 */
20-
margin: 0; /* 移除外边距 */
21-
padding: 10px; /* 内边距 */
22-
box-sizing: border-box; /* 确保宽度包含内边距和边框 */
16+
pointer-events: none;
17+
background-color: #f5f5f5;
18+
color: #333;
19+
border: 1px solid
20+
margin: 0;
21+
padding: 10px;
22+
box-sizing: border-box;
2323
}
24-
25-
/* 可拖动行的样式 */
26-
.sortable-code li {
27-
list-style-type: none; /* 移除列表项前的标记 */
28-
margin: 5px 0; /* 添加一点外边距 */
29-
padding: 10px; /* 内边距 */
30-
border: 1px solid #ddd; /* 边框颜色和样式 */
31-
background-color: #fff; /* 背景颜色 */
32-
cursor: move; /* 鼠标样式表示可以移动 */
24+
#fixedArea {
25+
background-color: #f5f5f5;
26+
padding: 10px;
27+
margin-bottom: 10px;
28+
}
29+
#fixedFooterArea {
30+
background-color:
31+
padding: 10px;
32+
margin-top: 10px;
3333
}
3434

35+
3536
</style>
3637
</head>
3738
<body>
3839
<div id="container">
3940
<h2 id="title"></h2>
4041
<p id="instructions"></p>
4142
<div id="exercise-data" data-external-id="<%= external_id %>"></div>
43+
<div id="fixedArea" class="fixed"></div>
4244
<div id="sortableTrash" class="sortable-code"></div>
4345
<div id="sortable" class="sortable-code">
4446
</div>
4547

48+
4649
<div style="clear:both;"></div>
50+
<div id="fixedFooterArea" class="fixed"></div>
4751
<p>
4852
<a href="#" id="feedbackLink">Get feedback</a>
4953
<h2>Feedback</h2>
@@ -165,9 +169,18 @@
165169
var externalId = externalIdElement.getAttribute("data-external-id");
166170
console.log(externalId)
167171

168-
169-
170-
parson.init(codeline);
172+
const fixedArea = document.getElementById('fixedArea');
173+
const firstFixedLine = fixedLines[0];
174+
const codeBlock = document.createElement('div');
175+
codeBlock.textContent = firstFixedLine;
176+
fixedArea.appendChild(codeBlock);
177+
178+
const fixedFooterArea = document.getElementById('fixedFooterArea');
179+
const lastFixedLine = fixedLines[fixedLines.length - 1];
180+
const codeBlock2 = document.createElement('div');
181+
codeBlock2.textContent = lastFixedLine;
182+
fixedFooterArea.appendChild(codeBlock2);
183+
parson.init(shuffleLines);
171184
parson.shuffleLines();
172185

173186

0 commit comments

Comments
 (0)