alibicer commited on
Commit
47a0e90
·
verified ·
1 Parent(s): 6f1dc80

Update prompts/main_prompt.py

Browse files
Files changed (1) hide show
  1. prompts/main_prompt.py +135 -132
prompts/main_prompt.py CHANGED
@@ -1,132 +1,135 @@
1
- import gradio as gr
2
-
3
- # Step-by-step prompts
4
- PROMPTS = [
5
- # Task Introduction
6
- "## Task: Representing Jessica’s Driving Distance 🚗\n"
7
- "Jessica is driving at a constant speed. She travels **90 miles in 2 hours**.\n\n"
8
- "### Your Goal:\n"
9
- "Represent the relationship between **time and distance** using different mathematical models:\n"
10
- "✅ Bar Model\n"
11
- "✅ Double Number Line\n"
12
- "✅ Ratio Table\n"
13
- "Graph\n\n"
14
- "Let’s go through each representation step by step!",
15
-
16
- # Step 1: Identifying Current Representation
17
- "Which representations have you already used to show the relationship between time and distance?\n"
18
- "- Bar Model\n"
19
- "- Double Number Line\n"
20
- "- Ratio Table\n"
21
- "- Graph\n\n"
22
- "If you haven’t used all of them, let’s go through each one step by step.",
23
-
24
- # Step 2: Bar Model
25
- "### Step 1: Bar Model Representation 📊\n"
26
- "Have you created a **bar model** to represent Jessica’s travel?\n\n"
27
- "**If not, follow these steps:**\n"
28
- "1️⃣ Draw a **long bar** to represent **2 hours of driving**, labeling it **90 miles**.\n"
29
- "2️⃣ Divide the bar into **two equal parts** to show **1 hour = 45 miles**.\n"
30
- "3️⃣ Extend the bar to **3 hours** by adding another **45-mile segment**.\n"
31
- "4️⃣ Divide **one 1-hour segment in half** to show **½ hour = 22.5 miles**.\n\n"
32
- "✅ Does your bar model correctly show **½, 1, 2, and 3 hours**?",
33
-
34
- # Step 3: Double Number Line
35
- "### Step 2: Double Number Line Representation 📏\n"
36
- "Have you created a **double number line** for time and distance?\n\n"
37
- "**If not, follow these steps:**\n"
38
- "1️⃣ Draw **two parallel number lines**:\n"
39
- " - The **top line** represents **time (hours)**.\n"
40
- " - The **bottom line** represents **distance (miles)**.\n"
41
- "2️⃣ Mark these key points:\n"
42
- " - **0 hours → 0 miles**\n"
43
- " - **½ hour → 22.5 miles**\n"
44
- " - **1 hour 45 miles**\n"
45
- " - **2 hours 90 miles**\n"
46
- " - **3 hours → 135 miles**\n"
47
- "3️⃣ Ensure the distances are evenly spaced.\n\n"
48
- "✅ Does your number line show a **proportional relationship**?",
49
-
50
- # Step 4: Ratio Table
51
- "### Step 3: Ratio Table Representation 📋\n"
52
- "Have you created a **ratio table**?\n\n"
53
- "**If not, follow these steps:**\n"
54
- "1️⃣ Fill in the table below:\n\n"
55
- "| Time (hours) | Distance (miles) |\n"
56
- "|-------------|-----------------|\n"
57
- "| 0.5 | 22.5 |\n"
58
- "| 1 | 45 |\n"
59
- "| 2 | 90 |\n"
60
- "| 3 | 135 |\n\n"
61
- "2️⃣ Look for patterns.\n"
62
- "3️⃣ What would be the distance for **4 hours**?\n\n"
63
- "✅ Does your table clearly show a **proportional pattern**?",
64
-
65
- # Step 5: Graph
66
- "### Step 4: Graph Representation 📈\n"
67
- "Have you created a **graph** to represent this relationship?\n\n"
68
- "**If not, follow these steps:**\n"
69
- "1️⃣ Draw a **coordinate plane**:\n"
70
- " - **x-axis time (hours)**\n"
71
- " - **y-axis → distance (miles)**\n"
72
- "2️⃣ Plot these points:\n"
73
- " - (0, 0)\n"
74
- " - (0.5, 22.5)\n"
75
- " - (1, 45)\n"
76
- " - (2, 90)\n"
77
- " - (3, 135)\n"
78
- "3️⃣ Draw a straight line through these points.\n"
79
- "4️⃣ What does the **slope of the line** tell you about Jessica’s driving rate?\n\n"
80
- "✅ Does your graph correctly show a **linear relationship**?",
81
-
82
- # Step 6: Final Reflection & Posing Questions
83
- "### Final Reflection 💭\n"
84
- "Great job! Now, take a moment to reflect:\n"
85
- "1️⃣ Which representation helped you understand the relationship best? Why?\n"
86
- "2️⃣ How do these representations show the **same proportional relationship** in different ways?\n"
87
- "3️⃣ Can you apply this method to another real-world proportional relationship?\n\n"
88
- "### New Challenge 🌟\n"
89
- "Imagine Jessica increases her speed by **10 miles per hour**. How would this affect the bar model, number line, ratio table, and graph?\n\n"
90
- "Try adjusting your models to reflect this change!",
91
-
92
- # Summary of Objectives & Common Core Standards
93
- "### Summary of Objectives 🎯\n"
94
- "- You explored **four ways** to represent proportional relationships: Bar Model, Double Number Line, Ratio Table, and Graph.\n"
95
- "- You understood how **time and distance** relate at a constant rate.\n"
96
- "- You analyzed how different models show the **same mathematical pattern**.\n\n"
97
- "### Common Core Math Standards 🏆\n"
98
- "- **6.RP.A.1** - Understand the concept of a ratio.\n"
99
- "- **6.RP.A.3a** - Use ratio reasoning to solve real-world problems.\n"
100
- "- **7.RP.A.2** - Recognize proportional relationships.\n\n"
101
- "✅ **Congratulations! You’ve completed this module.** 🚀"
102
- ]
103
-
104
- # State tracking function
105
- def guide_user(state):
106
- """Returns the next step based on user progress"""
107
- state = int(state) + 1
108
- if state >= len(PROMPTS):
109
- return "✅ You have completed all steps! Great job!", str(state)
110
- return PROMPTS[state], str(state)
111
-
112
- # Gradio interface
113
- with gr.Blocks() as app:
114
- gr.Markdown("## Step-by-Step Guide: Representing Jessica's Driving Distance 🚗")
115
-
116
- state = gr.State(value="0") # Tracks the user's progress
117
-
118
- chatbot = gr.Chatbot(label="AI Guide", height=300, type="messages") # Fixed deprecation warning
119
- user_input = gr.Textbox(label="Your Response (optional)", placeholder="Type here or click 'Next' to continue...")
120
-
121
- next_btn = gr.Button("Next Step ➡️")
122
-
123
- def update_chat(user_response, history, state):
124
- """Updates chat history and progresses to the next step"""
125
- history.append({"role": "user", "content": user_response if user_response else ""})
126
- next_message, new_state = guide_user(state)
127
- history.append({"role": "assistant", "content": next_message})
128
- return history, new_state
129
-
130
- next_btn.click(update_chat, [user_input, chatbot, state], [chatbot, state])
131
-
132
- app.launch()
 
 
 
 
1
+ # Module 2: Solving a Ratio Problem Using Multiple Representations
2
+
3
+ INTRO_PROMPT = """
4
+ 👋 Welcome to **Module 2** on **proportional reasoning and multiple representations**!
5
+ Today, you’ll explore a real-world problem using different mathematical tools.
6
+
7
+ 🚗 **Jessica drives 90 miles in 2 hours. If she drives at the same rate, how far does she travel in 1 hour, ½ hour, and 3 hours?**
8
+
9
+ You'll use:
10
+ **Bar models**
11
+ **Double number lines**
12
+ **Ratio tables**
13
+ **Graphs**
14
+
15
+ 🔍 **Remember:** The goal is not just to get the right answer, but to explore **why** the relationships work the way they do.
16
+ 💬 I’ll guide you step by step—feel free to ask for hints along the way!
17
+
18
+ Let's start with the **bar model**!
19
+ """
20
+
21
+ BAR_MODEL_PROMPT = """
22
+ 📊 **Step 1: Bar Model Representation**
23
+
24
+ Imagine a **bar** representing 90 miles—the distance Jessica travels in **2 hours**.
25
+ 🧩 How might you divide this bar to explore the distances for **1 hour, ½ hour, and 3 hours**?
26
+
27
+ 💭 *Please explain how each section of your bar relates to these time intervals!*
28
+
29
+ **💡 Need a hint?**
30
+ 1️⃣ *Think of the entire bar as representing **90 miles in 2 hours**. How would you divide it into two equal parts to find 1 hour?*
31
+ 2️⃣ *Now, extend or divide it further—what happens for **½ hour and 3 hours**?*
32
+
33
+ ✅ If correct: *Great! Can you explain why this model helps students visualize proportional relationships?*
34
+ If incorrect: *Try dividing the bar into two equal sections. What does each section represent?*
35
+ """
36
+
37
+ DOUBLE_NUMBER_LINE_PROMPT = """
38
+ 📏 **Step 2: Double Number Line Representation**
39
+
40
+ Now, let’s use a **double number line**!
41
+ 📌 **Create two parallel lines**: one for **time (hours)** and one for **distance (miles)**.
42
+
43
+ Start by marking:
44
+ **0 and 2 hours** on the top line
45
+ 🚗 **0 and 90 miles** on the bottom line
46
+
47
+ What comes next?
48
+
49
+ **💡 Need a hint?**
50
+ 1️⃣ Try labeling the time line **(0, 1, 2, 3)**. How does that help with placing distances below?
51
+ 2️⃣ Since **2 hours = 90 miles**, what does that tell you about **1 hour and ½ hour**?
52
+
53
+ If correct: *Nice work! How does this help students understand proportional relationships?*
54
+ If incorrect: *Check your spacing—does your number line keep a constant rate?*
55
+ """
56
+
57
+ RATIO_TABLE_PROMPT = """
58
+ 📋 **Step 3: Ratio Table Representation**
59
+
60
+ Next, let’s create a **ratio table**!
61
+ 📝 Make a table with:
62
+ 📌 **Column 1:** Time (hours)
63
+ 📌 **Column 2:** Distance (miles)
64
+
65
+ You already know **2 hours = 90 miles**.
66
+ 🤔 How would you complete the table for **½ hour, 1 hour, and 3 hours**?
67
+
68
+ **💡 Need a hint?**
69
+ 1️⃣ Since **2 hours = 90 miles**, how can you divide this to find **1 hour**?
70
+ 2️⃣ Once you know **1 hour = 45 miles**, can you calculate for **½ hour and 3 hours**?
71
+
72
+ If correct: *Well done! How might this help students compare proportional relationships?*
73
+ If incorrect: *Something’s a little off. Try using unit rate: 90 ÷ 2 = ?*
74
+ """
75
+
76
+ GRAPH_PROMPT = """
77
+ 📉 **Step 4: Graph Representation**
78
+
79
+ Now, let’s **graph this problem**!
80
+ 🛠 **Plot:**
81
+ 📌 **Time (hours) on the x-axis**
82
+ 📌 **Distance (miles) on the y-axis**
83
+
84
+ You already know two key points:
85
+ 🔹 **(0,0) and (2,90)**
86
+
87
+ 🤔 What other points will you add?
88
+
89
+ **💡 Need a hint?**
90
+ 1️⃣ Start by marking **(0,0) and (2,90)**.
91
+ 2️⃣ How can you use these to find **(1,45), (½,22.5), and (3,135)?**
92
+
93
+ If correct: *Fantastic! How does this graph reinforce the idea of constant rate and proportionality?*
94
+ If incorrect: *Does your line pass through (0,0)? Why is that important?*
95
+ """
96
+
97
+ REFLECTION_PROMPT = """
98
+ 🔄 **Reflection Time!**
99
+
100
+ Now that you've explored **multiple representations**, think about these questions:
101
+ 💡 How does each method highlight **proportional reasoning differently**?
102
+ 💬 Which representation do you prefer, and why?
103
+ 🚀 Can you think of a situation where one of these representations **wouldn’t** be the best choice?
104
+
105
+ Take a moment to reflect! 😊
106
+ """
107
+
108
+ SUMMARY_PROMPT = """
109
+ 🎯 **Summary of Module 2**
110
+
111
+ 📌 **In this module, you:**
112
+ Solved a proportional reasoning problem using **multiple representations**
113
+ Explored how different models highlight proportional relationships
114
+ Reflected on teaching strategies aligned with **Common Core practices**
115
+
116
+ To **wrap up**, try creating a **similar proportional reasoning problem**!
117
+ Example: A **runner covers a certain distance in a given time**.
118
+
119
+ 💡 Make sure your problem can be solved using:
120
+ ✅ **Bar models**
121
+ **Double number lines**
122
+ ✅ **Ratio tables**
123
+ **Graphs**
124
+
125
+ 📢 *The AI will evaluate your problem and provide feedback!*
126
+ """
127
+
128
+ FINAL_REFLECTION_PROMPT = """
129
+ 🚀 **Final Reflection**
130
+
131
+ - How does designing and solving problems using **multiple representations** enhance students’ mathematical creativity?
132
+ - How would you guide students to explain their **reasoning**, even if they get the correct answer?
133
+
134
+ 📌 Share your thoughts!
135
+ """