File size: 4,783 Bytes
ce5b5d6
bdeb397
c04aee4
 
 
 
 
 
8ff790f
af15398
c04aee4
473130e
d2fc9be
a4d9997
c04aee4
dd6ab30
 
 
c04aee4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a4d9997
dd6ab30
d2fc9be
b732d7e
c04aee4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b732d7e
a4d9997
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
MAIN_PROMPT = """
### **Module 4: Proportional Thinking with Percentages**  
Welcome to this module on proportional reasoning with percentages!  

Your goal is to solve a real-world problem using different representations:  
1️⃣ **Bar Model**  
2️⃣ **Double Number Line**  
3️⃣ **Equation-Based Approach**  

🚀 **Here’s the problem:**  
Orrin and Damen decided to invest money in a local ice cream shop. Orrin invests $1,500, which is 60% of their total investment. How much do Orrin and Damen invest together?  

💡 **Before receiving guidance, choose a method and explain your reasoning.**  
🚀 **Which method would you like to use first?**  
(Type: 'Bar Model,' 'Double Number Line,' or 'Equation' to proceed.)
"""

def get_prompt_for_method(method):
    method = method.lower().strip()
    
    prompts = {
        "bar model": """
        ### **Bar Model Approach**  
        Great choice! The Bar Model is a useful way to visualize proportions and percentages.  

        📌 **Now, apply the Bar Model and explain your approach:**  
        - 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 first.** I will provide feedback after hearing your reasoning.
        """,
        
        "double number line": """
        ### **Double Number Line Approach**  
        Great choice! The Double Number Line helps align percentage values with real-world quantities.  

        📌 **Now, apply the Double Number Line and explain your approach:**  
        - How would you structure the number lines?  
        - How would you align percentages with dollar values?  

        ✏️ **Go ahead and describe your approach first.** I will provide feedback after hearing your reasoning.
        """,
        
        "equation": """
        ### **Equation-Based Approach**  
        Great choice! Setting up an equation is a powerful way to represent proportional relationships.  

        📌 **Now, apply the Equation method and explain your approach:**  
        - How would you write an equation to represent this problem?  
        - What steps would you take to solve for the unknown?  

        ✏️ **Go ahead and describe your approach first.** I will provide feedback after hearing your reasoning.
        """
    }
    
    return prompts.get(method, "I didn’t understand your choice. Please type 'Bar Model,' 'Double Number Line,' or 'Equation' to proceed.")

def get_feedback_for_method(method, teacher_response):
    teacher_response = teacher_response.lower().strip()  # Normalize input for better matching
    
    feedback_map = {
        "bar model": [
            ("divide", "60%", "Great start! You recognized that the bar should be divided into parts representing percentages. Now, can you calculate how much each part represents?"),
            ("10%", "Nice work! Each part represents 10% of the total. Now, how much does one part represent in dollars?"),
            ("250", "Correct! Each part is worth $250. Now, how can you use this to determine the total investment?"),
            ("", "You're close! Remember, the bar represents the total investment. Try dividing it into 10 equal parts, with 6 parts representing Orrin’s 60%. What would one part represent in percentage and dollars?")
        ],
        "double number line": [
            ("label", "percentages", "Nice work! You’ve set up the number line correctly. Can you now align the percentage values with the corresponding dollar amounts?"),
            ("10%", "Good thinking! Each section represents 10% of the total investment. Now, how much is 10% in dollars?"),
            ("250", "That's right! Each section is worth $250. Now, can you find the total investment?"),
            ("", "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?")
        ],
        "equation": [
            ("60/100", "1500/x", "You're on the right track! Now, how can you solve for x in your equation?"),
            ("cross multiply", "Yes! Using cross multiplication will help. What do you get when solving for x?"),
            ("2500", "Great! The total investment is $2,500. Would you like to reflect on how the equation helped in solving this?"),
            ("", "Try writing the proportion as (60/100) = (1500/x). What steps would you take to solve for x?")
        ]
    }

    for keywords in feedback_map.get(method.lower(), []):
        if all(word in teacher_response for word in keywords[:-1]):  
            return keywords[-1]  # Return corresponding feedback
    
    return "Interesting approach! Could you clarify your reasoning a bit more?"