Skip to content

Commit

Permalink
Disable run button if no update function and parameters are given (#115)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
agoscinski authored Jan 6, 2025
1 parent d11ef8a commit 9f49210
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/scwidgets/exercise/_widget_code_exercise.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9f49210

Please sign in to comment.