mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
fixing multiline feedback
This commit is contained in:
@@ -89,27 +89,30 @@ function QuizQuestionPreview({ question }: { question: LocalQuizQuestion }) {
|
|||||||
<div>Feedback</div>
|
<div>Feedback</div>
|
||||||
<div className="mx-4 space-y-1">
|
<div className="mx-4 space-y-1">
|
||||||
{question.correctComments && (
|
{question.correctComments && (
|
||||||
<div className="border-l-2 border-green-700 pl-2 py-1">
|
<div className="border-l-2 border-green-700 pl-2 py-1 flex">
|
||||||
<span className="text-green-500">+ </span>
|
<span className="text-green-500">+ </span>
|
||||||
<span className="text-slate-300">
|
<MarkdownDisplay
|
||||||
{question.correctComments}
|
markdown={question.correctComments}
|
||||||
</span>
|
className="ms-4 mb-2"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{question.incorrectComments && (
|
{question.incorrectComments && (
|
||||||
<div className="border-l-2 border-red-700 pl-2 py-1">
|
<div className="border-l-2 border-red-700 pl-2 py-1 flex">
|
||||||
<span className="text-red-500">- </span>
|
<span className="text-red-500">- </span>
|
||||||
<span className="text-slate-300">
|
<MarkdownDisplay
|
||||||
{question.incorrectComments}
|
markdown={question.incorrectComments}
|
||||||
</span>
|
className="ms-4 mb-2"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{question.neutralComments && (
|
{question.neutralComments && (
|
||||||
<div className="border-l-2 border-blue-800 pl-2 py-1">
|
<div className="border-l-2 border-blue-800 pl-2 py-1 flex">
|
||||||
<span className="text-blue-500">... </span>
|
<span className="text-blue-500">... </span>
|
||||||
<span className="text-slate-300">
|
<MarkdownDisplay
|
||||||
{question.neutralComments}
|
markdown={question.neutralComments}
|
||||||
</span>
|
className="ms-4 mb-2"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -319,5 +319,6 @@ essay
|
|||||||
expect(firstQuestion.questionType).toBe(QuestionType.ESSAY);
|
expect(firstQuestion.questionType).toBe(QuestionType.ESSAY);
|
||||||
expect(firstQuestion.text).not.toContain("this is general feedback");
|
expect(firstQuestion.text).not.toContain("this is general feedback");
|
||||||
expect(firstQuestion.neutralComments).toBe("this is general feedback");
|
expect(firstQuestion.neutralComments).toBe("this is general feedback");
|
||||||
|
expect(firstQuestion.neutralComments).not.toContain("...");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -70,12 +70,15 @@ export const quizFeedbackMarkdownUtils = {
|
|||||||
.replace(feedbackIndicators[currentFeedbackType], "")
|
.replace(feedbackIndicators[currentFeedbackType], "")
|
||||||
.trim();
|
.trim();
|
||||||
comments[currentFeedbackType].push(lineWithoutIndicator);
|
comments[currentFeedbackType].push(lineWithoutIndicator);
|
||||||
|
|
||||||
} else if (lineFeedbackType !== "none") {
|
} else if (lineFeedbackType !== "none") {
|
||||||
|
|
||||||
const lineWithoutIndicator = line
|
const lineWithoutIndicator = line
|
||||||
.replace(feedbackIndicators[lineFeedbackType], "")
|
.replace(feedbackIndicators[lineFeedbackType], "")
|
||||||
.trim();
|
.trim();
|
||||||
currentFeedbackType = lineFeedbackType;
|
currentFeedbackType = lineFeedbackType;
|
||||||
comments[lineFeedbackType].push(lineWithoutIndicator);
|
comments[lineFeedbackType].push(lineWithoutIndicator);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
otherLines.push(line);
|
otherLines.push(line);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user