|
13 | 13 | height: 800px;
|
14 | 14 | }
|
15 | 15 | .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; |
23 | 23 | }
|
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; |
33 | 33 | }
|
34 | 34 |
|
| 35 | + |
35 | 36 | </style>
|
36 | 37 | </head>
|
37 | 38 | <body>
|
38 | 39 | <div id="container">
|
39 | 40 | <h2 id="title"></h2>
|
40 | 41 | <p id="instructions"></p>
|
41 | 42 | <div id="exercise-data" data-external-id="<%= external_id %>"></div>
|
| 43 | + <div id="fixedArea" class="fixed"></div> |
42 | 44 | <div id="sortableTrash" class="sortable-code"></div>
|
43 | 45 | <div id="sortable" class="sortable-code">
|
44 | 46 | </div>
|
45 | 47 |
|
| 48 | + |
46 | 49 | <div style="clear:both;"></div>
|
| 50 | + <div id="fixedFooterArea" class="fixed"></div> |
47 | 51 | <p>
|
48 | 52 | <a href="#" id="feedbackLink">Get feedback</a>
|
49 | 53 | <h2>Feedback</h2>
|
|
165 | 169 | var externalId = externalIdElement.getAttribute("data-external-id");
|
166 | 170 | console.log(externalId)
|
167 | 171 |
|
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); |
171 | 184 | parson.shuffleLines();
|
172 | 185 |
|
173 | 186 |
|
|
0 commit comments