Spaces:
Running
Running
Create pages/coding_challenges.py
Browse files- pages/coding_challenges.py +19 -0
pages/coding_challenges.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from components.challenge_eval import evaluate_challenge
|
3 |
+
from components.feedback import get_ai_feedback
|
4 |
+
|
5 |
+
def show_coding_challenges():
|
6 |
+
st.title("Solve Coding Challenges")
|
7 |
+
|
8 |
+
problem = "Implement a linear regression model from scratch."
|
9 |
+
st.write(f"Problem: {problem}")
|
10 |
+
|
11 |
+
user_code = st.text_area("Write your solution here:", height=300)
|
12 |
+
|
13 |
+
if st.button("Submit Solution"):
|
14 |
+
result = evaluate_challenge(user_code)
|
15 |
+
st.write(result)
|
16 |
+
|
17 |
+
if st.button("Get AI Feedback"):
|
18 |
+
feedback = get_ai_feedback(user_code)
|
19 |
+
st.write(feedback)
|