Ashar086 commited on
Commit
7989b0a
·
verified ·
1 Parent(s): 91a56f3

Create pages/coding_challenges.py

Browse files
Files changed (1) hide show
  1. 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)