From 647807a07c075eabca2f9b434a81d054b336ad2b Mon Sep 17 00:00:00 2001 From: Joao Ramos Date: Mon, 8 Jan 2024 19:27:05 +0000 Subject: [PATCH] Separated suggestion from evaluation --- src/exams/pdf/index.tsx | 8 +++++--- src/interfaces/module.scores.ts | 3 ++- src/pages/api/stats/[id]/export.tsx | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/exams/pdf/index.tsx b/src/exams/pdf/index.tsx index ee7e80d7..846364b1 100644 --- a/src/exams/pdf/index.tsx +++ b/src/exams/pdf/index.tsx @@ -131,13 +131,15 @@ const PDFReport = ({ }} > {testDetails - .filter(({ feedback }) => feedback) - .map(({ module, feedback }) => ( + .filter(({ suggestions, evaluation }) => suggestions || evaluation) + .map(({ module, suggestions, evaluation }) => ( {module} - {feedback} + {evaluation} + {suggestions} + ))} diff --git a/src/interfaces/module.scores.ts b/src/interfaces/module.scores.ts index 53ee07fe..cc109420 100644 --- a/src/interfaces/module.scores.ts +++ b/src/interfaces/module.scores.ts @@ -5,6 +5,7 @@ export interface ModuleScore { total: number; code: Module; module: Module | 'Overall'; - feedback?: string, png?: string, + evaluation?: string, + suggestions?: string, } \ No newline at end of file diff --git a/src/pages/api/stats/[id]/export.tsx b/src/pages/api/stats/[id]/export.tsx index fd4556a2..0b08696f 100644 --- a/src/pages/api/stats/[id]/export.tsx +++ b/src/pages/api/stats/[id]/export.tsx @@ -280,7 +280,8 @@ async function post(req: NextApiRequest, res: NextApiResponse) { if (feedback) { return { ...result, - feedback: feedback?.evaluation + " " + feedback?.suggestions, + evaluation: feedback?.evaluation, + suggestions: feedback?.suggestions, }; }