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

Commit 41a951d

Browse files
committed
✨ Finishing horizontal parsons problems with sql
1 parent b58cd79 commit 41a951d

File tree

4 files changed

+244
-359
lines changed

4 files changed

+244
-359
lines changed

runestone/hparsons/hparsons.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def setup(app):
5050
%(optional)s
5151
%(dburl)s
5252
%(textentry)s
53+
%(reuse)s
5354
style="visibility: hidden;">
5455
%(initialsetting)s
5556
</textarea>
@@ -97,6 +98,7 @@ class HParsonsDirective(RunestoneIdDirective):
9798
:language: sql, regex
9899
:dburl: only for sql -- url to load database
99100
TODO: fix textentry
101+
:reuse: only for parsons -- make the blocks reusable
100102
:textentry: if you will use text entry instead of horizontal parsons
101103
102104
Here is the problem description. It must ends with the tildes.
@@ -123,6 +125,7 @@ class HParsonsDirective(RunestoneIdDirective):
123125
"dburl": directives.unchanged,
124126
"language": directives.unchanged,
125127
"textentry": directives.flag,
128+
"reuse": directives.flag,
126129
}
127130
)
128131

@@ -136,6 +139,11 @@ def run(self):
136139
else:
137140
self.options['textentry'] = ''
138141

142+
if "reuse" in self.options:
143+
self.options['reuse'] = ' data-reuse="true"'
144+
else:
145+
self.options['reuse'] = ''
146+
139147
explain_text = None
140148
if self.content:
141149
if "~~~~" in self.content:

0 commit comments

Comments
 (0)