From 46b9fe50ef44596e5322fbf5ed15a279fea94d6e Mon Sep 17 00:00:00 2001 From: Joao Ramos Date: Mon, 15 Jan 2024 19:32:11 +0000 Subject: [PATCH 1/3] Added the missing radial progress --- src/exams/pdf/test.report.tsx | 16 ++++++++++++++-- src/pages/api/stats/[id]/export.tsx | 7 ++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/exams/pdf/test.report.tsx b/src/exams/pdf/test.report.tsx index acd14481..d6cbaade 100644 --- a/src/exams/pdf/test.report.tsx +++ b/src/exams/pdf/test.report.tsx @@ -25,6 +25,8 @@ interface Props { qrcode: string; renderDetails: React.ReactNode; title: string; + summaryPNG: string; + summaryScore: string; } const TestReport = ({ @@ -39,6 +41,8 @@ const TestReport = ({ logo, qrcode, renderDetails, + summaryPNG, + summaryScore, }: Props) => { const defaultTextStyle = [styles.textFont, { fontSize: 8 }]; const defaultSkillsTextStyle = [styles.textFont, { fontSize: 8 }]; @@ -104,8 +108,16 @@ const TestReport = ({ > Performance Summary - - {summary} + + + {summary} + + + + + {summaryScore} + + diff --git a/src/pages/api/stats/[id]/export.tsx b/src/pages/api/stats/[id]/export.tsx index a1c3bab5..b7a103db 100644 --- a/src/pages/api/stats/[id]/export.tsx +++ b/src/pages/api/stats/[id]/export.tsx @@ -263,12 +263,14 @@ async function post(req: NextApiRequest, res: NextApiResponse) { ); const overallResult = overallScore / overallTotal; + const overallPNG = getRadialProgressPNG("laranja", overallScore, overallTotal); + // generate the overall detail report const overallDetail = { module: "Overall", score: overallScore, total: overallTotal, - png: getRadialProgressPNG("laranja", overallScore, overallTotal), + png: overallPNG, } as ModuleScore; const testDetails = [overallDetail, ...finalResults]; @@ -301,6 +303,7 @@ async function post(req: NextApiRequest, res: NextApiResponse) { }; const { title, details } = getCustomData(); + const pdfStream = await ReactPDF.renderToStream( ); From 7572909b13821de30ac9fd3cf6692f8f71f3b086 Mon Sep 17 00:00:00 2001 From: Joao Ramos Date: Mon, 15 Jan 2024 19:33:31 +0000 Subject: [PATCH 2/3] Removed unnecessary margin ruining percentage centered --- src/exams/pdf/styles.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/exams/pdf/styles.ts b/src/exams/pdf/styles.ts index a8162499..0440c37f 100644 --- a/src/exams/pdf/styles.ts +++ b/src/exams/pdf/styles.ts @@ -55,7 +55,6 @@ export const styles = StyleSheet.create({ display: "flex", flexDirection: "column", alignItems: "center", - gap: 4, position: "relative", }, radialResultContainer: { From 294d319ab38c5cda73730ff21d043fa3f7c79baa Mon Sep 17 00:00:00 2001 From: Joao Ramos Date: Mon, 15 Jan 2024 19:47:53 +0000 Subject: [PATCH 3/3] Removed debuggers --- src/exams/pdf/test.report.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/exams/pdf/test.report.tsx b/src/exams/pdf/test.report.tsx index d6cbaade..5b72feaf 100644 --- a/src/exams/pdf/test.report.tsx +++ b/src/exams/pdf/test.report.tsx @@ -112,9 +112,9 @@ const TestReport = ({ {summary} - + - + {summaryScore}