Spaces:
Sleeping
Sleeping
Update prompts/main_prompt.py
Browse files- prompts/main_prompt.py +89 -165
prompts/main_prompt.py
CHANGED
@@ -1,165 +1,89 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
**
|
17 |
-
"
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
-
|
23 |
-
-
|
24 |
-
|
25 |
-
|
26 |
-
"
|
27 |
-
|
28 |
-
**
|
29 |
-
"
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
"
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
"
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
-
|
50 |
-
-
|
51 |
-
|
52 |
-
|
53 |
-
"
|
54 |
-
|
55 |
-
|
56 |
-
"
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
### **4. Graph**
|
92 |
-
**Initial Prompt:**
|
93 |
-
"Finally, let’s graph this problem! Plot:
|
94 |
-
- **Time (hours) on the x-axis**
|
95 |
-
- **Distance (miles) on the y-axis**
|
96 |
-
|
97 |
-
You already know two key points:
|
98 |
-
- **(0,0)** and **(2,90)**
|
99 |
-
|
100 |
-
What other points will you add?"
|
101 |
-
|
102 |
-
**Hints for When Stuck:**
|
103 |
-
- **Hint 1:** "Start by marking **(0,0) and (2,90)**. How can you use these to find **(1,45), (½,22.5), and (3,135)?**"
|
104 |
-
- **Hint 2:** "What does the **slope** of this line represent?"
|
105 |
-
|
106 |
-
**If Partially Correct:**
|
107 |
-
"Nice start! Can you check whether your line passes through **(0,0)**? Why is that important?"
|
108 |
-
|
109 |
-
**If Incorrect:**
|
110 |
-
"Let’s go back and check:
|
111 |
-
- **1 hour = 45 miles**
|
112 |
-
- **½ hour = 22.5 miles**
|
113 |
-
- **3 hours = 135 miles**
|
114 |
-
|
115 |
-
Try adjusting your graph to reflect this proportionality!"
|
116 |
-
|
117 |
-
**If Correct:**
|
118 |
-
"Fantastic! How does this graph reinforce the idea of a **constant rate and proportionality**?"
|
119 |
-
|
120 |
-
---
|
121 |
-
|
122 |
-
## **Reflection Questions**
|
123 |
-
- "How does each representation help us understand proportional relationships differently?"
|
124 |
-
- "Which representation do you prefer, and why?"
|
125 |
-
- "Can you think of a situation where one of these representations **wouldn’t** be the best choice?"
|
126 |
-
|
127 |
-
---
|
128 |
-
|
129 |
-
## **AI Summary Section**
|
130 |
-
📌 **Content Knowledge:**
|
131 |
-
"You explored solving a ratio problem using multiple representations, deepening your understanding of proportional relationships."
|
132 |
-
|
133 |
-
🎨 **Creativity-Directed Practices:**
|
134 |
-
"You engaged creatively by visualizing and explaining mathematical relationships from different perspectives."
|
135 |
-
|
136 |
-
📚 **Pedagogical Content Knowledge:**
|
137 |
-
"You reflected on how to select and connect different representations, aligning with **Common Core standards** such as:
|
138 |
-
- 'Use appropriate tools strategically'
|
139 |
-
- 'Look for and express regularity in repeated reasoning'."
|
140 |
-
|
141 |
-
🤔 **Which Common Core standards and creativity-directed practices do you feel were covered in this module?**
|
142 |
-
|
143 |
-
---
|
144 |
-
|
145 |
-
## **Problem-Posing Activity**
|
146 |
-
"Now, create a similar proportional reasoning problem for your students.
|
147 |
-
|
148 |
-
For example, change the context—perhaps a **runner covering a certain distance in a given time**.
|
149 |
-
|
150 |
-
Ensure that your problem can be solved using:
|
151 |
-
✅ **Bar models**
|
152 |
-
✅ **Double number lines**
|
153 |
-
✅ **Ratio tables**
|
154 |
-
✅ **Graphs**
|
155 |
-
|
156 |
-
Please explain when certain representations might be **more or less effective**.
|
157 |
-
The AI will evaluate your problem and provide feedback!"
|
158 |
-
|
159 |
-
---
|
160 |
-
|
161 |
-
## **Final Reflection**
|
162 |
-
- "How does designing and solving problems using multiple representations enhance students’ mathematical creativity?"
|
163 |
-
- "How would you guide students to explain their reasoning, even if they get the correct answer?"
|
164 |
-
|
165 |
-
---
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
# Step-by-step prompts
|
4 |
+
PROMPTS = [
|
5 |
+
"Which representations have you already used to show the relationship between time and distance?\n"
|
6 |
+
"- Bar Model\n"
|
7 |
+
"- Double Number Line\n"
|
8 |
+
"- Ratio Table\n"
|
9 |
+
"- Graph\n\n"
|
10 |
+
"If you haven’t used all of them, let’s go through each one step by step.",
|
11 |
+
|
12 |
+
"Have you created a **bar model** to represent Jessica’s travel?\n"
|
13 |
+
"- If not, try drawing a bar to represent **2 hours = 90 miles**.\n"
|
14 |
+
"- Can you divide it into equal segments to show **1 hour = 45 miles**?\n"
|
15 |
+
"- How would you extend the bar to **3 hours**?\n"
|
16 |
+
"- Can you split **1 hour** into halves to show **½ hour = 22.5 miles**?\n\n"
|
17 |
+
"✅ Does your bar model correctly show **½, 1, 2, and 3 hours**?",
|
18 |
+
|
19 |
+
"Have you created a **double number line** for time and distance?\n"
|
20 |
+
"- If not, try drawing two parallel lines:\n"
|
21 |
+
" - One for **time (hours)**\n"
|
22 |
+
" - One for **distance (miles)**\n"
|
23 |
+
"- Can you correctly place these points?\n"
|
24 |
+
" - **0 hours → 0 miles**\n"
|
25 |
+
" - **½ hour → 22.5 miles**\n"
|
26 |
+
" - **1 hour → 45 miles**\n"
|
27 |
+
" - **2 hours → 90 miles**\n"
|
28 |
+
" - **3 hours → 135 miles**\n"
|
29 |
+
"- Are the distances evenly spaced?\n\n"
|
30 |
+
"✅ Does your number line show **a proportional relationship**?",
|
31 |
+
|
32 |
+
"Have you created a **ratio table**?\n"
|
33 |
+
"- If not, try filling in this table:\n\n"
|
34 |
+
"| Time (hours) | Distance (miles) |\n"
|
35 |
+
"|-------------|-----------------|\n"
|
36 |
+
"| 0.5 | 22.5 |\n"
|
37 |
+
"| 1 | 45 |\n"
|
38 |
+
"| 2 | 90 |\n"
|
39 |
+
"| 3 | 135 |\n\n"
|
40 |
+
"- Can you find a pattern in the table?\n"
|
41 |
+
"- What would be the distance for **4 hours**?\n\n"
|
42 |
+
"✅ Does your table clearly show a **proportional pattern**?",
|
43 |
+
|
44 |
+
"Have you created a **graph** to represent this relationship?\n"
|
45 |
+
"- If not, try plotting these points:\n"
|
46 |
+
" - (0, 0)\n"
|
47 |
+
" - (0.5, 22.5)\n"
|
48 |
+
" - (1, 45)\n"
|
49 |
+
" - (2, 90)\n"
|
50 |
+
" - (3, 135)\n"
|
51 |
+
"- Can you draw a straight line through them?\n"
|
52 |
+
"- What does the slope of the line tell you about Jessica’s driving rate?\n\n"
|
53 |
+
"✅ Does your graph correctly show a **linear relationship**?",
|
54 |
+
|
55 |
+
"Final Reflection:\n"
|
56 |
+
"- Which representation helped you understand the relationship best? Why?\n"
|
57 |
+
"- How do these representations show the **same proportional relationship** in different ways?\n"
|
58 |
+
"- Can you apply this method to another real-world proportional relationship?"
|
59 |
+
]
|
60 |
+
|
61 |
+
# State tracking function
|
62 |
+
def guide_user(state):
|
63 |
+
"""Returns the next step based on user progress"""
|
64 |
+
state = int(state) + 1
|
65 |
+
if state >= len(PROMPTS):
|
66 |
+
return "✅ You have completed all steps! Great job!", str(state)
|
67 |
+
return PROMPTS[state], str(state)
|
68 |
+
|
69 |
+
# Gradio interface
|
70 |
+
with gr.Blocks() as app:
|
71 |
+
gr.Markdown("## Step-by-Step Guide: Representing Jessica's Driving Distance 🚗")
|
72 |
+
|
73 |
+
state = gr.State(value="0") # Tracks the user's progress
|
74 |
+
|
75 |
+
chatbot = gr.Chatbot(label="AI Guide", height=300)
|
76 |
+
user_input = gr.Textbox(label="Your Response (optional)", placeholder="Type here or click 'Next' to continue...")
|
77 |
+
|
78 |
+
next_btn = gr.Button("Next Step ➡️")
|
79 |
+
|
80 |
+
def update_chat(user_response, history, state):
|
81 |
+
"""Updates chat history and progresses to the next step"""
|
82 |
+
history.append(("You:", user_response if user_response else ""))
|
83 |
+
next_message, new_state = guide_user(state)
|
84 |
+
history.append(("AI:", next_message))
|
85 |
+
return history, new_state
|
86 |
+
|
87 |
+
next_btn.click(update_chat, [user_input, chatbot, state], [chatbot, state])
|
88 |
+
|
89 |
+
app.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|