fix: option display + partial credit grading

- Option display: use slice(1) instead of regex to strip letter prefix
- Grader prompts: add explicit partial credit guidance (5-7 for partial, 0-2 only for off-target)
This commit is contained in:
Developer
2026-05-21 13:13:21 +08:00
parent 7b1103903f
commit 7fd2a4cda2
3 changed files with 9 additions and 3 deletions
@@ -107,6 +107,8 @@ export const graderNode = async (
2. 完整性:他们是否遗漏了任何重要内容?
3. 深度:解释是否充分?
**重要:评分请给部分分数。不完全正确不等于0分——回答方向对、意思接近但不够完整时请给5-7分。完全不沾边才给0-2分。**
请提供:
1. 0 到 10 的评分。
2. 建设性的反馈。
@@ -134,6 +136,8 @@ export const graderNode = async (
2. 網羅性:重要な内容が欠落していませんか?
3. 深さ:説明は十分ですか?
**重要:点数は部分点をつけてください。完全に正解でなくても0点ではありません——方向性が合っていて、部分的に正しい場合は5〜7点を与えてください。全く見当違いの場合のみ0〜2点としてください。**
以下を提供してください:
1. 0 から 10 までのスコア。
2. 建設的なフィードバック。
@@ -161,6 +165,8 @@ Evaluate:
2. Completeness: Did they miss anything important?
3. Depth: Is the explanation sufficient?
**Important: Give partial credit. Incomplete answers are not 0 — if the direction is right and partially correct, give 5-7. Only give 0-2 for completely off-target answers.**
Provide:
1. A score from 0 to 10.
2. Constructive feedback.
+2 -2
View File
@@ -610,7 +610,7 @@ export const AssessmentView: React.FC<AssessmentViewProps> = ({
{currentQuestion.options.map((opt: string, i: number) => {
const letter = optionLabels[i];
const isSelected = selectedChoice === letter;
const displayText = opt.replace(/^[A-D][.)、]\s*/, '');
const displayText = opt.slice(1);
return (
<button
key={letter}
@@ -857,7 +857,7 @@ export const AssessmentView: React.FC<AssessmentViewProps> = ({
{q.options?.map((opt: string, oi: number) => {
const letter = String.fromCharCode(65 + oi);
const isAnswer = letter === q.correctAnswer;
const displayText = opt.replace(/^[A-D][.)、]\s*/, '');
const displayText = opt.slice(1);
return (
<span key={oi} className={cn(
"px-3 py-1 rounded-lg font-medium",
@@ -405,7 +405,7 @@ export default function QuestionBankDetailView() {
{item.options.map((opt, i) => {
const letter = String.fromCharCode(65 + i);
const isCorrect = item.correctAnswer === letter;
const displayText = opt.replace(/^[A-D][.)、]\s*/, '');
const displayText = opt.slice(1);
return (
<div key={i} className={`flex items-center gap-2 px-3 py-2 rounded-xl text-sm ${isCorrect ? 'bg-emerald-50 border border-emerald-200' : 'bg-slate-50'}`}>
<span className={`inline-flex items-center justify-center w-6 h-6 rounded-lg text-[10px] font-black shrink-0 ${isCorrect ? 'bg-emerald-500 text-white' : 'bg-slate-200 text-slate-500'}`}>{letter}</span>