@@ -42,7 +42,7 @@ class CodeExercise(VBox, CheckableWidget, ExerciseWidget):
4242 :param check_registry:
4343 a check registry that is used to register checks
4444
45- :param parameters :
45+ :param params :
4646 Input parameters for the :py:class:`ParameterPanel` class or an initialized
4747 :py:class:`ParameterPanel` object. Specifies the arguments in the parameter
4848 panel.
@@ -66,7 +66,7 @@ def __init__(
6666 check_registry : Optional [CheckRegistry ] = None ,
6767 exercise_registry : Optional [ExerciseRegistry ] = None ,
6868 exercise_key : Optional [str ] = None ,
69- parameters : Optional [
69+ params : Optional [
7070 Union [Dict [str , Union [Check .FunInParamT , Widget ]], ParameterPanel ]
7171 ] = None ,
7272 update_mode : str = "manual" ,
@@ -137,15 +137,15 @@ def __init__(
137137 self ._exercise_title_html .add_class ("exercise-title" )
138138
139139 # verify if input argument `parameter` is valid
140- if parameters is not None :
140+ if params is not None :
141141 allowed_parameter_types = [dict , ParameterPanel ]
142142 parameter_type_allowed = False
143143 for allowed_parameter_type in allowed_parameter_types :
144- if isinstance (parameters , allowed_parameter_type ):
144+ if isinstance (params , allowed_parameter_type ):
145145 parameter_type_allowed = True
146146 if not (parameter_type_allowed ):
147147 raise TypeError (
148- f"Got parameter { type (parameters )!r} but only "
148+ f"Got parameter { type (params )!r} but only "
149149 f"{ allowed_parameter_types } are allowed."
150150 )
151151
@@ -158,20 +158,20 @@ def __init__(
158158 f"WidgetCodeInput but got { type (code )!r} "
159159 )
160160
161- # check compability between code and parameters , can only be checked if
161+ # check compability between code and params , can only be checked if
162162 # update_func is not used because we cannot know how the code input is used
163- if update_func is None and code is not None and parameters is not None :
164- if isinstance (parameters , dict ):
163+ if update_func is None and code is not None and params is not None :
164+ if isinstance (params , dict ):
165165 compatibility_result = code .compatible_with_signature (
166- list (parameters .keys ())
166+ list (params .keys ())
167167 )
168- elif isinstance (parameters , ParameterPanel ):
168+ elif isinstance (params , ParameterPanel ):
169169 compatibility_result = code .compatible_with_signature (
170- list (parameters .params .keys ())
170+ list (params .params .keys ())
171171 )
172172 if compatibility_result != "" :
173173 raise ValueError (
174- "Code and parameters do no match: " + compatibility_result
174+ "code and params do no match: " + compatibility_result
175175 )
176176
177177 CheckableWidget .__init__ (self , check_registry , exercise_key )
@@ -181,10 +181,10 @@ def __init__(
181181 self ._output = CueOutput ()
182182
183183 self ._parameter_panel : Union [ParameterPanel , None ]
184- if isinstance (parameters , dict ):
185- self ._parameter_panel = ParameterPanel (** parameters )
186- elif isinstance (parameters , ParameterPanel ):
187- self ._parameter_panel = parameters
184+ if isinstance (params , dict ):
185+ self ._parameter_panel = ParameterPanel (** params )
186+ elif isinstance (params , ParameterPanel ):
187+ self ._parameter_panel = params
188188 else :
189189 self ._parameter_panel = None
190190
0 commit comments