epochs-demos commited on
Commit
ce2b44b
1 Parent(s): 39caec1

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -17,15 +17,14 @@ st.markdown("<h5 style='color: #707379; text-align: center;'>School of AI by 10
17
  st.markdown('')
18
 
19
 
20
- def check_solution(code, func_params):
21
  try:
22
- exec(code)
23
  globals_dict = {}
24
- exec(code, globals_dict)
25
- function_to_test = globals_dict.get(func_params.get('function_name'))
26
 
27
- if not callable(function_to_test):
28
- raise ValueError(f"{func_params.get('function_name')} is not a callable function.")
29
 
30
  # Run the tests and populate the results table
31
  expected_result_list = []
 
17
  st.markdown('')
18
 
19
 
20
+ def check_solution(instructor_code, student_code, function_name, test_cases):
21
  try:
 
22
  globals_dict = {}
23
+ exec(instructor_code, globals_dict)
24
+ instructor_function = globals_dict.get(function_name)
25
 
26
+ if not callable(instructor_function):
27
+ raise ValueError(f"{instructor_function} is not a callable function.")
28
 
29
  # Run the tests and populate the results table
30
  expected_result_list = []