From 9f49210ede1e0a7728541d0a59d56e42ce621590 Mon Sep 17 00:00:00 2001 From: Alexander Goscinski Date: Mon, 6 Jan 2025 07:34:37 +0100 Subject: [PATCH] Disable run button if no update function and parameters are given (#115) The run button was still displayed in this case but could only work when the code does not require any arguments. Now to enable the update button one needs to at least provide parameters (empty in case when no parameters are needed). This enables the teacher to create exercises that are only checkable. --- src/scwidgets/exercise/_widget_code_exercise.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/scwidgets/exercise/_widget_code_exercise.py b/src/scwidgets/exercise/_widget_code_exercise.py index c7b5383..cf3ce18 100644 --- a/src/scwidgets/exercise/_widget_code_exercise.py +++ b/src/scwidgets/exercise/_widget_code_exercise.py @@ -247,11 +247,7 @@ def __init__( ) self._cue_parameters_panel = self._parameters_panel - if ( - self._parameters_panel is None - and self._update_func is None - and self._code is None - ): + if self._parameters_panel is None and self._update_func is None: self._update_button = None self._cue_parameters_panel = None else: