From 88fddccb754b1dcf4b817132a2e9e308abb8a308 Mon Sep 17 00:00:00 2001 From: lander Date: Fri, 24 May 2024 12:32:10 +0200 Subject: [PATCH 1/8] feat: fixtures for demo --- backend/api/fixtures/realistic/realistic.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/api/fixtures/realistic/realistic.yaml b/backend/api/fixtures/realistic/realistic.yaml index 3224250e..ff8dba33 100644 --- a/backend/api/fixtures/realistic/realistic.yaml +++ b/backend/api/fixtures/realistic/realistic.yaml @@ -3,7 +3,7 @@ pk: 0 fields: name: Introduction to Computer Science - academic_startyear: 2024 + academic_startyear: 2023 excerpt: This course is an introduction to computer science. description: This course will teach you the basics of computer science by showing you the wonders of Golang. faculty: Wetenschappen @@ -15,7 +15,7 @@ pk: 1 fields: name: The frog and its anatomy - academic_startyear: 2024 + academic_startyear: 2023 excerpt: This course is an introduction to biology. description: This course will teach you the basics of biology by showing you the wonders of the human body. faculty: Wetenschappen @@ -29,12 +29,13 @@ pk: 0 fields: name: Learn Python - description: This project will teach you the basics of Python. + description: '

Python Opdracht: Recursieve Functie

In deze opdracht ga je een recursieve functie implementeren in Python. Recursie is een programmeertechniek waarbij een functie zichzelf aanroept. Dit kan nuttig zijn voor het oplossen van problemen die kunnen worden opgesplitst in kleinere, gelijkaardige problemen.

Opdrachtbeschrijving

Schrijf een Python-functie genaamd recursieve_som die de som berekent van alle positieve gehele getallen tot en met een gegeven nummer n inclusief. De functie moet recursief zijn en voldoet aan de volgende specificaties:

Voorbeeld

Als de invoer n = 5 is, dan moet de uitvoer zijn:

recursieve_som(5)
Uitvoer: 15
Verklaring: 1 + 2 + 3 + 4 + 5 = 15

Stappenplan

  1. Controleer of n gelijk is aan 1. Zo ja, retourneer 1.
  2. Zo nee, retourneer de som van n en de recursieve aanroep van recursieve_som(n-1).

Code Sjabloon

def recursieve_som(n): if n == 1: return 1 else: return n + recursieve_som(n-1) # Voorbeeld aanroep resultaat = recursieve_som(5) print(resultaat)  # Uitvoer: 15 

Extra Uitdaging

Pas de functie aan zodat deze een foutmelding geeft wanneer de invoer geen positief geheel getal is. Gebruik hiervoor de raise-instructie om een uitzondering te genereren.

Voorbeeld:

def recursieve_som(n): if not isinstance(n, int) or n <= 0: raise ValueError("Invoer moet een positief geheel getal zijn") if n == 1: return 1 else: return n + recursieve_som(n-1) 

Indienen

Zorg ervoor dat je je code indient via het platform onder het juiste project en in de juiste groep. Voeg ook een kort verslag toe waarin je de werking van je functie uitlegt en eventuele uitdagingen die je bent tegengekomen tijdens het programmeren.

+' visible: true archived: false locked_groups: false start_date: 2023-12-12T00:00:00Z - deadline: 2025-01-01T00:00:00Z + deadline: 2024-5-26T00:00:00Z max_score: 100 score_visible: false group_size: 3 @@ -48,7 +49,7 @@ archived: false locked_groups: false start_date: 2023-01-01T00:00:00Z - deadline: 2025-01-01T00:00:00Z + deadline: 2024-05-30T00:00:00Z max_score: 20 score_visible: true group_size: 3 From 482dbf26adb79a41e9e5fcd3da2eb23f96906ef9 Mon Sep 17 00:00:00 2001 From: EwoutV Date: Thu, 23 May 2024 23:19:00 +0200 Subject: [PATCH 2/8] chore: merge --- frontend/src/assets/lang/app/nl.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/frontend/src/assets/lang/app/nl.json b/frontend/src/assets/lang/app/nl.json index 377a26c6..20b8aa92 100644 --- a/frontend/src/assets/lang/app/nl.json +++ b/frontend/src/assets/lang/app/nl.json @@ -97,8 +97,6 @@ "title": "Indieningsstructuur", "placeholder": "Geef deze nieuwe map een naam", "cancelSelection": "Deselecteer {0}", - "obligatedExtensions": "Verplichte extensies", - "blockedExtensions": "Niet toegelaten extensies", "newFolder": "Nieuwe map" }, "extraChecks": { From 0fd7618cdf1faadc5b2611bea26582f2c7803299 Mon Sep 17 00:00:00 2001 From: EwoutV Date: Thu, 23 May 2024 23:22:12 +0200 Subject: [PATCH 3/8] chore: added translations --- frontend/src/assets/lang/app/nl.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/assets/lang/app/nl.json b/frontend/src/assets/lang/app/nl.json index 20b8aa92..377a26c6 100644 --- a/frontend/src/assets/lang/app/nl.json +++ b/frontend/src/assets/lang/app/nl.json @@ -97,6 +97,8 @@ "title": "Indieningsstructuur", "placeholder": "Geef deze nieuwe map een naam", "cancelSelection": "Deselecteer {0}", + "obligatedExtensions": "Verplichte extensies", + "blockedExtensions": "Niet toegelaten extensies", "newFolder": "Nieuwe map" }, "extraChecks": { From eccea239364e19d8906aa968f87e68b4aff0b925 Mon Sep 17 00:00:00 2001 From: Ewout Verlinde Date: Fri, 24 May 2024 11:29:52 +0200 Subject: [PATCH 4/8] chore: small changes --- backend/.tool-versions | 2 +- backend/ypovoli/asgi.py | 16 ---------------- 2 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 backend/ypovoli/asgi.py diff --git a/backend/.tool-versions b/backend/.tool-versions index c10ee4eb..550b4b4c 100644 --- a/backend/.tool-versions +++ b/backend/.tool-versions @@ -1 +1 @@ -python 3.11.4 +python 3.11.8 diff --git a/backend/ypovoli/asgi.py b/backend/ypovoli/asgi.py deleted file mode 100644 index ac8466f7..00000000 --- a/backend/ypovoli/asgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -ASGI config for ypovoli project. - -It exposes the ASGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/ -""" - -import os - -from django.core.asgi import get_asgi_application - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ypovoli.settings") - -application = get_asgi_application() From 7e6c73ad6696ff40f28b892df1a552a76bf403a3 Mon Sep 17 00:00:00 2001 From: Ewout Verlinde Date: Fri, 24 May 2024 12:31:38 +0200 Subject: [PATCH 5/8] chore: submission layout --- frontend/package-lock.json | 18 +--- frontend/src/assets/lang/app/en.json | 2 + frontend/src/assets/lang/app/nl.json | 8 +- .../projects/ProjectDeadlineCard.vue | 4 +- .../src/components/projects/ProjectList.vue | 16 +-- .../projects/groups/GroupChooseCard.vue | 14 ++- .../components/submissions/AllSubmission.vue | 102 ++++++++---------- frontend/src/types/submission/Submission.ts | 16 +++ frontend/src/views/calendar/CalendarView.vue | 4 +- .../src/views/courses/CreateCourseView.vue | 2 +- frontend/src/views/courses/JoinCourseView.vue | 2 +- .../src/views/courses/UpdateCourseView.vue | 2 +- .../courses/roles/AssistantCourseView.vue | 2 +- .../views/courses/roles/StudentCourseView.vue | 2 +- .../views/courses/roles/TeacherCourseView.vue | 2 +- .../roles/AssistantDashboardView.vue | 2 +- .../dashboard/roles/StudentDashboardView.vue | 4 +- .../dashboard/roles/TeacherDashboardView.vue | 4 +- frontend/src/views/layout/Title.vue | 19 ++-- .../src/views/projects/CreateProjectView.vue | 2 +- frontend/src/views/projects/ProjectsView.vue | 2 +- .../src/views/projects/UpdateProjectView.vue | 2 +- .../projects/roles/StudentProjectView.vue | 16 ++- .../src/views/submissions/SubmissionsView.vue | 17 ++- 24 files changed, 145 insertions(+), 119 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index b38c986e..3fea2fe9 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -6093,22 +6093,6 @@ "node": ">= 0.8.0" } }, - "node_modules/prettier": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", - "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", - "dev": true, - "peer": true, - "bin": { - "prettier": "bin/prettier.cjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, "node_modules/prettier-linter-helpers": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", @@ -7186,7 +7170,7 @@ "version": "5.4.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", - "devOptional": true, + "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/frontend/src/assets/lang/app/en.json b/frontend/src/assets/lang/app/en.json index 36689926..30f0a0f3 100644 --- a/frontend/src/assets/lang/app/en.json +++ b/frontend/src/assets/lang/app/en.json @@ -91,6 +91,7 @@ "scoreVisibility": "Make score, when uploaded, automatically visible to students", "submissionStructure": "Structure of how a submission should be made", "noStudents": "No students in this group", + "alreadyStarted": "The project has already started", "locked": "Closed", "unlocked": "Open", "structureChecks": { @@ -98,6 +99,7 @@ "placeholder": "Give a name to this folder", "cancelSelection": "Deselect {0}", "newFolder": "New folder", + "noChecks": "Your submission does not have to comply with a specific structure.", "obligatedExtensions": "Obligated extensions", "blockedExtensions": "Blocked extensions" }, diff --git a/frontend/src/assets/lang/app/nl.json b/frontend/src/assets/lang/app/nl.json index 377a26c6..1507263a 100644 --- a/frontend/src/assets/lang/app/nl.json +++ b/frontend/src/assets/lang/app/nl.json @@ -67,13 +67,14 @@ "publishScores": "Publiceer scores", "groupName": "Groepsnaam", "groupPopulation": "Grootte", + "alreadyStarted": "Project is al gestart", "groupStatus": "Status", "start": "Startdatum", "submissionStatus": "Indienstatus", "group": "Groep", "groups": "Groepen", "groupSize": "Individueel | Groepen van {count} personen", - "noGroups": "Geen groepen beschikbaar", + "noGroups": "Geen groepen beschikbaar.", "groupMembers": "Groepsleden", "chooseGroup": "Kies een groep", "joinGroup": "Kies groep", @@ -99,7 +100,8 @@ "cancelSelection": "Deselecteer {0}", "obligatedExtensions": "Verplichte extensies", "blockedExtensions": "Niet toegelaten extensies", - "newFolder": "Nieuwe map" + "newFolder": "Nieuwe map", + "noChecks": "Je indiening moet niet voldoen aan een specifieke structuur." }, "extraChecks": { "title": "Automatische checks op een indiening", @@ -260,7 +262,7 @@ }, "noIncomingProjects": "Geen projecten met een deadline binnen de 7 dagen.", "selectCourse": "Selecteer het vak waarvoor je een project wil maken:", - "showPastProjects": "Projecten met verstreken deadline" + "showPastProjects": "Toon projecten met verstreken deadline" } }, "types": { diff --git a/frontend/src/components/projects/ProjectDeadlineCard.vue b/frontend/src/components/projects/ProjectDeadlineCard.vue index d1aecf2c..9497f380 100644 --- a/frontend/src/components/projects/ProjectDeadlineCard.vue +++ b/frontend/src/components/projects/ProjectDeadlineCard.vue @@ -24,8 +24,8 @@ const { t } = useI18n(); }, }" > -
-
+
+

{{ project.name }}

diff --git a/frontend/src/components/projects/ProjectList.vue b/frontend/src/components/projects/ProjectList.vue index 90f01b64..cbe8eda1 100644 --- a/frontend/src/components/projects/ProjectList.vue +++ b/frontend/src/components/projects/ProjectList.vue @@ -1,6 +1,6 @@ diff --git a/frontend/src/types/submission/Submission.ts b/frontend/src/types/submission/Submission.ts index f1bba8c7..fe0c26ab 100644 --- a/frontend/src/types/submission/Submission.ts +++ b/frontend/src/types/submission/Submission.ts @@ -30,6 +30,22 @@ export class Submission { return this.isExtraCheckPassed() && this.isStructureCheckPassed(); } + /** + * Check if the submission is failed. + * @returns boolean + */ + public isFailed(): boolean { + return !this.isPassed(); + } + + /** + * Check if the submission is failed. + * @returns boolean + */ + public isNonePassed(): boolean { + return !this.isExtraCheckPassed() && !this.isStructureCheckPassed(); + } + /** * Check if some of the checks is passed. */ diff --git a/frontend/src/views/calendar/CalendarView.vue b/frontend/src/views/calendar/CalendarView.vue index 694c464e..cc59f39d 100644 --- a/frontend/src/views/calendar/CalendarView.vue +++ b/frontend/src/views/calendar/CalendarView.vue @@ -164,7 +164,7 @@ watch(selectedDate, (date) => {