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
@@ -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>