Skip to content

Commit 9f49210

Browse files
authored
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.
1 parent d11ef8a commit 9f49210

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/scwidgets/exercise/_widget_code_exercise.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,7 @@ def __init__(
247247
)
248248

249249
self._cue_parameters_panel = self._parameters_panel
250-
if (
251-
self._parameters_panel is None
252-
and self._update_func is None
253-
and self._code is None
254-
):
250+
if self._parameters_panel is None and self._update_func is None:
255251
self._update_button = None
256252
self._cue_parameters_panel = None
257253
else:

0 commit comments

Comments
 (0)