+
+
+
+
+
+ {{ $t("submit.submit_button") }}
+
+
+
+
+
+
+
diff --git a/frontend/src/components/project/submit/SubmitInfo.vue b/frontend/src/components/submission/SubmitInfo.vue
similarity index 100%
rename from frontend/src/components/project/submit/SubmitInfo.vue
rename to frontend/src/components/submission/SubmitInfo.vue
diff --git a/frontend/src/i18n/locales/en.ts b/frontend/src/i18n/locales/en.ts
index 1c9c4c55..7b5ce94c 100644
--- a/frontend/src/i18n/locales/en.ts
+++ b/frontend/src/i18n/locales/en.ts
@@ -64,6 +64,12 @@ export default {
not_found: "No projects found.",
finished: "Finished",
not_found2: "Project not found",
+ requirements: "File requirements",
+ mandatory: "Mandatory",
+ forbidden: "Forbidden",
+ unmet_mandatory: "This mandatory file was not included in your submission.",
+ unmet_forbidden: "These submitted files are not allowed:",
+ unmet_reqs_warning: "Your submission did not satisfy all file requirements.",
to_subject: "To subject",
to_groups: "To groups",
},
diff --git a/frontend/src/i18n/locales/nl.ts b/frontend/src/i18n/locales/nl.ts
index 37693491..5eed9405 100644
--- a/frontend/src/i18n/locales/nl.ts
+++ b/frontend/src/i18n/locales/nl.ts
@@ -64,6 +64,12 @@ export default {
not_found: "Geen projecten teruggevonden.",
finished: "Afgerond",
not_found2: "Project niet teruggevonden",
+ requirements: "Bestandsvereisten",
+ mandatory: "Verplicht",
+ forbidden: "Verboden",
+ unmet_mandatory: "Dit verplichte bestand is niet aanwezig in je indiening.",
+ unmet_forbidden: "Deze ingediende bestanden zijn verboden:",
+ unmet_reqs_warning: "Opgelet: je indiening voldoet niet aan alle bestandsvereisten.",
to_subject: "Naar vak",
to_groups: "Naar groepen",
},
diff --git a/frontend/src/models/Project.ts b/frontend/src/models/Project.ts
index 6be5c1dd..2661a600 100644
--- a/frontend/src/models/Project.ts
+++ b/frontend/src/models/Project.ts
@@ -5,7 +5,7 @@ export default interface Project {
// groupProjectType: string;
// selectedTeachers: string[]; // Assuming you store only teacher IDs
subject_id: number;
- requirements: [];
+ requirements: Requirement[];
description: string;
capacity: number;
}
@@ -31,6 +31,16 @@ export interface Deadline {
status: string;
}
+export interface Requirement {
+ mandatory: boolean;
+ value: string;
+}
+
+export interface UnmetRequirement {
+ requirement: Requirement;
+ files: string[] | undefined;
+}
+
export enum FilterOptions {
All = "All",
Active = "Active",
diff --git a/frontend/src/queries/Submission.ts b/frontend/src/queries/Submission.ts
index 15aeb63a..04db7dfe 100644
--- a/frontend/src/queries/Submission.ts
+++ b/frontend/src/queries/Submission.ts
@@ -11,6 +11,8 @@ import {
} from "@/services/submission";
import type Submission from "@/models/Submission";
import type FileInfo from "@/models/File";
+import { FetchError } from "@/services";
+import type { UnmetRequirement } from "@/models/Project";
import { useProjectGroupQuery } from "./Group";
function SUBMISSION_QUERY_KEY(submissionId: number): (string | number)[] {
@@ -105,6 +107,15 @@ export function useFilesQuery(
});
}
+export class UnmetRequirementsError extends Error {
+ unmetRequirements: UnmetRequirement[];
+
+ constructor(message: string, unmetRequirements: UnmetRequirement[], ...params: any[]) {
+ super(message, ...params);
+ this.unmetRequirements = unmetRequirements;
+ }
+}
+
/**
* Mutation composable for creating a submission
*/
@@ -113,13 +124,44 @@ export function useCreateSubmissionMutation(
): UseMutationReturnType