forked from hangshuo652/aurak
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user