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

Commit 7fd81fb

Browse files
committed
Raise an error if not enough questions for AB testing
1 parent 53dd347 commit 7fd81fb

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

runestone/selectquestion/selectone.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ def run(self):
168168
self.options["primary"] = ""
169169

170170
if "ab" in self.options:
171+
if len(self.question_bank_choices.split(",")) != 2:
172+
raise self.severe("AB questions must have 2 options for :fromid:")
171173
self.options["AB"] = f"data-ab={self.options['ab']}"
172174
else:
173175
self.options["AB"] = ""

0 commit comments

Comments
 (0)