Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit fc9886c

Browse files
committed
added readme for clickable area
1 parent 2c0f61e commit fc9886c

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

runestone/clickableArea/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<h2>Clickable Area</h2>
2+
3+
```html
4+
<pre data-component="clickablearea" id="clickable1">
5+
<span data-question>Click on all variable assignment statements</span><span data-feedback>Remember, variable assignment statements usually involve the operator '='.</span>def main():
6+
<span data-incorrect>print("Hello world")</span>
7+
<span data-correct>x = 4</span>
8+
for i in range(5):
9+
<span data-correct>y = i</span>
10+
print(y)
11+
<span data-incorrect>return 0</span>
12+
</pre>
13+
```
14+
Here the <code>pre</code> tag represents the entire component to be rendered.
15+
Each area that the author would like to be clickable is wrapped in a <code>span</code> tag that has the <code>data-correct</code> or <code>data-incorrect</code> attribute.
16+
After specifying the data-component, question and feedback (optional), the author can start his/her block of code, indented as he/he would like, using <code>span</code> elements to identify the clickable parts of the code.
17+
18+
Option spec:
19+
<ul>
20+
<li><code>data-component="clickablearea"</code> identifies this as a clickable area component</li>
21+
<li><code>id</code> Must be unique in the document</li>
22+
<li><code>data-question</code> Identifies a <code>span</code> element that contains the question associated with the component</li>
23+
<li><code>data-feedback</code> Optional--identifies a <code>span</code> that contains the feedback that is displayed when someone answers incorrectly</li>
24+
<li><code>data-correct</code> Identifies a correct clickable area</li>
25+
<li><code>data-incorrect</code> Identifies an incorrect clickable area</li>
26+
</ul>

0 commit comments

Comments
 (0)