You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -85,7 +85,54 @@ public Map<String, Object> executeMath(Long logSolveId, int grade) {
85
85
86
86
privateStringbuildPromptByGrade(intgrade) {
87
87
returnString.format("""
88
-
Read the following math problem image accurately using OCR, and according to the ‘Our Kid Math Explanation Helper’ app’s parent explanation guide, output only a pure JSON object conforming to the JSON schema below. The math explanation and instructional method should be at a %dth grade elementary school level, including very detailed explanations in 4–6 steps. Please respond only in Korean.
88
+
Read the following math problem image accurately using OCR, and according to the ‘Our Kid Math Explanation Helper’ app’s parent explanation guide, output only a pure JSON object conforming to the JSON schema below. The math explanation and instructional method should be at a %dth grade elementary school level, including very detailed explanations in **2 to 10 steps** steps.
89
+
🟨 Important Instructions:
90
+
91
+
- First, determine the **type of problem**:
92
+
- If the image contains **only mathematical expressions** (e.g., 30 + 5 × 9 ÷ 3 - 10), treat it as a **calculation problem** and compute the correct numeric answers.
93
+
- If the image contains **pictures, objects, or figures** (e.g., chairs, people, arrows, items), treat it as a **visual reasoning problem** and deduce the answer based on the visible content.
94
+
95
+
- ❗ When counting people or objects in the image:
96
+
- **Count exactly what is shown in the image.** Do NOT guess, assume, or infer based on context.
97
+
- ⚠️ Do NOT skip partially visible people. All visible individuals must be counted, even if cropped or obscured.
98
+
- Count only what is clearly visible — not implied or referenced.
99
+
- Do not assume anyone is walking unless clearly depicted.
100
+
101
+
✅ Especially when counting **children sitting on chairs**, count **all visible individuals precisely**.
102
+
✅ For example, if 4 children are sitting on chairs, your answer **must be `"4"`**, not `"3"` or an estimate.
103
+
✅ Never guess or round. This count must be exact.
104
+
✅ ⚠️ Incorrectly counting seated people will result in the entire problem being scored as **zero**.
105
+
106
+
- ❗ When gender is involved:
107
+
- Accurately distinguish **boys and girls** based on visual indicators such as:
108
+
- Text labels (e.g., "남", "여")
109
+
- Hairstyles, uniforms, or clothing
110
+
- Other clearly visible clues
111
+
- Never assume gender based on seating or placement.
112
+
- When comparing genders, count both groups carefully and calculate the difference using subtraction.
113
+
114
+
- For **calculation problems** with multiple sub-questions (e.g., (1), (2), (3)...), solve each one **individually and carefully**.
115
+
- Use the correct order of operations (PEMDAS): Parentheses → Multiplication/Division → Addition/Subtraction.
116
+
117
+
- Be careful with **mathematical symbols**:
118
+
- `'÷'` means division.
119
+
- `'×'` means multiplication.
120
+
- `'x'` may represent a variable or label — do NOT interpret as multiplication unless clearly shown.
121
+
- `'–'` (long dash) is NOT a minus sign.
122
+
- ⚠️ Watch for OCR mistakes such as `÷` misread as `-`, `×` as `x`, `1` as `l`, etc.
123
+
124
+
- The `"answer"` field must contain only the final numeric results, **in order and comma-separated** (e.g., `"4, 2, 6, 2, 2"`). \s
125
+
❌ Do NOT include explanations, units, or comments in this field.
126
+
127
+
- All reasoning and explanation must go into `"explanation_steps"` — never include explanations in the `"answer"` field.
128
+
129
+
- Summarize the image as one whole problem using `"problem_title"` and `"problem_text"`.
130
+
131
+
- Combine the core ideas of all sub-questions into `"core_concept"` and `"parent_explanation"`.
132
+
133
+
- ⚠️ Output exactly one valid **JSON object**, and respond **only in Korean**.
0 commit comments