Merge branch 'develop' of bitbucket.org:ecropdev/ielts-ui into develop

This commit is contained in:
Tiago Ribeiro
2024-01-15 20:19:21 +00:00
3 changed files with 20 additions and 4 deletions

View File

@@ -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(
<TestReport
title={title}
@@ -314,6 +317,8 @@ async function post(req: NextApiRequest, res: NextApiResponse) {
renderDetails={details}
logo={"public/logo_title.png"}
qrcode={qrcode}
summaryPNG={overallPNG}
summaryScore={`${(overallResult * 100).toFixed(0)}%`}
/>
);