Skip to content

Commit b6eec12

Browse files
committed
Update MultipleChoiceQuestionDisplayV2.tsx
1 parent d25b55a commit b6eec12

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

client/src/components/QuestionsDisplay/MultipleChoiceQuestionDisplay/MultipleChoiceQuestionDisplayV2.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ const MultipleChoiceQuestionDisplayV2: React.FC<PropsV2> = (props) => {
4848
// Prevent validation styling from showing immediately on question change
4949
// For teacher view (no handleOnSubmitAnswer), show validation when showAnswer is true
5050
// For student view, only show validation after they've submitted an answer
51-
// In teacher mode rhythm, hide validation when hideAnswerFeedback is true
5251
const shouldShowValidation = showAnswer && !hideAnswerFeedback && (handleOnSubmitAnswer === undefined || answer.length > 0);
5352

5453
const handleOnClickAnswer = (choice: string) => {
@@ -116,12 +115,10 @@ const MultipleChoiceQuestionDisplayV2: React.FC<PropsV2> = (props) => {
116115
<div key={choice.formattedText.text + i} className="mb-3">
117116
<Button
118117
variant="outlined"
119-
className={`w-100 text-start justify-content-start p-3 choice-button ${
120-
shouldShowValidation
121-
? (choice.isCorrect ? 'bg-success text-white' : 'bg-danger text-white')
122-
: (selected ? 'bg-primary text-white choice-button-selected' : 'bg-light text-dark')
123-
} ${shouldShowValidation && selected ? 'choice-button-validated-selected' : ''}`}
124-
disabled={disableButton || disabled || (showAnswer && hideAnswerFeedback)}
118+
className={`w-100 text-start justify-content-start p-3 choice-button ${buttonStateClass} ${
119+
shouldShowValidation && selected ? 'choice-button-validated-selected' : ''
120+
}`}
121+
disabled={disableButton || disabled || (showAnswer && hideAnswerFeedback)}
125122
onClick={() => !shouldShowValidation && !disabled && !(showAnswer && hideAnswerFeedback) && handleOnClickAnswer(choice.formattedText.text)}
126123
>
127124
<ProgressOverlay
@@ -192,7 +189,7 @@ const MultipleChoiceQuestionDisplayV2: React.FC<PropsV2> = (props) => {
192189

193190
{/* Global feedback - always reserve space */}
194191
<div className="d-flex flex-column">
195-
{question.formattedGlobalFeedback && showAnswer && !hideAnswerFeedback && (
192+
{question.formattedGlobalFeedback && showAnswer && !hideAnswerFeedback && (
196193
<div className="global-feedback">
197194
<div
198195
dangerouslySetInnerHTML={{

0 commit comments

Comments
 (0)