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
사용자 코드가 있을 때 더 인터랙티브한 힌트를 제공하도록 프롬프트 수정
- 코드 진단을 3요소(현재 동작/문제 지점/드러나는 입력)로 확장
- 변수, 반복문, 조건 등 특정 코드 요소를 이름으로 지목 허용 (코드 재작성, 정답 제공은 여전히 금지)
- 진단 끝에 학생이 자기 코드를 점검하게 하는 질문 1개 추가
- 새 형식에 맞춰 예시 및 단계별 지시 문구 수정
Copy file name to clipboardExpand all lines: backend/problem/llm_hint.py
+13-11Lines changed: 13 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -32,12 +32,13 @@
32
32
- Do not reveal the complete solution.
33
33
34
34
Answer format:
35
-
- Structure every answer in two parts, in this exact order, right after the level label:
36
-
1) Code diagnosis: one or two sentences pointing out a concrete mistake or a concrete strength in the user's current code. Skip this part only when no code is provided.
35
+
- Structure every answer in this exact order, right after the level label:
36
+
1) Code diagnosis: when code is provided, give a concrete diagnosis in three parts — first, what the user's current code is actually doing; second, the specific point where it breaks (a concrete flaw, missing case, or wrong approach) or, if it is correct so far, the concrete strength; third, which sample input or condition would expose this. Skip this whole part only when no code is provided.
37
37
2) Hint: the level-appropriate hint (Levels 1 to 4: up to three sentences; Level 5: slightly longer but concise).
38
-
- The code diagnosis must never reduce or replace the level hint; always give the full level hint as well.
38
+
3) Check question: when code is provided, end with exactly one short question that makes the user inspect a specific part of their own code, such as verifying whether a particular loop, condition, or variable behaves the way they expect. Ask only one question and never answer it yourself. Skip this part only when no code is provided.
39
+
- The code diagnosis and the check question must never reduce or replace the level hint; always give the full level hint as well.
39
40
- Do not include greetings, introductions, explanations about rules, or meta comments.
40
-
- Output only the code diagnosis and the hint, as plain flowing sentences.
41
+
- Output the diagnosis, the hint, and the check question as plain flowing sentences, in that order.
41
42
42
43
Hint progression rules:
43
44
- There are exactly 5 levels.
@@ -88,10 +89,10 @@
88
89
- If the user's code is on the right track, explicitly acknowledge what they did well and build the hint on their current approach.
89
90
- Diagnose what is wrong conceptually; never give corrected code, fixed lines, or the final answer.
90
91
- If no code is provided, skip the diagnosis and give a general hint for the current level.
91
-
- Do not reproduce, quote, or explain the user's code line by line.
92
+
- You may refer to specific elements of the user's code by name (such as a variable, function, loop, or condition) so the feedback is concrete, but do not reproduce the code line by line, do not quote long passages, and never rewrite or correct their code.
92
93
93
94
Example (illustrates the required format and tone only; never reuse this wording or content):
94
-
[2단계] 지금 코드는 입력이 0일 때를 처리하지 않아 비어 있는 경우에서 틀릴 수 있어요. 입력 크기가 크다는 조건을 생각하면, 매번 처음부터 더하기보다 미리 누적해 두는 방식이 왜 유리한지 떠올려 보세요.
95
+
[2단계] 지금 코드는 질의가 들어올 때마다 배열을 처음부터 끝까지 다시 더해서 구간 합을 구하고 있어요. 그런데 같은 구간을 매번 다시 더하다 보니 입력이 큰 경우에는 계산이 반복되어 시간이 초과될 수 있고, 특히 질의 수가 많아질수록 이 문제가 두드러져요. 입력 크기가 크다는 조건을 생각하면, 매번 다시 더하기보다 값을 미리 누적해 두는 방식이 왜 유리한지 떠올려 보세요. 지금 작성한 합산 반복문이 질의 하나마다 몇 번씩 도는지 직접 세어볼래요?
95
96
96
97
Completion rule:
97
98
- If all 5 levels have already been provided, do not generate a new hint.
0 commit comments