Spaces:
Sleeping
Sleeping
epochs-demos
commited on
Commit
•
ce2b44b
1
Parent(s):
39caec1
Upload app.py with huggingface_hub
Browse files
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(
|
21 |
try:
|
22 |
-
exec(code)
|
23 |
globals_dict = {}
|
24 |
-
exec(
|
25 |
-
|
26 |
|
27 |
-
if not callable(
|
28 |
-
raise ValueError(f"{
|
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 = []
|