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

Commit 35a3f36

Browse files
committed
updated sphinx directives for backwards-compatibility with the now depreciated MC directives
1 parent 68b2db1 commit 35a3f36

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

runestone/assess/assess.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626

2727
def setup(app):
2828
app.add_directive('mchoice', MChoice)
29+
app.add_directive('mchoicemf', MChoiceMF)
30+
app.add_directive('mchoicema', MChoiceMA)
31+
app.add_directive('mchoicerandommf', MChoiceRandomMF)
2932
app.add_directive('fillintheblank', FillInTheBlank)
3033
app.add_directive('blank', Blank)
3134
app.add_directive('addbutton', AddButton)

runestone/assess/multiplechoice.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,5 +153,27 @@ def run(self):
153153
mcNode.template_end = TEMPLATE_END
154154

155155
#self.state.nested_parse(self.content, self.content_offset, mcNode)
156-
157156
return [mcNode]
157+
158+
class MChoiceMF(MChoice):
159+
def run(self):
160+
print("This directive has been depreciated. Please convert to the new directive 'mchoice'")
161+
mcmfNode = super(MChoiceMF,self).run()[0]
162+
163+
return [mcmfNode]
164+
165+
class MChoiceMA(MChoice):
166+
def run(self):
167+
self.options['multipleAnswers'] = 'multipleAnswers'
168+
print("This directive has been depreciated. Please convert to the new directive 'mchoice'")
169+
mchoicemaNode = super(MChoiceMA,self).run()[0]
170+
171+
return [mchoicemaNode]
172+
173+
class MChoiceRandomMF(MChoice):
174+
def run(self):
175+
self.options['random'] = 'random'
176+
print("This directive has been depreciated. Please convert to the new directive 'mchoice'")
177+
mchoicerandommfNode = super(MChoiceRandomMF,self).run()[0]
178+
179+
return[mchoicerandommfNode]

0 commit comments

Comments
 (0)