@@ -21,7 +21,7 @@ def part_to_child(stu_part, sol_part, append_message, state, node_name=None):
2121 return state .to_child_state (stu_part , sol_part , append_message = append_message )
2222
2323
24- def check_part (name , part_msg , state = None , missing_msg = "" , expand_msg = "" ):
24+ def check_part (name , part_msg , state = None , missing_msg = "Are you sure it's defined? " , expand_msg = "" ):
2525 """Return child state with name part as its ast tree"""
2626 rep = Reporter .active_reporter
2727
@@ -36,7 +36,7 @@ def check_part(name, part_msg, state=None, missing_msg="", expand_msg=""):
3636 return part_to_child (stu_part , sol_part , append_message , state )
3737
3838def check_part_index (name , index , part_msg ,
39- missing_msg = "Have you defined a {part}. " ,
39+ missing_msg = "FMT:Are you sure it is defined? " ,
4040 state = None , expand_msg = "" ):
4141 """Return child state with indexed name part as its ast tree"""
4242
@@ -226,7 +226,7 @@ def set_context(*args, state=None, **kwargs):
226226 student_context = out_stu , solution_context = out_sol )
227227
228228
229- def check_args (name , missing_msg = 'FMT:check the argument `{part}`, ' , state = None ):
229+ def check_args (name , missing_msg = 'FMT:Are you sure it is defined? ' , state = None ):
230230 if name in ['*args' , '**kwargs' ]:
231231 return check_part (name , name , state = state , missing_msg = missing_msg )
232232 else :
@@ -304,8 +304,8 @@ def call(args,
304304 eval_sol , str_sol = run_call (args , state .solution_parts ['node' ], state .solution_process , get_func , ** kwargs )
305305
306306 if (test == 'error' ) ^ isinstance (str_sol , Exception ):
307- _msg = state .build_message ("FMT:Calling for arguments {args} resulted in an error (or not an error if testing for one)." ,
308- dict (args = args ))
307+ _msg = state .build_message ("FMT:Calling for arguments {args} resulted in an error (or not an error if testing for one). Error message: {str_sol} " ,
308+ dict (args = args , str_sol = str_sol ))
309309 raise ValueError (_msg )
310310
311311 if isinstance (eval_sol , ReprFail ):
@@ -366,7 +366,8 @@ def has_expr(incorrect_msg="FMT:Unexpected expression {test}: expected `{sol_eva
366366 context = state .solution_context )
367367
368368 if (test == 'error' ) ^ isinstance (str_sol , Exception ):
369- raise ValueError ("evaluating expression raised error in solution process" )
369+ raise ValueError ("evaluating expression raised error in solution process (or not an error if testing for one). "
370+ "Error message: %s" % str_sol )
370371 if isinstance (eval_sol , ReprFail ):
371372 raise ValueError ("Couldn't figure out the value of a default argument: " + eval_sol .info )
372373
0 commit comments