Skip to content

Commit 9468f9a

Browse files
committed
Fix a bug where the check registry is not correctly initialized
1 parent 2b53eb6 commit 9468f9a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/scwidgets/exercise/_widget_code_exercise.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ def __init__(
190190
)
191191

192192
name = kwargs.get("name", key)
193-
CheckableWidget.__init__(self, check_registry, name)
194193
if exercise_registry is not None:
195194
ExerciseWidget.__init__(self, exercise_registry, key)
196195
else:
@@ -227,7 +226,7 @@ def __init__(
227226

228227
self._cue_code = self._code
229228

230-
if self._check_registry is None or self._code is None:
229+
if check_registry is None or self._code is None:
231230
self._check_button = None
232231
else:
233232
self._cue_code = CheckCueBox(
@@ -521,6 +520,7 @@ def __init__(
521520
*args,
522521
**kwargs,
523522
)
523+
CheckableWidget.__init__(self, check_registry, name)
524524
# In this case there is no code to be written by the student, so the code
525525
# exercise should work out of the box. Since the cues for the parameters
526526
# are also disabled, we update at the beginning once.

0 commit comments

Comments
 (0)