Spaces:
Sleeping
Sleeping
Update ui.py
Browse files
ui.py
CHANGED
@@ -77,14 +77,14 @@ custom_css = """
|
|
77 |
}
|
78 |
|
79 |
.btn-practice {
|
80 |
-
background:
|
81 |
color: var(--white) !important;
|
82 |
font-weight: bold !important;
|
83 |
border: none !important;
|
84 |
padding: 0.75rem 1.5rem !important;
|
85 |
border-radius: 50px !important;
|
86 |
cursor: pointer !important;
|
87 |
-
box-shadow: 0 4px 0 #
|
88 |
}
|
89 |
|
90 |
.btn-clear {
|
@@ -126,7 +126,7 @@ custom_css = """
|
|
126 |
}
|
127 |
|
128 |
.practice-info {
|
129 |
-
background: linear-gradient(135deg,
|
130 |
color: white;
|
131 |
padding: 1rem;
|
132 |
border-radius: 12px;
|
@@ -233,14 +233,10 @@ def submit_reading(audio):
|
|
233 |
# Store feedback for potential story generation
|
234 |
session["last_feedback"] = feedback
|
235 |
session["progress"] = 100
|
236 |
-
|
237 |
-
# Only increment practice count for valid reading attempts
|
238 |
-
if not feedback.startswith("β οΈ"):
|
239 |
-
session["practice_count"] += 1
|
240 |
|
241 |
# Show practice story section if feedback indicates areas for improvement
|
242 |
-
|
243 |
-
show_practice = (not feedback.startswith("β οΈ")) and ("PRACTICE THESE WORDS:" in feedback or "PRONUNCIATION PRACTICE:" in feedback)
|
244 |
|
245 |
return feedback, gr.update(visible=show_practice)
|
246 |
|
@@ -318,9 +314,8 @@ def launch_ui():
|
|
318 |
# Header
|
319 |
gr.HTML("""
|
320 |
<div class="header">
|
321 |
-
<h1 class="app-title">π¦ ReadRight</h1>
|
322 |
<p>AI-powered reading coach that adapts to help you learn!</p>
|
323 |
-
<p style="font-size:0.9rem; margin-top:0.5rem; opacity:0.8;">For students, parents, and educators</p>
|
324 |
</div>
|
325 |
""")
|
326 |
|
@@ -339,8 +334,8 @@ def launch_ui():
|
|
339 |
with gr.Row():
|
340 |
grade = gr.Dropdown(
|
341 |
label="π Grade Level",
|
342 |
-
choices=["Grade 1", "Grade 2", "Grade 3", "Grade 4", "Grade 5", "Grade 6"
|
343 |
-
value="Grade
|
344 |
)
|
345 |
|
346 |
with gr.Row():
|
@@ -401,7 +396,7 @@ def launch_ui():
|
|
401 |
# Step 3: Targeted Practice (appears when student needs more practice)
|
402 |
with gr.Column(elem_classes="card", visible=False) as practice_story_card:
|
403 |
gr.HTML("""
|
404 |
-
<div class="practice-info"
|
405 |
<h2>π― Targeted Practice Zone</h2>
|
406 |
<p>Your AI coach has created a special story to help you practice the words you're learning!</p>
|
407 |
</div>
|
|
|
77 |
}
|
78 |
|
79 |
.btn-practice {
|
80 |
+
background: #9333ea !important;
|
81 |
color: var(--white) !important;
|
82 |
font-weight: bold !important;
|
83 |
border: none !important;
|
84 |
padding: 0.75rem 1.5rem !important;
|
85 |
border-radius: 50px !important;
|
86 |
cursor: pointer !important;
|
87 |
+
box-shadow: 0 4px 0 #7c2d9c !important;
|
88 |
}
|
89 |
|
90 |
.btn-clear {
|
|
|
126 |
}
|
127 |
|
128 |
.practice-info {
|
129 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
130 |
color: white;
|
131 |
padding: 1rem;
|
132 |
border-radius: 12px;
|
|
|
233 |
# Store feedback for potential story generation
|
234 |
session["last_feedback"] = feedback
|
235 |
session["progress"] = 100
|
236 |
+
session["practice_count"] += 1
|
|
|
|
|
|
|
237 |
|
238 |
# Show practice story section if feedback indicates areas for improvement
|
239 |
+
show_practice = "PRACTICE THESE WORDS:" in feedback or "PRONUNCIATION PRACTICE:" in feedback
|
|
|
240 |
|
241 |
return feedback, gr.update(visible=show_practice)
|
242 |
|
|
|
314 |
# Header
|
315 |
gr.HTML("""
|
316 |
<div class="header">
|
317 |
+
<h1 class="app-title">π¦ ReadRight Agentic</h1>
|
318 |
<p>AI-powered reading coach that adapts to help you learn!</p>
|
|
|
319 |
</div>
|
320 |
""")
|
321 |
|
|
|
334 |
with gr.Row():
|
335 |
grade = gr.Dropdown(
|
336 |
label="π Grade Level",
|
337 |
+
choices=["Grade 1", "Grade 2", "Grade 3", "Grade 4", "Grade 5", "Grade 6"],
|
338 |
+
value="Grade 3"
|
339 |
)
|
340 |
|
341 |
with gr.Row():
|
|
|
396 |
# Step 3: Targeted Practice (appears when student needs more practice)
|
397 |
with gr.Column(elem_classes="card", visible=False) as practice_story_card:
|
398 |
gr.HTML("""
|
399 |
+
<div class="practice-info">
|
400 |
<h2>π― Targeted Practice Zone</h2>
|
401 |
<p>Your AI coach has created a special story to help you practice the words you're learning!</p>
|
402 |
</div>
|