Skip to content

Commit

Permalink
feat: add link for questions on review (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
PupoSDC authored Apr 23, 2024
1 parent 0f7e78d commit 179cf75
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { forwardRef } from "react";
import { default as CheckIcon } from "@mui/icons-material/Check";
import { default as CrossIcon } from "@mui/icons-material/Close";
import { Box, Sheet, Stack, Typography } from "@mui/joy";
import { Box, Link, Sheet, Stack } from "@mui/joy";
import { MarkdownFromServer } from "@cf/next/question-bank";
import type { SheetProps } from "@mui/joy";

Expand All @@ -10,6 +10,7 @@ export type TestQuestionResultProps = {
correct?: boolean;
question?: string;
questionTemplateId?: string;
questionHref?: string;
correctOption?: string;
selectedOption?: string;
learningObjectives?: string[];
Expand All @@ -24,6 +25,7 @@ export const TestQuestionResult = forwardRef<
title,
correct,
question,
questionHref,
correctOption,
selectedOption,
questionTemplateId,
Expand All @@ -45,9 +47,9 @@ export const TestQuestionResult = forwardRef<
...props.sx,
}}
>
<Typography level="body-sm" fontWeight={900}>
<Link level="body-sm" fontWeight={900} href={questionHref}>
{questionTemplateId}
</Typography>
</Link>
<MarkdownFromServer compressed sx={{ fontSize: "sm" }}>
{question ?? ""}
</MarkdownFromServer>
Expand Down
1 change: 1 addition & 0 deletions libs/next/tests/src/containers/test-review/test-review.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export const TestReview = container<Props>(
<TestQuestionResult
key={question.questionId}
questionTemplateId={question.templateId}
questionHref={`/modules/${test.questionBank}/questions/${question.templateId}`}
sx={{ my: 1 }}
title={`${i + 1}/${arr.length}`}
question={question.question}
Expand Down

0 comments on commit 179cf75

Please sign in to comment.