Create capstone_view.py
Browse files- components/capstone_view.py +73 -0
components/capstone_view.py
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Capstone view component for SkillSync
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
import gradio as gr
|
| 6 |
+
from datetime import datetime
|
| 7 |
+
|
| 8 |
+
def create_capstone_view(course_data, progress_manager):
|
| 9 |
+
"""Create the capstone project view"""
|
| 10 |
+
|
| 11 |
+
capstone = course_data['capstone']
|
| 12 |
+
|
| 13 |
+
gr.Markdown(f"## {capstone['title']}")
|
| 14 |
+
gr.Markdown(f"**Estimated Time:** {capstone['time_estimate']}")
|
| 15 |
+
gr.Markdown(capstone['description'])
|
| 16 |
+
|
| 17 |
+
with gr.Accordion("π Requirements", open=True):
|
| 18 |
+
for i, req in enumerate(capstone['requirements']):
|
| 19 |
+
gr.Markdown(f"{i+1}. {req}")
|
| 20 |
+
|
| 21 |
+
with gr.Accordion("π¦ Deliverables", open=True):
|
| 22 |
+
for item in capstone['deliverables']:
|
| 23 |
+
gr.Markdown(f"- {item}")
|
| 24 |
+
|
| 25 |
+
gr.Markdown("### π Submit Your Project")
|
| 26 |
+
|
| 27 |
+
with gr.Row():
|
| 28 |
+
with gr.Column():
|
| 29 |
+
project_title = gr.Textbox(
|
| 30 |
+
label="Project Title",
|
| 31 |
+
placeholder="Enter your project title"
|
| 32 |
+
)
|
| 33 |
+
|
| 34 |
+
project_description = gr.Textbox(
|
| 35 |
+
label="Project Description",
|
| 36 |
+
lines=5,
|
| 37 |
+
placeholder="Describe your project, approach, and key features"
|
| 38 |
+
)
|
| 39 |
+
|
| 40 |
+
project_url = gr.Textbox(
|
| 41 |
+
label="Demo URL (Optional)",
|
| 42 |
+
placeholder="https://your-demo-url.com"
|
| 43 |
+
)
|
| 44 |
+
|
| 45 |
+
project_file = gr.File(
|
| 46 |
+
label="Upload Project Files",
|
| 47 |
+
file_types=[".zip", ".pdf", ".ipynb"]
|
| 48 |
+
)
|
| 49 |
+
|
| 50 |
+
submit_btn = gr.Button("Submit Project", variant="primary")
|
| 51 |
+
submission_status = gr.Markdown()
|
| 52 |
+
|
| 53 |
+
def submit_project(title, desc, url, file):
|
| 54 |
+
success, message = progress_manager.submit_capstone(title, desc, url, file)
|
| 55 |
+
|
| 56 |
+
if success:
|
| 57 |
+
return f"""
|
| 58 |
+
β
**Project Submitted Successfully!**
|
| 59 |
+
|
| 60 |
+
**Title:** {title}
|
| 61 |
+
|
| 62 |
+
**Submitted at:** {progress_manager.progress['capstone_details']['submitted_at']}
|
| 63 |
+
|
| 64 |
+
Your project will be reviewed within 5-7 business days. You will receive feedback via email.
|
| 65 |
+
"""
|
| 66 |
+
else:
|
| 67 |
+
return f"β {message}"
|
| 68 |
+
|
| 69 |
+
submit_btn.click(
|
| 70 |
+
fn=submit_project,
|
| 71 |
+
inputs=[project_title, project_description, project_url, project_file],
|
| 72 |
+
outputs=[submission_status]
|
| 73 |
+
)
|