From cd22497ee35c67c367f7c141c723298562674f4c Mon Sep 17 00:00:00 2001 From: sheepmax <guichardmax@gmail.com> Date: Mon, 21 Aug 2023 17:32:05 +0200 Subject: [PATCH] Added some errors for when cells are not run --- book/cookbook/grading.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/book/cookbook/grading.py b/book/cookbook/grading.py index a4c16360..247b55e5 100644 --- a/book/cookbook/grading.py +++ b/book/cookbook/grading.py @@ -7,7 +7,10 @@ def check(f): button = widgets.Button(description="Check answer") @output.capture(clear_output=True,wait=True) def _inner_check(button): - f(*args, **kwargs) + try: + f(*args, **kwargs) + except: + print("Something went wrong, have you filled all the functions and run the cells?") button.on_click(_inner_check) display(button, output) - return wrapper \ No newline at end of file + return wrapper -- GitLab