Updated the condition to close assignment: to be end date or when all students finish the assignment
This commit is contained in:
@@ -151,8 +151,9 @@ export default function TeacherDashboard({user}: Props) {
|
||||
};
|
||||
|
||||
const AssignmentsPage = () => {
|
||||
const activeFilter = (a: Assignment) => moment(a.endDate).isAfter(moment()) && moment(a.startDate).isBefore(moment());
|
||||
const pastFilter = (a: Assignment) => moment(a.endDate).isBefore(moment());
|
||||
const activeFilter = (a: Assignment) =>
|
||||
moment(a.endDate).isAfter(moment()) && moment(a.startDate).isBefore(moment()) && a.assignees.length > a.results.length;
|
||||
const pastFilter = (a: Assignment) => moment(a.endDate).isBefore(moment()) || a.assignees.length === a.results.length;
|
||||
const futureFilter = (a: Assignment) => moment(a.startDate).isAfter(moment());
|
||||
|
||||
return (
|
||||
|
||||
@@ -5,19 +5,12 @@ 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) => (
|
||||
export const RadialResult = ({module, score, total, png}: ModuleScore) => (
|
||||
<View style={[styles.textFont, styles.radialContainer]}>
|
||||
<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>
|
||||
<View style={[styles.textColor, styles.radialResultContainer]}>
|
||||
<Text style={styles.textBold}>{score}</Text>
|
||||
<Text style={styles.textBold}>{score.toFixed(2)}</Text>
|
||||
<Text style={{fontSize: 8}}>out of {total}</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@@ -4,10 +4,10 @@ export interface ModuleScore {
|
||||
score: number;
|
||||
total: number;
|
||||
code: Module;
|
||||
module: Module | 'Overall';
|
||||
png?: string,
|
||||
evaluation?: string,
|
||||
suggestions?: string,
|
||||
module: Module | "Overall";
|
||||
png?: string;
|
||||
evaluation?: string;
|
||||
suggestions?: string;
|
||||
}
|
||||
|
||||
export interface StudentData {
|
||||
|
||||
Reference in New Issue
Block a user