Updated the condition to close assignment: to be end date or when all students finish the assignment

This commit is contained in:
Tiago Ribeiro
2024-01-21 00:30:44 +00:00
parent 3de0357369
commit f6bb69f994
4 changed files with 45 additions and 51 deletions

View File

@@ -1,24 +1,17 @@
/* eslint-disable jsx-a11y/alt-text */
import React from "react";
import { View, Text, Image } from "@react-pdf/renderer";
import { styles } from "../styles";
import { ModuleScore } from "@/interfaces/module.scores";
import {View, Text, Image} from "@react-pdf/renderer";
import {styles} from "../styles";
import {ModuleScore} from "@/interfaces/module.scores";
export const RadialResult = ({
module,
score,
total,
png,
}: ModuleScore) => (
<View style={[styles.textFont, styles.radialContainer]}>
<Text style={[styles.textColor, styles.textBold, { fontSize: 10 }]}>
{module}
</Text>
<Image src={png} style={styles.image64}></Image>
<View style={[styles.textColor, styles.radialResultContainer]}>
<Text style={styles.textBold}>{score}</Text>
<Text style={{ fontSize: 8 }}>out of {total}</Text>
</View>
</View>
export const RadialResult = ({module, score, total, png}: ModuleScore) => (
<View style={[styles.textFont, styles.radialContainer]}>
<Text style={[styles.textColor, styles.textBold, {fontSize: 10}]}>{module}</Text>
<Image src={png} style={styles.image64}></Image>
<View style={[styles.textColor, styles.radialResultContainer]}>
<Text style={styles.textBold}>{score.toFixed(2)}</Text>
<Text style={{fontSize: 8}}>out of {total}</Text>
</View>
</View>
);

View File

@@ -1,20 +1,20 @@
import React from "react";
import { View, StyleSheet } from "@react-pdf/renderer";
import { ModuleScore } from "@/interfaces/module.scores";
import { RadialResult } from "./radial.result";
import {View, StyleSheet} from "@react-pdf/renderer";
import {ModuleScore} from "@/interfaces/module.scores";
import {RadialResult} from "./radial.result";
interface Props {
testDetails: ModuleScore[];
testDetails: ModuleScore[];
}
const customStyles = StyleSheet.create({
container: { display: "flex", flexDirection: "row", gap: 30 },
container: {display: "flex", flexDirection: "row", gap: 30},
});
export const SkillExamDetails = ({ testDetails }: Props) => (
<View style={customStyles.container}>
{testDetails.map((detail) => {
const { module } = detail;
return <RadialResult key={module} {...detail} />;
})}
</View>
export const SkillExamDetails = ({testDetails}: Props) => (
<View style={customStyles.container}>
{testDetails.map((detail) => {
const {module} = detail;
return <RadialResult key={module} {...detail} />;
})}
</View>
);