aboutsummaryrefslogtreecommitdiff
path: root/quiz.py
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-11-04 13:08:08 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2023-11-04 13:08:08 +0100
commit9a82aebc0115eeb1ef7fc6aecccb991c84b56b9c (patch)
treec8ffe3f02b3b07108cb3d2584550a6be29c78125 /quiz.py
parent5111362f0e0201f6b260ed23e4f71c0bfa8dfdf4 (diff)
downloadquiz-9a82aebc0115eeb1ef7fc6aecccb991c84b56b9c.tar.gz
quiz-9a82aebc0115eeb1ef7fc6aecccb991c84b56b9c.zip
add answer flag to specify used prompt
Diffstat (limited to 'quiz.py')
-rwxr-xr-xquiz.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/quiz.py b/quiz.py
index c658508..f01ec10 100755
--- a/quiz.py
+++ b/quiz.py
@@ -200,6 +200,9 @@ def main():
parser.add_argument('--question-match',
help='match question files names',
default='*')
+ parser.add_argument('--answers',
+ help='match question files names',
+ nargs='*')
args = parser.parse_args()
question_dirs = [Path(p) for p in args.question_dir or ['.']]
@@ -220,7 +223,7 @@ def main():
print(f'{next_question}: {solution}', end='')
show_question(next_question)
- prompt_solution(solution)
+ prompt_solution(solution, prompts=args.answers)
terminate_subprocesses()
solved.append(next_question)