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

Commit 7c2cd99

Browse files
committed
validate practice option
1 parent 78892a7 commit 7c2cd99

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

runestone/server/componentdb.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,13 @@ def addQuestionToDB(self):
272272
author = os.environ.get("USER", "Brad Miller")
273273

274274
autograde = self.options.get("autograde", None)
275-
practice = self.options.get("practice", None)
275+
if "practice" in self.options:
276+
value = self.options["practice"].upper()
277+
assert value == "T" or value == "F", f":practice: must be T or F not '{value}'"
278+
practice = value
279+
else:
280+
practice = None
281+
276282
if ("topics" in self.options) and (self.options["topics"] != ""):
277283
topics = self.options["topics"]
278284
else:

0 commit comments

Comments
 (0)