Removed decimals from export pdf
This commit is contained in:
@@ -10,7 +10,7 @@ export const RadialResult = ({module, score, total, png}: ModuleScore) => (
|
|||||||
<Text style={[styles.textColor, styles.textBold, {fontSize: 10}]}>{module}</Text>
|
<Text style={[styles.textColor, styles.textBold, {fontSize: 10}]}>{module}</Text>
|
||||||
<Image src={png} style={styles.image64}></Image>
|
<Image src={png} style={styles.image64}></Image>
|
||||||
<View style={[styles.textColor, styles.radialResultContainer]}>
|
<View style={[styles.textColor, styles.radialResultContainer]}>
|
||||||
<Text style={styles.textBold}>{score.toFixed(2)}</Text>
|
<Text style={styles.textBold}>{Math.floor(score)}</Text>
|
||||||
<Text style={{fontSize: 8}}>out of {total}</Text>
|
<Text style={{fontSize: 8}}>out of {total}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -370,7 +370,7 @@ async function post(req: NextApiRequest, res: NextApiResponse) {
|
|||||||
studentsData={studentsData}
|
studentsData={studentsData}
|
||||||
showLevel={showLevel}
|
showLevel={showLevel}
|
||||||
summaryPNG={overallPNG}
|
summaryPNG={overallPNG}
|
||||||
summaryScore={`${(overallResult * 100).toFixed(0)}%`}
|
summaryScore={`${Math.floor(overallResult * 100)}%`}
|
||||||
groupScoreSummary={groupScoreSummary}
|
groupScoreSummary={groupScoreSummary}
|
||||||
passportId={demographicInformation?.passport_id || ""}
|
passportId={demographicInformation?.passport_id || ""}
|
||||||
/>,
|
/>,
|
||||||
|
|||||||
@@ -136,14 +136,14 @@ async function post(req: NextApiRequest, res: NextApiResponse) {
|
|||||||
const userId = stats[statIndex].user;
|
const userId = stats[statIndex].user;
|
||||||
|
|
||||||
|
|
||||||
if (hasPDF) {
|
// if (hasPDF) {
|
||||||
// if it does, return the pdf url
|
// // if it does, return the pdf url
|
||||||
const fileRef = ref(storage, hasPDF.pdf.path);
|
// const fileRef = ref(storage, hasPDF.pdf.path);
|
||||||
const url = await getDownloadURL(fileRef);
|
// const url = await getDownloadURL(fileRef);
|
||||||
|
|
||||||
res.status(200).end(url);
|
// res.status(200).end(url);
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// generate the pdf report
|
// generate the pdf report
|
||||||
@@ -286,7 +286,7 @@ async function post(req: NextApiRequest, res: NextApiResponse) {
|
|||||||
logo={"public/logo_title.png"}
|
logo={"public/logo_title.png"}
|
||||||
qrcode={qrcode}
|
qrcode={qrcode}
|
||||||
summaryPNG={overallPNG}
|
summaryPNG={overallPNG}
|
||||||
summaryScore={`${(overallResult * 100).toFixed(0)}%`}
|
summaryScore={`${Math.floor(overallResult * 100)}%`}
|
||||||
passportId={demographicInformation?.passport_id || ""}
|
passportId={demographicInformation?.passport_id || ""}
|
||||||
/>,
|
/>,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user