File size: 4,089 Bytes
ce5b5d6
bdeb397
473130e
8ff790f
af15398
473130e
 
 
 
 
 
 
 
 
 
 
af15398
 
473130e
dd6ab30
 
473130e
dd6ab30
 
 
 
473130e
 
 
 
 
 
 
c93e57e
20f40f0
dd6ab30
 
 
 
473130e
 
 
 
 
 
c93e57e
20f40f0
dd6ab30
 
 
473130e
 
 
 
 
 
 
c93e57e
20f40f0
dd6ab30
 
473130e
dd6ab30
b0c71de
473130e
b0c71de
dd6ab30
 
b0c71de
 
dd6ab30
 
 
b0c71de
 
b732d7e
dd6ab30
 
b0c71de
 
b732d7e
473130e
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
MAIN_PROMPT = """
### **Module 4: Proportional Thinking with Percentages**  
You will explore a real-world problem using different representations.  

🚀 **Here’s the problem:**  
Orrin and Damen invested in an ice cream shop.  
Orrin contributed **$1,500**, which is **60%** of the total investment.  
💡 **How much do they invest together?**  

You can solve this using different methods:  
- **Bar Model**  
- **Double Number Line**  
- **Equation-Based Approach**  

**Pick the method that you feel most comfortable with and tell me how you would apply it.**  
Once you explain your approach, I’ll provide feedback and guidance if needed.  

🚀 **Which method would you like to use first?**  
(Type **"Bar Model"**, **"Double Number Line"**, or **"Equation"** to continue.)
"""

# ✅ Function to Handle Teacher’s Method Selection
def get_prompt_for_method(method):
    if method.lower() == "bar model":
        return """
### **Bar Model Approach**  
Great choice! The Bar Model is a helpful way to **visualize** proportions and percentages.  

📌 **How would you apply the Bar Model to this problem?**  
- How would you represent the total investment in the bar model?  
- How would you use it to find the unknown amount?  

✏️ **Go ahead and describe your approach.** I’d love to hear your reasoning first!
"""

    elif method.lower() == "double number line":
        return """
### **Double Number Line Approach**  
Great choice! The Double Number Line helps align percentage values with real-world quantities.  

📌 **How would you set up a Double Number Line for this problem?**  
- What values would you place on each line?  
- How would you determine the total investment using this method?  

✏️ **Explain how you would use this approach!** I’d love to hear your reasoning first.
"""

    elif method.lower() == "equation":
        return """
### **Equation-Based Approach**  
Great choice! Setting up an equation is a powerful way to solve proportional problems.  

📌 **How would you write an equation for this problem?**  
- What proportion or equation would represent the situation?  
- How would you solve for the total investment?  

✏️ **Explain how you would approach it!** I’d love to hear your reasoning first.
"""

    return "I didn’t understand your choice. Please type 'Bar Model,' 'Double Number Line,' or 'Equation' to proceed."

# ✅ Function to Ensure Teachers Explain Before AI Provides Guidance
def get_feedback_for_method(method, teacher_response):
    if not teacher_response.strip():
        return "🛑 **Please explain your thought process first before receiving guidance!** What’s your plan for solving the problem?"

    if method.lower() == "bar model":
        if "divide" in teacher_response.lower() and "60%" in teacher_response.lower():
            return "✅ Great start! You recognized that the bar should be divided into parts representing percentages. Now, can you calculate how much each part represents?"
        return "🔹 It looks like you might need some help. Try dividing the bar into 10 equal parts, with 6 parts representing Orrin’s 60%. How much does one part represent?"

    elif method.lower() == "double number line":
        if "label" in teacher_response.lower() and "percentages" in teacher_response.lower():
            return "✅ Nice work! You’ve set up the number line correctly. Can you now align the percentage values with the corresponding dollar amounts?"
        return "🔹 No worries! Try labeling your number line with 0%, 60%, and 100% on one side and the corresponding dollar amounts on the other. How do the values align?"
    
    elif method.lower() == "equation":
        if "60/100" in teacher_response.lower() and "$1500/x" in teacher_response.lower():
            return "✅ You're on the right track! Now, how can you solve for x in your equation?"
        return "🔹 Try writing the proportion as (60/100) = (1500/x). What steps would you take to solve for x?"
    
    return "Interesting approach! Could you clarify your reasoning a bit more?"