From e556095c7ae3649c190feacf8e878f3855ceb781 Mon Sep 17 00:00:00 2001 From: Panagiotis Skoulis Date: Fri, 12 Dec 2025 15:56:48 +0200 Subject: [PATCH 01/23] hitting courses.auth --- 086AF560-21CA-48FE-A006-889186315FA5 | 1 + src/lib/components/courses/courseInfo.svelte | 21 ++++++++++++++++++- .../courseExam/courseInfo/courseInfo.js | 19 +++++++++++++++-- 3 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 086AF560-21CA-48FE-A006-889186315FA5 diff --git a/086AF560-21CA-48FE-A006-889186315FA5 b/086AF560-21CA-48FE-A006-889186315FA5 new file mode 100644 index 00000000..73784a24 --- /dev/null +++ b/086AF560-21CA-48FE-A006-889186315FA5 @@ -0,0 +1 @@ +{"id":48587,"year":"2025-2026","period":"Χειμερινό ","dateModified":"2025-11-10T11:19:38.510+02:00","courseClass":"66695","title":null,"prerequisites":null,"generalPrerequisites":null,"specificCourseCategory":{"id":1,"name":"Γενικού Υποβάθρου","alternateName":"generalBackground","description":"Πρόκειται για τα μαθήματα εκείνα που αποτελούν συνέχεια και επέκταση των λυκειακών γνώσεων ή /και αποτελούν υποχρεωτικά μαθήματα προαπαιτούμενα για την παρακολούθηση άλλων μαθημάτων. Τα μαθήματα εκείνα που, αν και δεν αναφέρονται άμεσα στην επιστήμη που θεραπεύει το Πρόγραμμα Σπουδών, ωστόσο αποτελούν αναγκαία προϋπάρχουσα επιστημονική γνώση για να μπορέσει κάποιος να αντιληφθεί θέματα άμεσα εντασσόμενα σε αυτήν.","locale":{"id":2,"object":1,"inLanguage":"el","name":"Γενικού Υποβάθρου","description":null}},"semester":1,"educationClassification":{"id":3,"name":"Επίπεδο 7: Μεταπτυχιακά Διπλώματα Ειδίκευσης","alternateName":"level7","description":"Αφορά στα Μεταπτυχιακά Διπλώματα Ειδίκευσης (π.χ.Master - MS.c, Μ.Eng, M.B.A. κλπ.)","locale":{"id":6,"object":3,"inLanguage":"el","name":"Επίπεδο 7: Μεταπτυχιακά Διπλώματα Ειδίκευσης"}},"erasmus":false,"learningOutcome":"Με την επιτυχη ολοκληρωση του μαθηματος οι φοιτητες θα ειναι σε θεση να κανουν τα εξης.\r\n1. Να υπολογιζουν ορια, παραγωγους και ολοκληρωματα βασικων συναρτησεων.\r\n2. Να υπολογιζουν ογκους, εμβαδα και μηκη τοξων.\r\n3. Να υπολογιζουν ορια ακολουθιων.\r\n4. Να επιλυουν εξισωσεις διαφορων.\r\n5. Να αναπτυσοουν συναρτησεις σε σειρες Taylor.\r\n6. Να επιλυουν γραμμικες διαφορικες εξισωσεις 1ης ταξης.\r\n","content":"Λογισμός συναρτήσεων μιας πραγματικής μεταβλητής: μιγαδικοι αριθμοι, συναρτήσεις, όριο και συνεχεια, παράγωγoς, λογαριθμικές και εκθετικές συναρτήσεις, τριγωνομετρικές και υπερβολικές συναρτήσεις, τύπος του Euler, ολοκλήρωμα, μέθοδοι ολοκληρωσης, εμβαδό, μήκος και όγκος, παραμετρικές συναρτήσεις, πολικές συντεταγμένες, ακολουθιες, αναδρομικές ακολουθίες, αριθμητικες σειρές, δυναμοσειρές, σειρές Taylor και MacLaurin, διαφορικές εξισώσεις πρώτης τάξης.","contentKeywords":null,"ictDescription":"προβολικο ΗΥ\r\nασκησεις Moodle ","courseEvaluationDescription":"Γραπτή εξέταση διάρκειας 150 λεπτών\r\n\r\n","eudoxus":"Βιβλίο [2574]: Γενικά Μαθηματικά (Schaum's Outline of Theory and Problems of Differential and Integral Calculus) Frank Ayres","bibliography":null,"ects":6,"workLoad":30,"evaluationMethod":{"id":1,"name":"Διαμορφωτική","alternateName":"Formative","description":null,"locale":{"id":2,"object":1,"inLanguage":"el","name":"Διαμορφωτική"}},"ictTypes":[{"id":1,"name":"Χρήση Τ.Π.Ε. στη Διδασκαλία","alternateName":"uceICTTeaching","description":null,"locale":{"id":2,"object":1,"inLanguage":"el","name":"Χρήση Τ.Π.Ε. στη Διδασκαλία"}},{"id":3,"name":"Χρήση Τ.Π.Ε. στην Επικοινωνία με τους φοιτητές","alternateName":"uceICTCommunication","description":null,"locale":{"id":6,"object":3,"inLanguage":"el","name":"Χρήση Τ.Π.Ε. στην Επικοινωνία με τους φοιτητές"}},{"id":4,"name":"Χρήση Τ.Π.Ε. στην Αξιολόγηση των Φοιτητών","alternateName":"userICTEvaluation","description":null,"locale":{"id":9,"object":4,"inLanguage":"el","name":"Χρήση Τ.Π.Ε. στην Αξιολόγηση των Φοιτητών"}}],"evaluationLanguages":[{"id":1,"name":"Ελληνικά","alternateName":"el","description":null,"locale":{"id":2,"object":1,"inLanguage":"el","name":"Ελληνικά"}}],"courseEvaluations":[],"educationMaterials":[{"id":-1,"name":"Άλλο","alternateName":"Other","description":null,"locale":{"id":9,"object":-1,"inLanguage":"el","name":"Άλλο"}},{"id":1,"name":"Σημειώσεις","alternateName":"Σημειώσεις","description":null,"locale":{"id":1,"object":1,"inLanguage":"el","name":"Σημειώσεις"}},{"id":8,"name":"Βιβλίο","alternateName":"Βιβλίο","description":null,"locale":{"id":8,"object":8,"inLanguage":"el","name":"Βιβλίο"}}],"generalSkills":[{"id":1,"name":"Εφαρμογή της γνώσης στην πράξη","alternateName":"practicalApplication","description":null,"locale":{"id":2,"object":1,"inLanguage":"el","name":"Εφαρμογή της γνώσης στην πράξη"}},{"id":5,"name":"Αυτόνομη εργασία","alternateName":"autonomousWork","description":null,"locale":{"id":10,"object":5,"inLanguage":"el","name":"Αυτόνομη εργασία"}},{"id":15,"name":"Προαγωγή της ελεύθερης, δημιουργικής και επαγωγικής σκέψης","alternateName":"creativeReasoning","description":null,"locale":{"id":30,"object":15,"inLanguage":"el","name":"Προαγωγή της ελεύθερης, δημιουργικής και επαγωγικής σκέψης"}}],"teachingMethods":[{"id":1,"name":"Πρόσωπο με πρόσωπο","alternateName":"faceToFace","description":null,"locale":{"id":2,"object":1,"inLanguage":"el","name":"Πρόσωπο με πρόσωπο"}}],"teachingStructureTypes":[{"id":423502,"courseOutline":48587,"teachingLearningType":{"id":1,"name":"Διαλέξεις","alternateName":"Lectures","description":null,"locale":{"id":2,"object":1,"inLanguage":"el","name":"Διαλέξεις"}},"weekHours":null,"workLoad":72,"ects":null},{"id":423503,"courseOutline":48587,"teachingLearningType":{"id":5,"name":"Μελέτη και ανάλυση βιβλίων και άρθρων","alternateName":"BibliographyAnalysis","description":null,"locale":{"id":10,"object":5,"inLanguage":"el","name":"Μελέτη και ανάλυση βιβλίων και άρθρων"}},"weekHours":null,"workLoad":72,"ects":null},{"id":423504,"courseOutline":48587,"teachingLearningType":{"id":15,"name":"Εξετάσεις","alternateName":"Examinations","description":null,"locale":{"id":30,"object":15,"inLanguage":"el","name":"Εξετάσεις"}},"weekHours":null,"workLoad":36,"ects":null}],"courseDigitalContents":[{"id":29487,"courseOutline":48587,"eStudyGuideType":{"id":4,"name":"eLearning (Moodle)","alternateName":"eLearning (Moodle)","description":null,"locale":{"id":8,"object":4,"inLanguage":"el","name":"eLearning (Moodle)"}},"url":"https://elearning.auth.gr/course/view.php?id=3801"}],"courseLanguages":[{"id":65139,"courseOutline":48587,"language":{"id":1,"name":"Ελληνικά","alternateName":"el","description":null,"locale":{"id":2,"object":1,"inLanguage":"el","name":"Ελληνικά"}},"teaching":true,"examination":true}],"locale":{"id":90898,"object":48587,"inLanguage":"el","title":null,"prerequisites":null,"generalPrerequisites":null,"learningOutcome":"Με την επιτυχη ολοκληρωση του μαθηματος οι φοιτητες θα ειναι σε θεση να κανουν τα εξης.\r\n1. Να υπολογιζουν ορια, παραγωγους και ολοκληρωματα βασικων συναρτησεων.\r\n2. Να υπολογιζουν ογκους, εμβαδα και μηκη τοξων.\r\n3. Να υπολογιζουν ορια ακολουθιων.\r\n4. Να επιλυουν εξισωσεις διαφορων.\r\n5. Να αναπτυσοουν συναρτησεις σε σειρες Taylor.\r\n6. Να επιλυουν γραμμικες διαφορικες εξισωσεις 1ης ταξης.\r\n","content":"Λογισμός συναρτήσεων μιας πραγματικής μεταβλητής: μιγαδικοι αριθμοι, συναρτήσεις, όριο και συνεχεια, παράγωγoς, λογαριθμικές και εκθετικές συναρτήσεις, τριγωνομετρικές και υπερβολικές συναρτήσεις, τύπος του Euler, ολοκλήρωμα, μέθοδοι ολοκληρωσης, εμβαδό, μήκος και όγκος, παραμετρικές συναρτήσεις, πολικές συντεταγμένες, ακολουθιες, αναδρομικές ακολουθίες, αριθμητικες σειρές, δυναμοσειρές, σειρές Taylor και MacLaurin, διαφορικές εξισώσεις πρώτης τάξης.","contentKeywords":null,"eudoxus":"Βιβλίο [2574]: Γενικά Μαθηματικά (Schaum's Outline of Theory and Problems of Differential and Integral Calculus) Frank Ayres","bibliography":null,"courseEvaluationDescription":"Γραπτή εξέταση διάρκειας 150 λεπτών\r\n\r\n","ictDescription":"προβολικο ΗΥ\r\nασκησεις Moodle "}} \ No newline at end of file diff --git a/src/lib/components/courses/courseInfo.svelte b/src/lib/components/courses/courseInfo.svelte index 5caec873..1b4281a2 100644 --- a/src/lib/components/courses/courseInfo.svelte +++ b/src/lib/components/courses/courseInfo.svelte @@ -5,7 +5,7 @@ /** - * @type {{ title: any; code: any; courseType: any; teacher: string; ects: any; semester: any; season: any; weeklyHours: any; period: any; }} + * @type {{ title: any; code: any; courseType: any; teacher: string; syllabus: string; eudoxus: string; ects: any; semester: any; season: any; weeklyHours: any; period: any; }} */ export let course; /** @@ -180,6 +180,25 @@ {/each} + + + + + {$t("course.syllabus")} + +

{course.syllabus}

+
+
+ + + + + {$t("course.eudoxus")} + +

{course.eudoxus}

+
+
+ diff --git a/src/lib/functions/courseExam/courseInfo/courseInfo.js b/src/lib/functions/courseExam/courseInfo/courseInfo.js index fff4b4fb..d80d162c 100644 --- a/src/lib/functions/courseExam/courseInfo/courseInfo.js +++ b/src/lib/functions/courseExam/courseInfo/courseInfo.js @@ -13,6 +13,8 @@ * @type {{ familyName: any; givenName: any; }[]} */ let courseInstructors; + let syllabus; + let eudoxus; let weeklyHours; @@ -22,13 +24,14 @@ export async function courseInformation(courseID) { let courseInfo = decodeURIComponent(courseID); - courses = []; registrations = []; courseTitle = ""; semester = ""; ects = 0; courseInstructors = []; + syllabus = ""; + eudoxus = ""; weeklyHours = 0; courseType = ""; period = ""; @@ -40,6 +43,7 @@ // Getting an array with courses courses = (await neoUniversisGet("students/me/courses?$top=-1",{lifetime: 600})).value; + console.log(courses) // Getting an array with user's registered courses and information about them registrations = (await neoUniversisGet("students/me/Registrations?$expand=classes($expand=courseType($expand=locale),courseClass($expand=course($expand=locale),instructors($expand=instructor($select=InstructorSummary))))&$top=-1&$skip=0&$count=false",{lifetime: 600})).value; @@ -60,7 +64,16 @@ season = course.lastRegistrationPeriod.name; - + let newCourseObject = await fetch(`https://courses.auth.gr/services/course-catalogue/v1p1/qa/CourseOutlines/${course.id}?$top=1&$skip=0&$count=false`) + let newCourseData; + if(newCourseObject.ok) { + newCourseData = await newCourseObject.json() + } else { + newCourseData = null + alert("bad request") + } + syllabus = newCourseData.content + eudoxus = newCourseData.eudoxus } } @@ -94,6 +107,8 @@ "semester": semester, "ects": ects, "courseInstructors": courseInstructors, + "syllabus": syllabus, + "eudoxus": eudoxus, "weeklyHours": weeklyHours, "courseType": courseType, "period": period, From bcd66ce3f7dc55a2b6509683861baf118f931e43 Mon Sep 17 00:00:00 2001 From: Panagiotis Skoulis Date: Tue, 16 Dec 2025 15:30:42 +0200 Subject: [PATCH 02/23] successful api hit --- src/lib/components/courses/courseInfo.svelte | 4 +- .../courseExam/courseInfo/courseInfo.js | 45 +++++++++++++------ 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/src/lib/components/courses/courseInfo.svelte b/src/lib/components/courses/courseInfo.svelte index 1b4281a2..0563ca52 100644 --- a/src/lib/components/courses/courseInfo.svelte +++ b/src/lib/components/courses/courseInfo.svelte @@ -184,7 +184,7 @@ - {$t("course.syllabus")} +

{course.syllabus}

@@ -193,7 +193,7 @@ - {$t("course.eudoxus")} +

{course.eudoxus}

diff --git a/src/lib/functions/courseExam/courseInfo/courseInfo.js b/src/lib/functions/courseExam/courseInfo/courseInfo.js index d80d162c..01870f0b 100644 --- a/src/lib/functions/courseExam/courseInfo/courseInfo.js +++ b/src/lib/functions/courseExam/courseInfo/courseInfo.js @@ -43,13 +43,17 @@ // Getting an array with courses courses = (await neoUniversisGet("students/me/courses?$top=-1",{lifetime: 600})).value; - console.log(courses) // Getting an array with user's registered courses and information about them registrations = (await neoUniversisGet("students/me/Registrations?$expand=classes($expand=courseType($expand=locale),courseClass($expand=course($expand=locale),instructors($expand=instructor($select=InstructorSummary))))&$top=-1&$skip=0&$count=false",{lifetime: 600})).value; + console.log(registrations) // Finding the course and storing informations about it in variables + + + + for (const course of courses) { if (course.course === courseInfo){ @@ -63,18 +67,33 @@ } season = course.lastRegistrationPeriod.name; - - let newCourseObject = await fetch(`https://courses.auth.gr/services/course-catalogue/v1p1/qa/CourseOutlines/${course.id}?$top=1&$skip=0&$count=false`) - let newCourseData; - if(newCourseObject.ok) { - newCourseData = await newCourseObject.json() - } else { - newCourseData = null - alert("bad request") - } - syllabus = newCourseData.content - eudoxus = newCourseData.eudoxus - + try{ + for(const sem of registrations){ + for(const semClass of sem.classes){ + //debug + // console.log(semClass.courseClass.course.id) + // console.log(courseInfo) + if(semClass.courseClass.course.id == courseInfo){ + semClass.identifier + let newCourseObject = await fetch(`https://courses.auth.gr/services/course-catalogue/v1p1/qa/CourseOutlines/${semClass.courseClass.identifier}?$top=1&$skip=0&$count=false`) + let newCourseData; + if(newCourseObject.ok) { + newCourseData = await newCourseObject.json() + syllabus = newCourseData.content + eudoxus = newCourseData.eudoxus + + console.log(syllabus) + console.log(eudoxus) + } else { + newCourseData = null + alert("bad request") + } + } + } + } + } catch(e){ + console.log(e) + } } } From 910518d3f2dfa6a545063dcf4016a4f98d5d8700 Mon Sep 17 00:00:00 2001 From: Panagiotis Skoulis Date: Tue, 16 Dec 2025 16:31:49 +0200 Subject: [PATCH 03/23] syllabus & eudoxus done, needs locale --- src/lib/components/courses/courseInfo.svelte | 40 ++++++++++--------- src/lib/components/courses/coursePage.svelte | 11 ++++- .../courseExam/courseInfo/courseInfo.js | 6 +-- 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/src/lib/components/courses/courseInfo.svelte b/src/lib/components/courses/courseInfo.svelte index 0563ca52..58c79121 100644 --- a/src/lib/components/courses/courseInfo.svelte +++ b/src/lib/components/courses/courseInfo.svelte @@ -172,7 +172,7 @@ - + {$t("course.professors")} {#each course.teacher.split(', ') as teacher} @@ -180,24 +180,26 @@ {/each} - - - - - - -

{course.syllabus}

-
-
- - - - - - -

{course.eudoxus}

-
-
+ {#if course.syllabus} + + + + Ύλη: + +

{course.syllabus}

+
+
+ {/if} + {#if course.eudoxus} + + + + Συγγράματα: + +

{course.eudoxus}

+
+
+ {/if} diff --git a/src/lib/components/courses/coursePage.svelte b/src/lib/components/courses/coursePage.svelte index 7a494dfc..b0a0ed9a 100644 --- a/src/lib/components/courses/coursePage.svelte +++ b/src/lib/components/courses/coursePage.svelte @@ -13,6 +13,8 @@ code: '', ects: 0, teacher: '', + syllabus: '', + eudoxus: '', grade: '', semester: '', weeklyHours: 0, @@ -64,7 +66,14 @@ course.weeklyHours = result.weeklyHours; course.courseType = result.courseType; course.season = result.season; - + if(result.syllabus){ + course.syllabus = result.syllabus; + console.log(course.syllabus) + } + if(result.eudoxus) { + course.eudoxus = result.eudoxus + console.log(course.eudoxus) + } if (result.period) { course.period = result.period; } diff --git a/src/lib/functions/courseExam/courseInfo/courseInfo.js b/src/lib/functions/courseExam/courseInfo/courseInfo.js index 01870f0b..3c13252b 100644 --- a/src/lib/functions/courseExam/courseInfo/courseInfo.js +++ b/src/lib/functions/courseExam/courseInfo/courseInfo.js @@ -81,9 +81,9 @@ newCourseData = await newCourseObject.json() syllabus = newCourseData.content eudoxus = newCourseData.eudoxus - - console.log(syllabus) - console.log(eudoxus) + //debug + //console.log(syllabus) + //console.log(eudoxus) } else { newCourseData = null alert("bad request") From 77379f7de75621f259e67950fcaadf0a5d8a70ea Mon Sep 17 00:00:00 2001 From: Panagiotis Skoulis Date: Wed, 17 Dec 2025 10:45:16 +0200 Subject: [PATCH 04/23] fixed locale, added more user info --- src/lib/components/courses/courseInfo.svelte | 4 ++-- .../components/personalInfo/infoItem.svelte | 18 ++++++++++++++++++ src/lib/translations/translations.js | 4 ++++ src/routes/pages/personalInfo/+page.svelte | 8 ++++++++ 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/lib/components/courses/courseInfo.svelte b/src/lib/components/courses/courseInfo.svelte index 58c79121..02fd52e7 100644 --- a/src/lib/components/courses/courseInfo.svelte +++ b/src/lib/components/courses/courseInfo.svelte @@ -184,7 +184,7 @@ - Ύλη: + {$t("course.syllabus")}

{course.syllabus}

@@ -194,7 +194,7 @@ - Συγγράματα: + {$t("course.eudoxus")}

{course.eudoxus}

diff --git a/src/lib/components/personalInfo/infoItem.svelte b/src/lib/components/personalInfo/infoItem.svelte index dda236ab..85aa8607 100644 --- a/src/lib/components/personalInfo/infoItem.svelte +++ b/src/lib/components/personalInfo/infoItem.svelte @@ -20,6 +20,8 @@ export let semester: String; semester = `${semester}ο Εξάμηνο`; export let study_level: String; + export let deptSecretaryEmail: String; + export let academicId: String; // Function to show toast async function showToast(toast: ToastOptions) { @@ -85,6 +87,14 @@ {/if} + {#if academicId} + + + + {academicId} + + {/if} + {#if birthDate} @@ -101,6 +111,14 @@ {/if} + {#if deptSecretaryEmail} + + + + {deptSecretaryEmail} + + {/if} + {#if gender} diff --git a/src/lib/translations/translations.js b/src/lib/translations/translations.js index 0fa13eba..1d6839e9 100644 --- a/src/lib/translations/translations.js +++ b/src/lib/translations/translations.js @@ -185,6 +185,8 @@ export default { "course.period": "Περίοδος", "course.weekly_hours": "Εβδομαδιαίες ώρες", "course.professors": "Διδάσκοντες", + "course.syllabus": "Περιεχόμενα", + "course.eudoxus": "Συγγράματα", "course.stats": "Στατιστικά", "course.exams": "Εξεταστική", "course.top10Percent": "Βρίσκεσαι στο 10% των καλύτερων βαθμών", @@ -430,6 +432,8 @@ export default { 'course.period': 'Period', 'course.weekly_hours': 'Weekly hours', 'course.professors': 'Teaching staff', + "course.syllabus": "Syllabus", + "course.eudoxus": "Textbooks", 'course.stats': 'Statistics', 'course.exams': 'Examination period', 'course.top10Percent': 'You are in the top 10% of the highest grades', diff --git a/src/routes/pages/personalInfo/+page.svelte b/src/routes/pages/personalInfo/+page.svelte index 40284833..1152287d 100644 --- a/src/routes/pages/personalInfo/+page.svelte +++ b/src/routes/pages/personalInfo/+page.svelte @@ -25,6 +25,8 @@ let departmentName: String = ''; let semester: String = ''; let study_level: String = ''; + let deptSecretaryEmail: String = ''; + let academicId: String = ''; // Get personal details and department details @@ -35,6 +37,8 @@ ); let user = await neoUniversisGet('Users/me', { lifetime: 86000 }); + console.log(user) + console.log(personalData) aem = personalData.studentIdentifier; apm = personalData.uniqueIdentifier; inscriptionYear = personalData.inscriptionYear.name; @@ -48,6 +52,8 @@ departmentName = personalData.department.abbreviation; semester = personalData.semester; study_level = personalData.studyProgram.studyLevel.name; + deptSecretaryEmail = personalData.department.email; + academicId = personalData.academicId; } // Log out @@ -88,6 +94,8 @@ {departmentName} {semester} {study_level} + {deptSecretaryEmail} + {academicId} /> {:catch error} From eeffb8d9afe7b81d990c24face5b55dc5992a94e Mon Sep 17 00:00:00 2001 From: Panagiotis Skoulis Date: Wed, 17 Dec 2025 10:50:25 +0200 Subject: [PATCH 05/23] Fixed whitespace collapse --- src/lib/components/courses/courseInfo.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/components/courses/courseInfo.svelte b/src/lib/components/courses/courseInfo.svelte index 02fd52e7..fde886f5 100644 --- a/src/lib/components/courses/courseInfo.svelte +++ b/src/lib/components/courses/courseInfo.svelte @@ -186,17 +186,17 @@ {$t("course.syllabus")} -

{course.syllabus}

+

{course.syllabus}

{/if} {#if course.eudoxus} - + p {$t("course.eudoxus")} -

{course.eudoxus}

+

{course.eudoxus}

{/if} From ce42f556c2e8ee5179feb93b7ffe7ac16543a287 Mon Sep 17 00:00:00 2001 From: Panagiotis Skoulis Date: Wed, 17 Dec 2025 12:40:11 +0200 Subject: [PATCH 06/23] fixed html not rendering --- src/lib/components/courses/courseInfo.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/components/courses/courseInfo.svelte b/src/lib/components/courses/courseInfo.svelte index fde886f5..7dcdd034 100644 --- a/src/lib/components/courses/courseInfo.svelte +++ b/src/lib/components/courses/courseInfo.svelte @@ -186,7 +186,7 @@ {$t("course.syllabus")} -

{course.syllabus}

+

{@html course.syllabus}

{/if} @@ -196,7 +196,7 @@ {$t("course.eudoxus")} -

{course.eudoxus}

+

{@html course.eudoxus}

{/if} From 23be35dcfaf13bacb335b3cc7d9356a210217cae Mon Sep 17 00:00:00 2001 From: Panagiotis Skoulis Date: Wed, 17 Dec 2025 21:56:36 +0200 Subject: [PATCH 07/23] starting localization --- src/lib/components/courses/courseInfo.svelte | 4 +-- src/lib/components/courses/coursePage.svelte | 2 +- .../courseExam/courseInfo/courseInfo.js | 26 ++++++++++++------- src/lib/functions/localize.ts | 8 ++++++ 4 files changed, 27 insertions(+), 13 deletions(-) create mode 100644 src/lib/functions/localize.ts diff --git a/src/lib/components/courses/courseInfo.svelte b/src/lib/components/courses/courseInfo.svelte index 7dcdd034..20ec283b 100644 --- a/src/lib/components/courses/courseInfo.svelte +++ b/src/lib/components/courses/courseInfo.svelte @@ -156,7 +156,7 @@ {$t("course.semester")} {#if course.semester <= 24} - {course.semester}ο + {course.semester} {:else} {course.season} {/if} @@ -192,7 +192,7 @@ {/if} {#if course.eudoxus} - p + {$t("course.eudoxus")} diff --git a/src/lib/components/courses/coursePage.svelte b/src/lib/components/courses/coursePage.svelte index b0a0ed9a..cf7cecec 100644 --- a/src/lib/components/courses/coursePage.svelte +++ b/src/lib/components/courses/coursePage.svelte @@ -86,7 +86,7 @@ stats.grade = result.myGrade; stats.studentsLikeMe = result.studentsLikeMe; stats.studentsBetterThanMe = result.studentsBetterThanMe; - stats.studentsWorseThanMe = result.studentsWorseThanMe; + stats.studentsWorseThanMe = result.studentsWorseThlocaleanMe; stats.passedCount = result.studentsPassed; stats.failedCount = result.studentsFailed; stats.totalStudents = result.totalStudents; diff --git a/src/lib/functions/courseExam/courseInfo/courseInfo.js b/src/lib/functions/courseExam/courseInfo/courseInfo.js index 3c13252b..2fd1967f 100644 --- a/src/lib/functions/courseExam/courseInfo/courseInfo.js +++ b/src/lib/functions/courseExam/courseInfo/courseInfo.js @@ -1,5 +1,8 @@ - import { neoUniversisGet } from "$lib/dataService" + import { neoUniversisGet } from "$lib/dataService" + import { locale } from "$src/lib/i18n"; + import { localize } from "../../localize"; + import { get } from 'svelte/store' let courses; let registrations; @@ -42,7 +45,7 @@ // Getting an array with courses - courses = (await neoUniversisGet("students/me/courses?$top=-1",{lifetime: 600})).value; + courses = (await neoUniversisGet("students/me/courses?$expand=gradePeriod($expand=locale),courseType($expand=locale)&$top=-1",{lifetime: 600})).value; // Getting an array with user's registered courses and information about them registrations = (await neoUniversisGet("students/me/Registrations?$expand=classes($expand=courseType($expand=locale),courseClass($expand=course($expand=locale),instructors($expand=instructor($select=InstructorSummary))))&$top=-1&$skip=0&$count=false",{lifetime: 600})).value; @@ -50,20 +53,21 @@ console.log(registrations) // Finding the course and storing informations about it in variables - + console.log(get(locale)) - + console.log(courses) for (const course of courses) { if (course.course === courseInfo){ - courseTitle = course.courseTitle; + //! Course name not localized in courses + // courseTitle = localize(course, "courseTitle", get(locale)); semester = course.semester.id; ects = course.ects; weeklyHours = course.hours; - courseType = course.courseType.abbreviation; + courseType = localize(course.courseType, "abbreviation", get(locale)); if (course.gradePeriodDescription != null) { - period = `${course.gradePeriodDescription} ${course.gradeYear.name}`; + period = `${course.gradePeriodDescription} ${localize(course.gradeYear, "name", get(locale))}`; } season = course.lastRegistrationPeriod.name; @@ -74,13 +78,15 @@ // console.log(semClass.courseClass.course.id) // console.log(courseInfo) if(semClass.courseClass.course.id == courseInfo){ + courseTitle = localize(semClass.courseClass.course, "name", get(locale)) semClass.identifier let newCourseObject = await fetch(`https://courses.auth.gr/services/course-catalogue/v1p1/qa/CourseOutlines/${semClass.courseClass.identifier}?$top=1&$skip=0&$count=false`) let newCourseData; if(newCourseObject.ok) { newCourseData = await newCourseObject.json() - syllabus = newCourseData.content - eudoxus = newCourseData.eudoxus + console.log(newCourseData) + syllabus = localize(newCourseData, "content", get(locale)) + eudoxus = localize(newCourseData, "eudoxus", get(locale)) //debug //console.log(syllabus) //console.log(eudoxus) @@ -105,7 +111,7 @@ for (const classes of semester.classes){ if (classes.course === courseInfo){ for (const instructor of classes.courseClass.instructors){ - courseInstructors.push({familyName: instructor.instructor.familyName, givenName: instructor.instructor.givenName}); + courseInstructors.push({familyName: localize(instructor.instructor, "familyName", get(locale)), givenName: localize(instructor.instructor, "givenName", get(locale))}); } flag = true; } diff --git a/src/lib/functions/localize.ts b/src/lib/functions/localize.ts new file mode 100644 index 00000000..55f28090 --- /dev/null +++ b/src/lib/functions/localize.ts @@ -0,0 +1,8 @@ +type index = "courseTitle" | "name" /*Both in courseClass.course.name and courseType.name */ | "abbreviation" | "semester" | "period" | "familyName" | "givenName" | "content" | "eudoxus"; + +export function localize(obj: any, field: index, lang = 'el') { + if (lang === 'en' && obj.locale?.inLanguage === 'en') { + return obj.locale[field] ?? obj[field]; + } + return obj[field]; +} \ No newline at end of file From f16c394b55e332f8ebf7a31c32eb6868b0e8eae4 Mon Sep 17 00:00:00 2001 From: Panagiotis Skoulis Date: Wed, 17 Dec 2025 22:09:58 +0200 Subject: [PATCH 08/23] minor bug fix --- src/lib/components/courses/coursePage.svelte | 2 +- src/lib/functions/courseExam/courseStats/statistics.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/components/courses/coursePage.svelte b/src/lib/components/courses/coursePage.svelte index cf7cecec..b0a0ed9a 100644 --- a/src/lib/components/courses/coursePage.svelte +++ b/src/lib/components/courses/coursePage.svelte @@ -86,7 +86,7 @@ stats.grade = result.myGrade; stats.studentsLikeMe = result.studentsLikeMe; stats.studentsBetterThanMe = result.studentsBetterThanMe; - stats.studentsWorseThanMe = result.studentsWorseThlocaleanMe; + stats.studentsWorseThanMe = result.studentsWorseThanMe; stats.passedCount = result.studentsPassed; stats.failedCount = result.studentsFailed; stats.totalStudents = result.totalStudents; diff --git a/src/lib/functions/courseExam/courseStats/statistics.js b/src/lib/functions/courseExam/courseStats/statistics.js index 0dfbc171..dc6780df 100644 --- a/src/lib/functions/courseExam/courseStats/statistics.js +++ b/src/lib/functions/courseExam/courseStats/statistics.js @@ -118,6 +118,7 @@ export async function statistics(courseCode) { topPercent: topPercent }; + console.log(studentsWorseThanMe) return stats; } catch (error) { From 431b22b800239e6ef5b047ccca3fdd20de3e60f2 Mon Sep 17 00:00:00 2001 From: Panagiotis Skoulis Date: Thu, 18 Dec 2025 16:42:15 +0200 Subject: [PATCH 09/23] expanded localization --- src/lib/components/courses/courseInfo.svelte | 8 ++++- .../components/personalInfo/infoItem.svelte | 34 ++++++++++++++++--- .../coursePerSemester/coursesPerSemester.ts | 2 +- src/lib/translations/translations.js | 4 +++ src/routes/pages/personalInfo/+page.svelte | 20 ++++++----- 5 files changed, 54 insertions(+), 14 deletions(-) diff --git a/src/lib/components/courses/courseInfo.svelte b/src/lib/components/courses/courseInfo.svelte index 20ec283b..5effe20c 100644 --- a/src/lib/components/courses/courseInfo.svelte +++ b/src/lib/components/courses/courseInfo.svelte @@ -163,7 +163,13 @@ {$t("course.period")} - {course.season} + + {#if course.season == "ΧΕΙΜ"} + {$t("course.winter_period")} + {:else if course.season == "ΕΑΡ"} + {$t("course.summer_period")} + {/if} + {$t("course.weekly_hours")} diff --git a/src/lib/components/personalInfo/infoItem.svelte b/src/lib/components/personalInfo/infoItem.svelte index 85aa8607..77f9cf0b 100644 --- a/src/lib/components/personalInfo/infoItem.svelte +++ b/src/lib/components/personalInfo/infoItem.svelte @@ -5,9 +5,20 @@ import { Clipboard } from '@capacitor/clipboard'; import { toastController } from 'ionic-svelte'; import type { ToastOptions } from '@ionic/core'; + import {locale} from '$lib/i18n' + import {get} from 'svelte/store' export let gender: String; - gender = gender === 'Α' ? 'Άντρας' : 'Γυναίκα'; + console.log(get(locale)) + if(get(locale) == "el"){ + gender = gender == 'Α' ? 'Άντρας' : 'Γυναίκα'; + console.log(gender) + } + else { + console.log(gender.charCodeAt(0)) + gender = gender.charCodeAt(0) == 65 || gender.charCodeAt(0) == 913 ? "Male" : "Female"; + console.log(gender) + } export let username: String; export let familyName: String; export let givenName: String; @@ -18,7 +29,23 @@ export let email: String; export let departmentName: String; export let semester: String; - semester = `${semester}ο Εξάμηνο`; + if(get(locale) == "el")semester = `${semester}ο Εξάμηνο`; + else{ + switch(String(semester)){ + case "1": + semester = `${semester}st Semester` + break; + case "2": + semester = `${semester}nd Semester` + break; + case "3": + semester = `${semester}rd Semester` + break; + default: + semester = `${semester}th Semester` + break; + } + } export let study_level: String; export let deptSecretaryEmail: String; export let academicId: String; @@ -50,7 +77,7 @@ - {#if gender === 'Άντρας'} + {#if gender === 'Άντρας' || 'Male'} man {:else} woman @@ -122,7 +149,6 @@ {#if gender} - {gender} {/if} diff --git a/src/lib/functions/coursePerSemester/coursesPerSemester.ts b/src/lib/functions/coursePerSemester/coursesPerSemester.ts index f065d525..8356cbd2 100644 --- a/src/lib/functions/coursePerSemester/coursesPerSemester.ts +++ b/src/lib/functions/coursePerSemester/coursesPerSemester.ts @@ -26,7 +26,7 @@ export async function coursesPerSemester(subjectsJSON: course[] | null | undefin return 0; }); - + console.log(subjects) // Group the courses by semester. If the current course has a parent property, it will be grouped with the parent course by adding a childCourses property to the parent course, otherwise it will be grouped by itself diff --git a/src/lib/translations/translations.js b/src/lib/translations/translations.js index 1d6839e9..b66a63f2 100644 --- a/src/lib/translations/translations.js +++ b/src/lib/translations/translations.js @@ -201,6 +201,8 @@ export default { "course.no_stats": "Δεν υπάρχουν στατιστικά για την εξεταστική ακόμη", "course.dist": "Κατανομή Βαθμολογίας", "course.title": "Πληροφορίες", + 'course.winter_period': 'ΧΕΙΜ', + 'course.summer_period': 'ΕΑΡ', "credential.header": "Είναι ασφαλή τα στοιχεία μου;", "credential.subheader": "Πάντα!", 'credential.title': 'Σύνδεση Webmail', @@ -448,6 +450,8 @@ export default { 'course.no_stats': 'No statistics for the exam period yet', 'course.dist': 'Grade distribution', 'course.title': 'Information', + 'course.winter_period': 'WIN', + 'course.summer_period': 'SUM', 'credential.header': 'Is my data safe?', 'credential.subheader': 'Always!', 'credential.message': diff --git a/src/routes/pages/personalInfo/+page.svelte b/src/routes/pages/personalInfo/+page.svelte index 1152287d..247233ee 100644 --- a/src/routes/pages/personalInfo/+page.svelte +++ b/src/routes/pages/personalInfo/+page.svelte @@ -9,6 +9,8 @@ import ErrorLandingCard from '$components/errorLanding/ErrorLandingCard.svelte'; import { userCredsFlag } from '$components/webmailLogin/userCredsFlagStore'; import { t, locale, locales } from '$lib/i18n'; + import {get} from 'svelte/store' + import { localize } from '$src/lib/functions/localize'; // Keep personal info @@ -32,12 +34,12 @@ async function getPersonalInfo() { let personalData = await neoUniversisGet( - 'Students/me?$expand=studyProgram($expand=studyLevel), department', + 'Students/me?$expand=studyProgram($expand=studyLevel($expand=locale),department($expand=locale)),person($expand=locale)', { lifetime: 86000 } ); let user = await neoUniversisGet('Users/me', { lifetime: 86000 }); - console.log(user) + console.log(user) //Access denied console.log(personalData) aem = personalData.studentIdentifier; apm = personalData.uniqueIdentifier; @@ -46,12 +48,14 @@ birthDate = personalData.person.birthDate.slice(0, 10); email = personalData.person.email; username = user.name; - familyName = personalData.person.familyName; - givenName = personalData.person.givenName; - gender = personalData.person.gender; - departmentName = personalData.department.abbreviation; - semester = personalData.semester; - study_level = personalData.studyProgram.studyLevel.name; + familyName = localize(personalData.person, "familyName", get(locale)); + givenName = localize(personalData.person, "givenName", get(locale)); + gender = personalData.person.gender; //! + console.log(gender) + departmentName = localize(personalData.studyProgram.department, "name", get(locale)); + semester = personalData.semester; //! + console.log(semester) + study_level = localize(personalData.studyProgram.studyLevel, "name", get(locale)); deptSecretaryEmail = personalData.department.email; academicId = personalData.academicId; } From 3a632f3a88ae5e5e3184c899290f0ea368c2c650 Mon Sep 17 00:00:00 2001 From: Panagiotis Skoulis Date: Thu, 18 Dec 2025 18:01:50 +0200 Subject: [PATCH 10/23] reactive lang switch --- .../components/personalInfo/infoItem.svelte | 111 ++++++++++-------- src/routes/pages/personalInfo/+page.svelte | 29 ++--- 2 files changed, 69 insertions(+), 71 deletions(-) diff --git a/src/lib/components/personalInfo/infoItem.svelte b/src/lib/components/personalInfo/infoItem.svelte index 77f9cf0b..e532baf2 100644 --- a/src/lib/components/personalInfo/infoItem.svelte +++ b/src/lib/components/personalInfo/infoItem.svelte @@ -7,48 +7,57 @@ import type { ToastOptions } from '@ionic/core'; import {locale} from '$lib/i18n' import {get} from 'svelte/store' + import {localize} from '$lib/functions/localize' - export let gender: String; - console.log(get(locale)) - if(get(locale) == "el"){ - gender = gender == 'Α' ? 'Άντρας' : 'Γυναίκα'; - console.log(gender) - } - else { - console.log(gender.charCodeAt(0)) - gender = gender.charCodeAt(0) == 65 || gender.charCodeAt(0) == 913 ? "Male" : "Female"; - console.log(gender) - } - export let username: String; - export let familyName: String; - export let givenName: String; - export let aem: String; - export let apm: String; - export let schoolGraduated: String; - export let birthDate: String; - export let email: String; - export let departmentName: String; - export let semester: String; - if(get(locale) == "el")semester = `${semester}ο Εξάμηνο`; - else{ - switch(String(semester)){ - case "1": - semester = `${semester}st Semester` - break; - case "2": - semester = `${semester}nd Semester` - break; - case "3": - semester = `${semester}rd Semester` - break; - default: - semester = `${semester}th Semester` - break; + export let personalData: any; + + + $: currentLocale = $locale; + + $: aem = personalData.studentIdentifier; + $: apm = personalData.uniqueIdentifier; + $: username = null; + $: inscriptionYear = personalData.inscriptionYear.name; + $: schoolGraduated = personalData.schoolGraduated; + $: birthDate = personalData.person.birthDate.slice(0, 10); + $: email = personalData.person.email; + //let username = user.name; + $: familyName = localize(personalData.person, "familyName", currentLocale); + $: givenName = localize(personalData.person, "givenName", currentLocale); + $: gender = (() => { + const g = personalData?.person?.gender; + if (!g) return ''; + + const isMale = g === 'Α' || g.charCodeAt(0) === 913; + + if (currentLocale === 'el') { + return isMale ? 'Άντρας' : 'Γυναίκα'; } - } - export let study_level: String; - export let deptSecretaryEmail: String; - export let academicId: String; + + return isMale ? 'Male' : 'Female'; + })(); + + //console.log(gender) + $: departmentName = localize(personalData.studyProgram.department, "name", currentLocale); + $: semester = (() => { + const s = personalData?.semester; + if (!s) return ''; + + if (currentLocale === 'el') { + return `${s}ο Εξάμηνο`; + } + + const suffix = + s === 1 ? 'st' : + s === 2 ? 'nd' : + s === 3 ? 'rd' : 'th'; + + return `${s}${suffix} Semester`; + })(); + //console.log(semester) + $: study_level = localize(personalData.studyProgram.studyLevel, "name", currentLocale); + $: deptSecretaryEmail = personalData.department.email; + $: academicId = personalData.academicId; // Function to show toast async function showToast(toast: ToastOptions) { @@ -91,7 +100,7 @@ {#if username} - + writeToClipboard(username)}> {username} @@ -99,7 +108,7 @@ {/if} {#if schoolGraduated} - + writeToClipboard(schoolGraduated)}> {schoolGraduated} @@ -107,7 +116,7 @@ {/if} {#if apm} - + writeToClipboard(apm)}> {apm} @@ -115,7 +124,7 @@ {/if} {#if academicId} - + writeToClipboard(academicId)}> {academicId} @@ -123,7 +132,7 @@ {/if} {#if birthDate} - + writeToClipboard(birthDate)}> {birthDate} @@ -131,7 +140,7 @@ {/if} {#if email} - + writeToClipboard(email)}> {email} @@ -139,7 +148,7 @@ {/if} {#if deptSecretaryEmail} - + writeToClipboard(deptSecretaryEmail)}> {deptSecretaryEmail} @@ -147,14 +156,14 @@ {/if} {#if gender} - + writeToClipboard(gender)}> {gender} {/if} {#if departmentName} - + writeToClipboard(departmentName)}> {departmentName} @@ -162,7 +171,7 @@ {/if} {#if semester} - + writeToClipboard(semester)}> {semester} @@ -170,7 +179,7 @@ {/if} {#if study_level} - + writeToClipboard(study_level)} lines="none"> {study_level} diff --git a/src/routes/pages/personalInfo/+page.svelte b/src/routes/pages/personalInfo/+page.svelte index 247233ee..9f752dc8 100644 --- a/src/routes/pages/personalInfo/+page.svelte +++ b/src/routes/pages/personalInfo/+page.svelte @@ -32,15 +32,17 @@ // Get personal details and department details + let personalData: any; + async function getPersonalInfo() { - let personalData = await neoUniversisGet( + personalData = await neoUniversisGet( 'Students/me?$expand=studyProgram($expand=studyLevel($expand=locale),department($expand=locale)),person($expand=locale)', { lifetime: 86000 } ); let user = await neoUniversisGet('Users/me', { lifetime: 86000 }); console.log(user) //Access denied - console.log(personalData) + aem = personalData.studentIdentifier; apm = personalData.uniqueIdentifier; inscriptionYear = personalData.inscriptionYear.name; @@ -50,11 +52,11 @@ username = user.name; familyName = localize(personalData.person, "familyName", get(locale)); givenName = localize(personalData.person, "givenName", get(locale)); - gender = personalData.person.gender; //! - console.log(gender) + gender = personalData.person.gender; + //console.log(gender) departmentName = localize(personalData.studyProgram.department, "name", get(locale)); - semester = personalData.semester; //! - console.log(semester) + semester = personalData.semester; + //console.log(semester) study_level = localize(personalData.studyProgram.studyLevel, "name", get(locale)); deptSecretaryEmail = personalData.department.email; academicId = personalData.academicId; @@ -86,20 +88,7 @@ {:then} {:catch error} From e3d20cc68c14f4ec5149b05b6b53693e8925cc78 Mon Sep 17 00:00:00 2001 From: Panagiotis Skoulis Date: Thu, 18 Dec 2025 18:19:58 +0200 Subject: [PATCH 11/23] fixed endless reqs --- .../components/personalInfo/infoItem.svelte | 20 ++--- src/routes/pages/personalInfo/+page.svelte | 75 ++++++------------- 2 files changed, 31 insertions(+), 64 deletions(-) diff --git a/src/lib/components/personalInfo/infoItem.svelte b/src/lib/components/personalInfo/infoItem.svelte index e532baf2..9d76c2a9 100644 --- a/src/lib/components/personalInfo/infoItem.svelte +++ b/src/lib/components/personalInfo/infoItem.svelte @@ -14,16 +14,16 @@ $: currentLocale = $locale; - $: aem = personalData.studentIdentifier; - $: apm = personalData.uniqueIdentifier; + $: aem = personalData?.studentIdentifier; + $: apm = personalData?.uniqueIdentifier; $: username = null; - $: inscriptionYear = personalData.inscriptionYear.name; - $: schoolGraduated = personalData.schoolGraduated; - $: birthDate = personalData.person.birthDate.slice(0, 10); - $: email = personalData.person.email; + $: inscriptionYear = personalData?.inscriptionYear.name; + $: schoolGraduated = personalData?.schoolGraduated; + $: birthDate = personalData?.person.birthDate.slice(0, 10); + $: email = personalData?.person.email; //let username = user.name; - $: familyName = localize(personalData.person, "familyName", currentLocale); - $: givenName = localize(personalData.person, "givenName", currentLocale); + $: familyName = localize(personalData?.person, "familyName", currentLocale); + $: givenName = localize(personalData?.person, "givenName", currentLocale); $: gender = (() => { const g = personalData?.person?.gender; if (!g) return ''; @@ -38,7 +38,7 @@ })(); //console.log(gender) - $: departmentName = localize(personalData.studyProgram.department, "name", currentLocale); + $: departmentName = localize(personalData?.studyProgram.department, "name", currentLocale); $: semester = (() => { const s = personalData?.semester; if (!s) return ''; @@ -86,7 +86,7 @@ - {#if gender === 'Άντρας' || 'Male'} + {#if gender === 'Άντρας' || gender === 'Male'} man {:else} woman diff --git a/src/routes/pages/personalInfo/+page.svelte b/src/routes/pages/personalInfo/+page.svelte index 9f752dc8..bd04287f 100644 --- a/src/routes/pages/personalInfo/+page.svelte +++ b/src/routes/pages/personalInfo/+page.svelte @@ -9,58 +9,25 @@ import ErrorLandingCard from '$components/errorLanding/ErrorLandingCard.svelte'; import { userCredsFlag } from '$components/webmailLogin/userCredsFlagStore'; import { t, locale, locales } from '$lib/i18n'; - import {get} from 'svelte/store' - import { localize } from '$src/lib/functions/localize'; - + import {onMount} from 'svelte' // Keep personal info - - let aem: String = ''; - let apm: String = ''; - let inscriptionYear: String = ''; - let schoolGraduated: String = ''; - let birthDate: String = ''; - let email: String = ''; - let familyName: String = ''; - let givenName: String = ''; - let username: String = ''; - let gender: String = ''; - let departmentName: String = ''; - let semester: String = ''; - let study_level: String = ''; - let deptSecretaryEmail: String = ''; - let academicId: String = ''; - // Get personal details and department details + let personalData: any = null; + let loading = true; + let error: any = null; - let personalData: any; - - async function getPersonalInfo() { - personalData = await neoUniversisGet( - 'Students/me?$expand=studyProgram($expand=studyLevel($expand=locale),department($expand=locale)),person($expand=locale)', - { lifetime: 86000 } - ); - - let user = await neoUniversisGet('Users/me', { lifetime: 86000 }); - console.log(user) //Access denied - - aem = personalData.studentIdentifier; - apm = personalData.uniqueIdentifier; - inscriptionYear = personalData.inscriptionYear.name; - schoolGraduated = personalData.schoolGraduated; - birthDate = personalData.person.birthDate.slice(0, 10); - email = personalData.person.email; - username = user.name; - familyName = localize(personalData.person, "familyName", get(locale)); - givenName = localize(personalData.person, "givenName", get(locale)); - gender = personalData.person.gender; - //console.log(gender) - departmentName = localize(personalData.studyProgram.department, "name", get(locale)); - semester = personalData.semester; - //console.log(semester) - study_level = localize(personalData.studyProgram.studyLevel, "name", get(locale)); - deptSecretaryEmail = personalData.department.email; - academicId = personalData.academicId; - } + onMount(async () => { + try { + personalData = await neoUniversisGet( + 'Students/me?$expand=studyProgram($expand=studyLevel($expand=locale),department($expand=locale)),person($expand=locale)', + { lifetime: 86000 } + ); + } catch (err) { + error = err; + } finally { + loading = false; + } + }); // Log out function logOut() { @@ -84,15 +51,15 @@ - {#await getPersonalInfo()} + {#if loading} - {:then} + {:else if error} + + {:else} - {:catch error} - - {/await} + {/if} From 6aeb01cae55004d5f11339e5fdf7db75bcf2415c Mon Sep 17 00:00:00 2001 From: Panagiotis Skoulis Date: Fri, 19 Dec 2025 18:10:17 +0200 Subject: [PATCH 12/23] implemented localized course type --- .../components/degreeCalculator/card.svelte | 7 ++++-- .../components/degreeCalculator/course.svelte | 18 +++++++++++++-- src/lib/components/grades/gradeCard.svelte | 8 ++++--- .../courseExam/courseInfo/courseInfo.js | 7 +----- .../coursePerSemester/coursesPerSemester.ts | 23 +++++++++++++------ .../functions/degreeCalculator/fetchData.js | 21 +++++++++++++---- src/lib/functions/degreeCalculator/main.js | 2 +- src/lib/types/courseType.ts | 6 +++++ 8 files changed, 66 insertions(+), 26 deletions(-) diff --git a/src/lib/components/degreeCalculator/card.svelte b/src/lib/components/degreeCalculator/card.svelte index e498143f..3387e44e 100644 --- a/src/lib/components/degreeCalculator/card.svelte +++ b/src/lib/components/degreeCalculator/card.svelte @@ -15,16 +15,19 @@ import { fade } from 'svelte/transition'; import { courseAdded, customCourses } from './courseStore.ts'; import { get } from 'svelte/store'; + import { localize } from '$src/lib/functions/localize.js'; + import {locale} from "$lib/i18n.js" export let flip; let unpassed_courses: { - title: string; + name: string; id: string; semester_id: number; semester_name: string; grade: number; input_grade: string; coefficient: number; + locale: any; }[] = []; // Define the degree_grade object to store the average grades for the custom courses @@ -96,7 +99,7 @@ {#each unpassed_courses as course}
diff --git a/src/lib/components/degreeCalculator/course.svelte b/src/lib/components/degreeCalculator/course.svelte index 8b4d67da..0c0a70da 100644 --- a/src/lib/components/degreeCalculator/course.svelte +++ b/src/lib/components/degreeCalculator/course.svelte @@ -1,10 +1,20 @@ - @@ -13,7 +23,11 @@
{course_title}
{#if course_semester_id <= 24} -

{course_semester_id}ο Εξάμηνο

+ {#if get(locale) == "el"} +

{course_semester_id}ο Εξάμηνο

+ {:else} +

{course_semester_id}{sem_suffix(course_semester_id)} semester

+ {/if} {:else}

{course_semester_name}

{/if} diff --git a/src/lib/components/grades/gradeCard.svelte b/src/lib/components/grades/gradeCard.svelte index 0d1f4f6d..75d9e442 100644 --- a/src/lib/components/grades/gradeCard.svelte +++ b/src/lib/components/grades/gradeCard.svelte @@ -8,7 +8,9 @@ import Course from '$components/courses/coursePage.svelte'; import { navController } from '$components/shared/StackedNav'; import { getSemester } from '$components/courses/getSemester'; - import { t, getLocale } from '$lib/i18n'; + import { t, getLocale, locale } from '$lib/i18n'; + import { get } from 'svelte/store'; + import { localize } from '$src/lib/functions/localize'; let childrenOpen: boolean[] = []; @@ -18,7 +20,7 @@ export function navigateToCourse(course: { childCourses: string | any[]; id: any }) { if (!(course.childCourses && course.childCourses.length > 0)) - navController.push(Course, { id: course.course }); + navController.push(Course, { id: course.id }); } @@ -51,7 +53,7 @@ navigateToCourse(course)} lines="none" class="ion-no-padding">
- {course.courseTitle} + {localize(course, "courseTitle" ,get(locale))} {#if course.examPeriod !== null} diff --git a/src/lib/functions/courseExam/courseInfo/courseInfo.js b/src/lib/functions/courseExam/courseInfo/courseInfo.js index 2fd1967f..7a6e217b 100644 --- a/src/lib/functions/courseExam/courseInfo/courseInfo.js +++ b/src/lib/functions/courseExam/courseInfo/courseInfo.js @@ -45,7 +45,7 @@ // Getting an array with courses - courses = (await neoUniversisGet("students/me/courses?$expand=gradePeriod($expand=locale),courseType($expand=locale)&$top=-1",{lifetime: 600})).value; + courses = (await neoUniversisGet("students/me/courses?$expand=gradePeriod($expand=locale),courseType($expand=locale),course($expand=locale)&$top=-1",{lifetime: 600})).value; // Getting an array with user's registered courses and information about them registrations = (await neoUniversisGet("students/me/Registrations?$expand=classes($expand=courseType($expand=locale),courseClass($expand=course($expand=locale),instructors($expand=instructor($select=InstructorSummary))))&$top=-1&$skip=0&$count=false",{lifetime: 600})).value; @@ -53,11 +53,6 @@ console.log(registrations) // Finding the course and storing informations about it in variables - console.log(get(locale)) - - - - console.log(courses) for (const course of courses) { if (course.course === courseInfo){ //! Course name not localized in courses diff --git a/src/lib/functions/coursePerSemester/coursesPerSemester.ts b/src/lib/functions/coursePerSemester/coursesPerSemester.ts index 8356cbd2..e2dc4d64 100644 --- a/src/lib/functions/coursePerSemester/coursesPerSemester.ts +++ b/src/lib/functions/coursePerSemester/coursesPerSemester.ts @@ -1,18 +1,21 @@ import { neoUniversisGet } from '$lib/dataService'; -import type {course} from '$lib/types/courseType'; +import type {course, localized_course} from '$lib/types/courseType'; // returns the courses for each semester export async function coursesPerSemester(subjectsJSON: course[] | null | undefined = null) { - let subjects: course[]; - let courseBySemester: { [key: string]: course[] } = {}; + let subjects: course[] + let registrations: any; + let courseBySemester: { [key: string]: localized_course[] } = {}; if (subjectsJSON) { subjects = subjectsJSON; + registrations = (await neoUniversisGet("students/me/Registrations?$expand=classes($expand=courseType($expand=locale),courseClass($expand=course($expand=locale),instructors($expand=instructor($select=InstructorSummary))))&$top=-1&$skip=0&$count=false",{lifetime: 600})).value; } else { - subjects = (await neoUniversisGet('students/me/courses?$top=-1',{lifetime: 600})).value; + subjects = (await neoUniversisGet('students/me/courses?$expand=examPeriod($expand=locales)&$top=-1',{lifetime: 600})).value; + registrations = (await neoUniversisGet("students/me/Registrations?$expand=classes($expand=courseType($expand=locale),courseClass($expand=course($expand=locale),instructors($expand=instructor($select=InstructorSummary))))&$top=-1&$skip=0&$count=false",{lifetime: 600})).value; } // Sort courses by parentCourse property. First should be the courses with no parentCourse property @@ -26,7 +29,7 @@ export async function coursesPerSemester(subjectsJSON: course[] | null | undefin return 0; }); - console.log(subjects) + //console.log(subjects) // Group the courses by semester. If the current course has a parent property, it will be grouped with the parent course by adding a childCourses property to the parent course, otherwise it will be grouped by itself @@ -59,11 +62,17 @@ export async function coursesPerSemester(subjectsJSON: course[] | null | undefin if (!courseBySemester[semester]) { courseBySemester[semester] = []; } - courseBySemester[semester].push(course); + for(const sem of registrations){ + for(const semClass of sem.classes){ + if(semClass.courseClass.course.id == course.course){ + courseBySemester[semester].push({...course, locale: {inLanguage: "en", courseTitle: semClass.courseClass.course.locale.name}}); + } + } + } } } - + console.log(courseBySemester) return courseBySemester; }; \ No newline at end of file diff --git a/src/lib/functions/degreeCalculator/fetchData.js b/src/lib/functions/degreeCalculator/fetchData.js index 85abff96..529ca9a9 100644 --- a/src/lib/functions/degreeCalculator/fetchData.js +++ b/src/lib/functions/degreeCalculator/fetchData.js @@ -1,7 +1,7 @@ import { neoUniversisGet } from "$lib/dataService"; /** - * @param { {title: string, id: string, semester_id: number, semester_name: string, grade: number, input_grade: string, coefficient: number;}[] } unpassed_courses + * @param { {name: string, id: string, semester_id: number, semester_name: string, grade: number, input_grade: string, coefficient: number, locale: any;}[] } unpassed_courses * @param { {based: {grade_sum: number, coefficient: any;}, simple: {grade_sum: number, passed: number;}; } } sums */ export async function fetchData(unpassed_courses, sums) @@ -11,12 +11,15 @@ export async function fetchData(unpassed_courses, sums) let courses = (await neoUniversisGet("students/me/courses?$top=-1", {lifetime: 60 * 5})).value; + let registrations = (await neoUniversisGet("students/me/Registrations?$expand=classes($expand=courseType($expand=locale),courseClass($expand=course($expand=locale),instructors($expand=instructor($select=InstructorSummary))))&$top=-1&$skip=0&$count=false",{lifetime: 600})).value; + courses.sort((/** @type {{ semester: { id: number; }; }} */ a, /** @type {{ semester: { id: number; }; }} */ b) => a.semester.id - b.semester.id); courses = courses.filter((/** @type {{ calculateGrade: number; }} */ course) => course.calculateGrade == 1); + console.log(courses) for (const course of courses) { - if (course.isPassed == 1) + if (course.isPassed === 1) { sums.based.grade_sum += course.grade * course.coefficient * 10; sums.based.coefficient += course.coefficient; @@ -27,8 +30,16 @@ export async function fetchData(unpassed_courses, sums) continue; } not_passed_all_courses = true; - unpassed_courses.push({ title: course.courseTitle, id: course.id, semester_id: course.semester.id, semester_name: course.semester.name, grade: course.grade, input_grade: "", coefficient: course.coefficient}); - } - + console.log(course.course) + for(const reg of registrations){ + for(const semClass of reg.classes){ + //debug + if(semClass.courseClass.course.id == course.course){ + console.log(semClass.courseClass.course.id) + unpassed_courses.push({ name: course.courseTitle, id: course.id, semester_id: course.semester.id, semester_name: course.semester.name, grade: course.grade, input_grade: "", coefficient: course.coefficient, locale: semClass.courseClass.course.locale}); + } + } + } + } return not_passed_all_courses; } \ No newline at end of file diff --git a/src/lib/functions/degreeCalculator/main.js b/src/lib/functions/degreeCalculator/main.js index c12253f5..2e782717 100644 --- a/src/lib/functions/degreeCalculator/main.js +++ b/src/lib/functions/degreeCalculator/main.js @@ -2,7 +2,7 @@ import { fetchData } from './fetchData.js'; import { degreeGradeUpdate } from './degreeGradeUpdate.js'; /** - * @param { { title: string, id: string, semester_id: number, semester_name: string, grade: number, input_grade: string, coefficient: number; }[] } unpassed_courses + * @param { { name: string, id: string, semester_id: number, semester_name: string, grade: number, input_grade: string, coefficient: number, locale: any; }[] } unpassed_courses * @param { { based: { grade_sum:number, coefficient: number}, simple: {grade_sum: number, passed: number}; } } sums * @param { { based: {value: number, stringed: string}, simple: {value: number, stringed: string}; } } degree_grade */ diff --git a/src/lib/types/courseType.ts b/src/lib/types/courseType.ts index a1833210..fd8201f8 100644 --- a/src/lib/types/courseType.ts +++ b/src/lib/types/courseType.ts @@ -164,3 +164,9 @@ export type course = { "studyProgramSpecialty": "string", "childCourses"?: course[] } + + export type localized_course = course & { + locale?: { + inLanguage: 'el' | 'en'; + courseTitle?: string; + }} \ No newline at end of file From 7e2c641642efe92102899da0793ee098e869ad21 Mon Sep 17 00:00:00 2001 From: Panagiotis Skoulis Date: Sat, 20 Dec 2025 10:15:29 +0200 Subject: [PATCH 13/23] grades page translated --- src/lib/components/grades/gradeCard.svelte | 31 ++++++++++++++++--- src/lib/components/grades/grades.svelte | 7 ++--- .../components/personalInfo/infoItem.svelte | 2 +- .../coursePerSemester/coursesPerSemester.ts | 1 - .../functions/degreeCalculator/fetchData.js | 6 ++-- src/lib/translations/translations.js | 6 ++++ 6 files changed, 39 insertions(+), 14 deletions(-) diff --git a/src/lib/components/grades/gradeCard.svelte b/src/lib/components/grades/gradeCard.svelte index 75d9e442..dd58d33c 100644 --- a/src/lib/components/grades/gradeCard.svelte +++ b/src/lib/components/grades/gradeCard.svelte @@ -58,7 +58,14 @@ {#if course.examPeriod !== null} {#if course.examPeriod && course.gradeYear} - {course.examPeriod.name} {course.gradeYear.name} + {#if course.examPeriod.name == "ΦΕΒΡΟΥΑΡΙΟΣ"} + {$t("course.exam_winter_period")} + {:else if course.examPeriod.name == "ΙΟΥΝΙΟΣ"} + {$t("course.exam_summer_period")} + {:else if course.examPeriod.name == "ΣΕΠΤΕΜΒΡΙΟΣ"} + {$t("course.exam_autumn_period")} + {/if} + {course.gradeYear.name} {:else} {$t('progress.declared')} {/if} @@ -84,12 +91,19 @@
- {course.courseTitle} + {localize(course, "courseTitle", get(locale))} {#if course.examPeriod !== null} {#if course.examPeriod && course.gradeYear} - {course.examPeriod.name} {course.gradeYear.name} + {#if course.examPeriod.name == "ΦΕΒΡΟΥΑΡΙΟΣ"} + {$t("course.exam_winter_period")} + {:else if course.examPeriod.name == "ΙΟΥΝΙΟΣ"} + {$t("course.exam_summer_period")} + {:else if course.examPeriod.name == "ΣΕΠΤΕΜΒΡΙΟΣ"} + {$t("course.exam_autumn_period")} + {/if} + {course.gradeYear.name} {:else} {$t('progress.declared')} {/if} @@ -123,12 +137,19 @@
{childCourse.courseTitle}{localize(childCourse, "courseTitle", get(locale))} {#if childCourse.examPeriod !== null} {#if childCourse.examPeriod && childCourse.gradeYear} - {childCourse.examPeriod.name} {childCourse.gradeYear.name} + {#if childCourse.examPeriod.name == "ΦΕΒΡΟΥΑΡΙΟΣ"} + {$t("course.exam_winter_period")} + {:else if childCourse.examPeriod.name == "ΙΟΥΝΙΟΣ"} + {$t("course.exam_summer_period")} + {:else if childCourse.examPeriod.name == "ΣΕΠΤΕΜΒΡΙΟΣ"} + {$t("course.exam_autumn_period")} + {/if} + {childCourse.gradeYear.name} {:else} {$t('progress.declared')} {/if} diff --git a/src/lib/components/grades/grades.svelte b/src/lib/components/grades/grades.svelte index 889faec7..dce5b985 100644 --- a/src/lib/components/grades/grades.svelte +++ b/src/lib/components/grades/grades.svelte @@ -9,10 +9,9 @@ {#each $filteredSubjects as semester} - - {#if semester.courses.length > 0} - - {/if} + {#if semester.courses.length > 0} + + {/if} {/each} diff --git a/src/lib/components/personalInfo/infoItem.svelte b/src/lib/components/personalInfo/infoItem.svelte index 9d76c2a9..5ae89a4b 100644 --- a/src/lib/components/personalInfo/infoItem.svelte +++ b/src/lib/components/personalInfo/infoItem.svelte @@ -56,7 +56,7 @@ })(); //console.log(semester) $: study_level = localize(personalData.studyProgram.studyLevel, "name", currentLocale); - $: deptSecretaryEmail = personalData.department.email; + $: deptSecretaryEmail = personalData?.studyProgram.department.email; $: academicId = personalData.academicId; // Function to show toast diff --git a/src/lib/functions/coursePerSemester/coursesPerSemester.ts b/src/lib/functions/coursePerSemester/coursesPerSemester.ts index e2dc4d64..c7f79f89 100644 --- a/src/lib/functions/coursePerSemester/coursesPerSemester.ts +++ b/src/lib/functions/coursePerSemester/coursesPerSemester.ts @@ -72,7 +72,6 @@ export async function coursesPerSemester(subjectsJSON: course[] | null | undefin } } - console.log(courseBySemester) return courseBySemester; }; \ No newline at end of file diff --git a/src/lib/functions/degreeCalculator/fetchData.js b/src/lib/functions/degreeCalculator/fetchData.js index 529ca9a9..1b8e9cce 100644 --- a/src/lib/functions/degreeCalculator/fetchData.js +++ b/src/lib/functions/degreeCalculator/fetchData.js @@ -30,13 +30,13 @@ export async function fetchData(unpassed_courses, sums) continue; } not_passed_all_courses = true; - console.log(course.course) + //console.log(course.course) for(const reg of registrations){ for(const semClass of reg.classes){ //debug if(semClass.courseClass.course.id == course.course){ - console.log(semClass.courseClass.course.id) - unpassed_courses.push({ name: course.courseTitle, id: course.id, semester_id: course.semester.id, semester_name: course.semester.name, grade: course.grade, input_grade: "", coefficient: course.coefficient, locale: semClass.courseClass.course.locale}); + //console.log(semClass.courseClass.course.id) + unpassed_courses.push({ name: course.courseTitle, id: course.id, semester_id: course.semester.id, semester_name: course.semester.name, grade: course.grade, input_grade: "", coefficient: course.coefficient, locale: semClass.courseClass.course.locale}); } } } diff --git a/src/lib/translations/translations.js b/src/lib/translations/translations.js index b66a63f2..7327b5a3 100644 --- a/src/lib/translations/translations.js +++ b/src/lib/translations/translations.js @@ -203,6 +203,9 @@ export default { "course.title": "Πληροφορίες", 'course.winter_period': 'ΧΕΙΜ', 'course.summer_period': 'ΕΑΡ', + 'course.exam_winter_period': 'ΦΕΒΡΟΥΑΡΙΟΣ', + 'course.exam_summer_period': 'ΙΟΥΝΙΟΣ', + 'course.exam_autumn_period': 'ΣΕΠΤΕΜΒΡΙΟΣ', "credential.header": "Είναι ασφαλή τα στοιχεία μου;", "credential.subheader": "Πάντα!", 'credential.title': 'Σύνδεση Webmail', @@ -452,6 +455,9 @@ export default { 'course.title': 'Information', 'course.winter_period': 'WIN', 'course.summer_period': 'SUM', + 'course.exam_winter_period': 'FEBUARY', + 'course.exam_summer_period': 'JUNE', + 'course.exam_autumn_period': 'SEPTEMBER', 'credential.header': 'Is my data safe?', 'credential.subheader': 'Always!', 'credential.message': From 2a7e2f27a6baf89f6fab2152f28a21b01477e98d Mon Sep 17 00:00:00 2001 From: Panagiotis Skoulis Date: Sat, 20 Dec 2025 11:00:14 +0200 Subject: [PATCH 14/23] translation done --- .../recentResults/gatherRecentGrades.ts | 1 - .../recentResults/recentGrades.svelte | 6 ++++-- src/routes/pages/homepage/homepage.svelte | 19 +++++++++++++++---- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/lib/components/recentResults/gatherRecentGrades.ts b/src/lib/components/recentResults/gatherRecentGrades.ts index e1497cd1..038c4c7a 100644 --- a/src/lib/components/recentResults/gatherRecentGrades.ts +++ b/src/lib/components/recentResults/gatherRecentGrades.ts @@ -15,6 +15,5 @@ export async function gatherRecentGrades(refresh: boolean = false){ // getting recent grades based on the current exam period recentGrades = (await neoUniversisGet('students/me/grades?$filter=courseExam/year eq ' + currentYear + ' and courseExam/examPeriod eq ' + currentPeriod + '&$expand=course($expand=gradeScale,locale),courseClass($expand=instructors($expand=instructor($select=InstructorSummary))),courseExam($expand=examPeriod,year)&$top=-1&$count=false', options)).value; } - return recentGrades; } \ No newline at end of file diff --git a/src/lib/components/recentResults/recentGrades.svelte b/src/lib/components/recentResults/recentGrades.svelte index 3857763b..49605e27 100644 --- a/src/lib/components/recentResults/recentGrades.svelte +++ b/src/lib/components/recentResults/recentGrades.svelte @@ -1,7 +1,9 @@ From 82ab612a49b7111dc8fd63f20555c5d4563d42ba Mon Sep 17 00:00:00 2001 From: Panagiotis Skoulis Date: Sun, 21 Dec 2025 00:36:43 +0200 Subject: [PATCH 19/23] fixed redundant typescript errors, and Infopage breaking when changing locale --- src/lib/components/language/Modal.svelte | 5 +++-- src/lib/components/personalInfo/settings.svelte | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/lib/components/language/Modal.svelte b/src/lib/components/language/Modal.svelte index f7118e3a..b8da8533 100644 --- a/src/lib/components/language/Modal.svelte +++ b/src/lib/components/language/Modal.svelte @@ -1,5 +1,5 @@ diff --git a/src/lib/components/grades/gradesPage.svelte b/src/lib/components/grades/gradesPage.svelte index 86f37db6..cee19917 100644 --- a/src/lib/components/grades/gradesPage.svelte +++ b/src/lib/components/grades/gradesPage.svelte @@ -56,9 +56,10 @@ */ // Search - function handleChange(event: { target: { value: string } }) { - searchQuery = event.target.value; - } + function handleChange(event: any) { + // Ionic Searchbar emits a CustomEvent with detail.value (string | null); normalize to a string + searchQuery = event?.detail?.value ?? ''; + } // Flipper toggle function flip() { diff --git a/src/lib/components/grades/statsCard.svelte b/src/lib/components/grades/statsCard.svelte index 7e27906e..de8fd76d 100644 --- a/src/lib/components/grades/statsCard.svelte +++ b/src/lib/components/grades/statsCard.svelte @@ -22,12 +22,12 @@ export let flip; /** - * @type {null | undefined} + * @type {number | null | undefined} */ export let subjectsJSON; /** - * @type {Chart<"line", number[], string>} + * @type {Chart<"line", number[], string> | string} */ let primaryColor; @@ -67,6 +67,9 @@ */ async function processAverages(subjectsJSON) { try { + /** + * @type {any} + */ const result = await averages(subjectsJSON); gradesObject.average = result.avg; gradesObject.weightedAverage = result.weighted_avg; @@ -82,6 +85,9 @@ */ async function processAveragesPerSemester(subjectsJSON) { try { + /** + * @type {any} + */ const result = await averagesPerSemester(subjectsJSON); gradesObject.averagesPerSemester = result; @@ -107,47 +113,50 @@ chart.destroy(); } if (!searchQuery.length) { - chart = new Chart(document.getElementById('gradeChart'), { - type: 'line', - data: { - labels: gradesObject.semester, - datasets: [ - { - data: gradesObject.averagesPerSemester, - fill: { - target: 'origin', - above: gradeFill - }, - tension: 0.4, - borderColor: primaryColor, // Set the color here - backgroundColor: 'primaryColor' // Optionally set the fill color - } - ] - }, - options: { - responsive: true, - scales: { - y: { - beginAtZero: false, - grid: { - display: false + const chartElement = document.getElementById('gradeChart'); + if (chartElement) { + chart = new Chart(/** @type {HTMLCanvasElement} */ (chartElement), { + type: 'line', + data: { + labels: gradesObject.semester, + datasets: [ + { + data: gradesObject.averagesPerSemester, + fill: { + target: 'origin', + above: gradeFill + }, + tension: 0.4, + borderColor: primaryColor, // Set the color here + backgroundColor: 'primaryColor' // Optionally set the fill color } - } + ] }, - plugins: { - legend: { - display: false + options: { + responsive: true, + scales: { + y: { + beginAtZero: false, + grid: { + display: false + } + } }, - title: { - display: true, - text: $t('progress.average_evolution'), - font: { - size: 15 + plugins: { + legend: { + display: false + }, + title: { + display: true, + text: $t('progress.average_evolution'), + font: { + size: 15 + } } } } - } - }); + }); + } } }); diff --git a/src/lib/components/recentResults/recentGrades.svelte b/src/lib/components/recentResults/recentGrades.svelte index 49605e27..90aa3168 100644 --- a/src/lib/components/recentResults/recentGrades.svelte +++ b/src/lib/components/recentResults/recentGrades.svelte @@ -13,8 +13,9 @@ * @param {{ childCourses: string | any[]; course: any; }} course */ export function navigateToCourse(course) { + console.log(course) if (!(course.childCourses && course.childCourses.length > 0)) - navController.push(Course, {id: course.id}); + navController.push(Course, {id: course.course.id}); } @@ -23,7 +24,7 @@ - navigateToCourse(subject.course)} class="card-link"> + navigateToCourse(subject)} class="card-link">
diff --git a/src/lib/functions/courseExam/courseInfo/courseInfo.js b/src/lib/functions/courseExam/courseInfo/courseInfo.js index 26f99e4f..3ddcec39 100644 --- a/src/lib/functions/courseExam/courseInfo/courseInfo.js +++ b/src/lib/functions/courseExam/courseInfo/courseInfo.js @@ -28,7 +28,7 @@ let code; export async function courseInformation(courseID) { let courseInfo = decodeURIComponent(courseID); - //console.log(courseID) + console.log(courseID) //console.log(courseInfo) courses = []; registrations = []; @@ -59,7 +59,7 @@ export async function courseInformation(courseID) { //console.log(courses) // Finding the course and storing informations about it in variables for (const course of courses) { - if (course.id == courseInfo) { + if (course.course.id == courseInfo) { //! Course name not localized in courses //courseTitle = localize(course, "courseTitle", get(locale)); semester = course.semester.id; @@ -82,9 +82,6 @@ export async function courseInformation(courseID) { try { for (const sem of registrations) { for (const semClass of sem.classes) { - //debug - // console.log(semClass.courseClass.course.id) - // console.log(course.id) if (semClass.courseClass.course.id == course.course.id) { courseTitle = localize(semClass.courseClass.course, "name", get(locale)) code = course.course.id @@ -93,12 +90,8 @@ export async function courseInformation(courseID) { let newCourseData; if (newCourseObject.ok) { newCourseData = await newCourseObject.json() - //console.log(newCourseData) syllabus = localize(newCourseData, "content", get(locale)) eudoxus = localize(newCourseData, "eudoxus", get(locale)) - //debug - //console.log(syllabus) - //console.log(eudoxus) } else { let newCourseData = null alert("bad request") diff --git a/src/lib/functions/courseExam/courseStats/statistics.js b/src/lib/functions/courseExam/courseStats/statistics.js index 880124d0..3b7960b1 100644 --- a/src/lib/functions/courseExam/courseStats/statistics.js +++ b/src/lib/functions/courseExam/courseStats/statistics.js @@ -45,14 +45,14 @@ export async function statistics(courseCode) { try { let courses = await neoUniversisGet('students/me/courses?$top=-1'); - //console.log(courses) let courseExam = ''; examCode = courses.value; for (const exam of examCode) { - if (exam.id == courseCode) { + console.log(exam) + if (exam.course == courseCode) { courseExam = exam.gradeExam; myGrade = exam.grade; break; @@ -60,9 +60,6 @@ export async function statistics(courseCode) { } let statistic = await neoUniversisGet(`students/me/exams/${courseExam}/statistics?$top=-1&`,{lifetime: 600}); - // console.log(courseCode) - // console.log(courseExam) - // console.log(statistic) let passedGrades = []; @@ -94,7 +91,6 @@ export async function statistics(courseCode) { const averagePassed = Math.round((totalPassedGrades / studentsPassed + Number.EPSILON) * 100) / 100; totalStudents = studentsPassed + studentsFailed; - //console.log(averagePassed) myGrade *= 10; myGrade = Number.isInteger(myGrade) ? myGrade : Number((myGrade).toFixed(3)).toFixed(1); @@ -123,8 +119,6 @@ export async function statistics(courseCode) { topPercent: topPercent }; - //console.log(studentsWorseThanMe) - //console.log(stats) return stats; } catch (error) { From 1e2bc41724ffbb4d82f9dd82cb567fe0e66b868c Mon Sep 17 00:00:00 2001 From: Panagiotis Skoulis Date: Sat, 27 Dec 2025 01:13:23 +0200 Subject: [PATCH 21/23] formatting --- 086AF560-21CA-48FE-A006-889186315FA5 | 1 - src/lib/components/courses/courseInfo.svelte | 13 +++++++++---- .../coursePerSemester/coursesPerSemester.ts | 4 +--- src/lib/functions/degreeCalculator/main.js | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) delete mode 100644 086AF560-21CA-48FE-A006-889186315FA5 diff --git a/086AF560-21CA-48FE-A006-889186315FA5 b/086AF560-21CA-48FE-A006-889186315FA5 deleted file mode 100644 index 73784a24..00000000 --- a/086AF560-21CA-48FE-A006-889186315FA5 +++ /dev/null @@ -1 +0,0 @@ -{"id":48587,"year":"2025-2026","period":"Χειμερινό ","dateModified":"2025-11-10T11:19:38.510+02:00","courseClass":"66695","title":null,"prerequisites":null,"generalPrerequisites":null,"specificCourseCategory":{"id":1,"name":"Γενικού Υποβάθρου","alternateName":"generalBackground","description":"Πρόκειται για τα μαθήματα εκείνα που αποτελούν συνέχεια και επέκταση των λυκειακών γνώσεων ή /και αποτελούν υποχρεωτικά μαθήματα προαπαιτούμενα για την παρακολούθηση άλλων μαθημάτων. Τα μαθήματα εκείνα που, αν και δεν αναφέρονται άμεσα στην επιστήμη που θεραπεύει το Πρόγραμμα Σπουδών, ωστόσο αποτελούν αναγκαία προϋπάρχουσα επιστημονική γνώση για να μπορέσει κάποιος να αντιληφθεί θέματα άμεσα εντασσόμενα σε αυτήν.","locale":{"id":2,"object":1,"inLanguage":"el","name":"Γενικού Υποβάθρου","description":null}},"semester":1,"educationClassification":{"id":3,"name":"Επίπεδο 7: Μεταπτυχιακά Διπλώματα Ειδίκευσης","alternateName":"level7","description":"Αφορά στα Μεταπτυχιακά Διπλώματα Ειδίκευσης (π.χ.Master - MS.c, Μ.Eng, M.B.A. κλπ.)","locale":{"id":6,"object":3,"inLanguage":"el","name":"Επίπεδο 7: Μεταπτυχιακά Διπλώματα Ειδίκευσης"}},"erasmus":false,"learningOutcome":"Με την επιτυχη ολοκληρωση του μαθηματος οι φοιτητες θα ειναι σε θεση να κανουν τα εξης.\r\n1. Να υπολογιζουν ορια, παραγωγους και ολοκληρωματα βασικων συναρτησεων.\r\n2. Να υπολογιζουν ογκους, εμβαδα και μηκη τοξων.\r\n3. Να υπολογιζουν ορια ακολουθιων.\r\n4. Να επιλυουν εξισωσεις διαφορων.\r\n5. Να αναπτυσοουν συναρτησεις σε σειρες Taylor.\r\n6. Να επιλυουν γραμμικες διαφορικες εξισωσεις 1ης ταξης.\r\n","content":"Λογισμός συναρτήσεων μιας πραγματικής μεταβλητής: μιγαδικοι αριθμοι, συναρτήσεις, όριο και συνεχεια, παράγωγoς, λογαριθμικές και εκθετικές συναρτήσεις, τριγωνομετρικές και υπερβολικές συναρτήσεις, τύπος του Euler, ολοκλήρωμα, μέθοδοι ολοκληρωσης, εμβαδό, μήκος και όγκος, παραμετρικές συναρτήσεις, πολικές συντεταγμένες, ακολουθιες, αναδρομικές ακολουθίες, αριθμητικες σειρές, δυναμοσειρές, σειρές Taylor και MacLaurin, διαφορικές εξισώσεις πρώτης τάξης.","contentKeywords":null,"ictDescription":"προβολικο ΗΥ\r\nασκησεις Moodle ","courseEvaluationDescription":"Γραπτή εξέταση διάρκειας 150 λεπτών\r\n\r\n","eudoxus":"Βιβλίο [2574]: Γενικά Μαθηματικά (Schaum's Outline of Theory and Problems of Differential and Integral Calculus) Frank Ayres","bibliography":null,"ects":6,"workLoad":30,"evaluationMethod":{"id":1,"name":"Διαμορφωτική","alternateName":"Formative","description":null,"locale":{"id":2,"object":1,"inLanguage":"el","name":"Διαμορφωτική"}},"ictTypes":[{"id":1,"name":"Χρήση Τ.Π.Ε. στη Διδασκαλία","alternateName":"uceICTTeaching","description":null,"locale":{"id":2,"object":1,"inLanguage":"el","name":"Χρήση Τ.Π.Ε. στη Διδασκαλία"}},{"id":3,"name":"Χρήση Τ.Π.Ε. στην Επικοινωνία με τους φοιτητές","alternateName":"uceICTCommunication","description":null,"locale":{"id":6,"object":3,"inLanguage":"el","name":"Χρήση Τ.Π.Ε. στην Επικοινωνία με τους φοιτητές"}},{"id":4,"name":"Χρήση Τ.Π.Ε. στην Αξιολόγηση των Φοιτητών","alternateName":"userICTEvaluation","description":null,"locale":{"id":9,"object":4,"inLanguage":"el","name":"Χρήση Τ.Π.Ε. στην Αξιολόγηση των Φοιτητών"}}],"evaluationLanguages":[{"id":1,"name":"Ελληνικά","alternateName":"el","description":null,"locale":{"id":2,"object":1,"inLanguage":"el","name":"Ελληνικά"}}],"courseEvaluations":[],"educationMaterials":[{"id":-1,"name":"Άλλο","alternateName":"Other","description":null,"locale":{"id":9,"object":-1,"inLanguage":"el","name":"Άλλο"}},{"id":1,"name":"Σημειώσεις","alternateName":"Σημειώσεις","description":null,"locale":{"id":1,"object":1,"inLanguage":"el","name":"Σημειώσεις"}},{"id":8,"name":"Βιβλίο","alternateName":"Βιβλίο","description":null,"locale":{"id":8,"object":8,"inLanguage":"el","name":"Βιβλίο"}}],"generalSkills":[{"id":1,"name":"Εφαρμογή της γνώσης στην πράξη","alternateName":"practicalApplication","description":null,"locale":{"id":2,"object":1,"inLanguage":"el","name":"Εφαρμογή της γνώσης στην πράξη"}},{"id":5,"name":"Αυτόνομη εργασία","alternateName":"autonomousWork","description":null,"locale":{"id":10,"object":5,"inLanguage":"el","name":"Αυτόνομη εργασία"}},{"id":15,"name":"Προαγωγή της ελεύθερης, δημιουργικής και επαγωγικής σκέψης","alternateName":"creativeReasoning","description":null,"locale":{"id":30,"object":15,"inLanguage":"el","name":"Προαγωγή της ελεύθερης, δημιουργικής και επαγωγικής σκέψης"}}],"teachingMethods":[{"id":1,"name":"Πρόσωπο με πρόσωπο","alternateName":"faceToFace","description":null,"locale":{"id":2,"object":1,"inLanguage":"el","name":"Πρόσωπο με πρόσωπο"}}],"teachingStructureTypes":[{"id":423502,"courseOutline":48587,"teachingLearningType":{"id":1,"name":"Διαλέξεις","alternateName":"Lectures","description":null,"locale":{"id":2,"object":1,"inLanguage":"el","name":"Διαλέξεις"}},"weekHours":null,"workLoad":72,"ects":null},{"id":423503,"courseOutline":48587,"teachingLearningType":{"id":5,"name":"Μελέτη και ανάλυση βιβλίων και άρθρων","alternateName":"BibliographyAnalysis","description":null,"locale":{"id":10,"object":5,"inLanguage":"el","name":"Μελέτη και ανάλυση βιβλίων και άρθρων"}},"weekHours":null,"workLoad":72,"ects":null},{"id":423504,"courseOutline":48587,"teachingLearningType":{"id":15,"name":"Εξετάσεις","alternateName":"Examinations","description":null,"locale":{"id":30,"object":15,"inLanguage":"el","name":"Εξετάσεις"}},"weekHours":null,"workLoad":36,"ects":null}],"courseDigitalContents":[{"id":29487,"courseOutline":48587,"eStudyGuideType":{"id":4,"name":"eLearning (Moodle)","alternateName":"eLearning (Moodle)","description":null,"locale":{"id":8,"object":4,"inLanguage":"el","name":"eLearning (Moodle)"}},"url":"https://elearning.auth.gr/course/view.php?id=3801"}],"courseLanguages":[{"id":65139,"courseOutline":48587,"language":{"id":1,"name":"Ελληνικά","alternateName":"el","description":null,"locale":{"id":2,"object":1,"inLanguage":"el","name":"Ελληνικά"}},"teaching":true,"examination":true}],"locale":{"id":90898,"object":48587,"inLanguage":"el","title":null,"prerequisites":null,"generalPrerequisites":null,"learningOutcome":"Με την επιτυχη ολοκληρωση του μαθηματος οι φοιτητες θα ειναι σε θεση να κανουν τα εξης.\r\n1. Να υπολογιζουν ορια, παραγωγους και ολοκληρωματα βασικων συναρτησεων.\r\n2. Να υπολογιζουν ογκους, εμβαδα και μηκη τοξων.\r\n3. Να υπολογιζουν ορια ακολουθιων.\r\n4. Να επιλυουν εξισωσεις διαφορων.\r\n5. Να αναπτυσοουν συναρτησεις σε σειρες Taylor.\r\n6. Να επιλυουν γραμμικες διαφορικες εξισωσεις 1ης ταξης.\r\n","content":"Λογισμός συναρτήσεων μιας πραγματικής μεταβλητής: μιγαδικοι αριθμοι, συναρτήσεις, όριο και συνεχεια, παράγωγoς, λογαριθμικές και εκθετικές συναρτήσεις, τριγωνομετρικές και υπερβολικές συναρτήσεις, τύπος του Euler, ολοκλήρωμα, μέθοδοι ολοκληρωσης, εμβαδό, μήκος και όγκος, παραμετρικές συναρτήσεις, πολικές συντεταγμένες, ακολουθιες, αναδρομικές ακολουθίες, αριθμητικες σειρές, δυναμοσειρές, σειρές Taylor και MacLaurin, διαφορικές εξισώσεις πρώτης τάξης.","contentKeywords":null,"eudoxus":"Βιβλίο [2574]: Γενικά Μαθηματικά (Schaum's Outline of Theory and Problems of Differential and Integral Calculus) Frank Ayres","bibliography":null,"courseEvaluationDescription":"Γραπτή εξέταση διάρκειας 150 λεπτών\r\n\r\n","ictDescription":"προβολικο ΗΥ\r\nασκησεις Moodle "}} \ No newline at end of file diff --git a/src/lib/components/courses/courseInfo.svelte b/src/lib/components/courses/courseInfo.svelte index c277f27a..6d8a331e 100644 --- a/src/lib/components/courses/courseInfo.svelte +++ b/src/lib/components/courses/courseInfo.svelte @@ -1,4 +1,4 @@ - @@ -198,7 +202,7 @@ {$t("course.syllabus")} -

{@html course.syllabus}

+

{@html sanitizedSyllabus}

{/if} @@ -208,7 +212,7 @@ {$t("course.eudoxus")} -

{@html course.eudoxus}

+

{@html sanitizedEudoxus}

{/if} diff --git a/src/lib/components/degreeCalculator/card.svelte b/src/lib/components/degreeCalculator/card.svelte index 3387e44e..5b334d8f 100644 --- a/src/lib/components/degreeCalculator/card.svelte +++ b/src/lib/components/degreeCalculator/card.svelte @@ -15,7 +15,7 @@ import { fade } from 'svelte/transition'; import { courseAdded, customCourses } from './courseStore.ts'; import { get } from 'svelte/store'; - import { localize } from '$src/lib/functions/localize.js'; + import { localize } from '$src/lib/translations/localize.js'; import {locale} from "$lib/i18n.js" export let flip; diff --git a/src/lib/components/degreeCalculator/course.svelte b/src/lib/components/degreeCalculator/course.svelte index 0c0a70da..6d4a4672 100644 --- a/src/lib/components/degreeCalculator/course.svelte +++ b/src/lib/components/degreeCalculator/course.svelte @@ -1,20 +1,13 @@ @@ -26,7 +19,7 @@ {#if get(locale) == "el"}

{course_semester_id}ο Εξάμηνο

{:else} -

{course_semester_id}{sem_suffix(course_semester_id)} semester

+

{sem_suffix(course_semester_id)}

{/if} {:else}

{course_semester_name}

diff --git a/src/lib/components/grades/gradeCard.svelte b/src/lib/components/grades/gradeCard.svelte index 44529e6d..776c94b2 100644 --- a/src/lib/components/grades/gradeCard.svelte +++ b/src/lib/components/grades/gradeCard.svelte @@ -10,7 +10,7 @@ import { getSemester } from '$components/courses/getSemester'; import { t, getLocale, locale } from '$lib/i18n'; import { get } from 'svelte/store'; - import { localize } from '$src/lib/functions/localize'; + import { localize } from '$src/lib/translations/localize'; let childrenOpen: boolean[] = []; diff --git a/src/lib/components/personalInfo/infoItem.svelte b/src/lib/components/personalInfo/infoItem.svelte index fe61274e..64bb3e47 100644 --- a/src/lib/components/personalInfo/infoItem.svelte +++ b/src/lib/components/personalInfo/infoItem.svelte @@ -7,7 +7,7 @@ import type { ToastOptions } from '@ionic/core'; import {locale} from '$lib/i18n' import {get} from 'svelte/store' - import {localize} from '$lib/functions/localize' + import {localize, sem_suffix} from '$src/lib/translations/localize' export let personalData: any; @@ -17,11 +17,9 @@ $: aem = personalData?.studentIdentifier; $: apm = personalData?.uniqueIdentifier; $: username = null; - //$: inscriptionYear = personalData?.inscriptionYear.name; $: schoolGraduated = personalData?.schoolGraduated; $: birthDate = personalData?.person.birthDate.slice(0, 10); $: email = personalData?.person.email; - //let username = user.name; $: familyName = localize(personalData?.person, "familyName", currentLocale); $: givenName = localize(personalData?.person, "givenName", currentLocale); $: gender = (() => { @@ -37,7 +35,6 @@ return isMale ? 'Male' : 'Female'; })(); - //console.log(gender) $: departmentName = localize(personalData?.studyProgram.department, "name", currentLocale); $: semester = (() => { const s = personalData?.semester; @@ -47,16 +44,12 @@ return `${s}ο Εξάμηνο`; } - const suffix = - s === 1 ? 'st' : - s === 2 ? 'nd' : - s === 3 ? 'rd' : 'th'; - - return `${s}${suffix} Semester`; + return `${sem_suffix(s)}`; })(); - //console.log(semester) $: study_level = localize(personalData.studyProgram.studyLevel, "name", currentLocale); $: deptSecretaryEmail = personalData?.studyProgram.department.email; + $: deptSecretaryPhone = personalData?.studyProgram.department.phone1; + $: deptUrl = personalData?.studyProgram.department.url; $: academicId = personalData.academicId; // Function to show toast @@ -147,14 +140,6 @@ {/if} - {#if deptSecretaryEmail} - writeToClipboard(deptSecretaryEmail)}> - - - {deptSecretaryEmail} - - {/if} - {#if gender} writeToClipboard(gender)}> @@ -162,14 +147,6 @@ {/if} - {#if departmentName} - writeToClipboard(departmentName)}> - - - {departmentName} - - {/if} - {#if semester} writeToClipboard(semester)}> @@ -185,6 +162,35 @@ {study_level} {/if} + + {#if departmentName} + + + + + {departmentName} + + {#if deptSecretaryEmail} +
writeToClipboard(deptSecretaryEmail)}> + + {deptSecretaryEmail} +
+ {/if} + {#if deptSecretaryPhone} +
writeToClipboard(deptSecretaryPhone)}> + + {deptSecretaryPhone} +
+ {/if} + {#if deptUrl} +
writeToClipboard(deptUrl)}> + + {deptUrl} +
+ {/if} +
+
+ {/if} @@ -203,4 +209,28 @@ font-size: 1.2rem; padding-left: 5px; } + + ion-accordion-group { + margin-top: 0.2rem; + } + + .department-child { + padding-top: 0.8rem; + padding-bottom: 0.8rem; + color: var(--app-color-primary-dark); + cursor: pointer; + text-align: center; + display: flex; + align-items: center; + justify-content: center; + gap: 0.5rem; + } + + .department-child:hover { + background-color: var(--ion-color-light); + } + + .department-text { + color: var(--app-color-primary-dark); + } diff --git a/src/lib/components/recentResults/recentGrades.svelte b/src/lib/components/recentResults/recentGrades.svelte index 90aa3168..85581d2d 100644 --- a/src/lib/components/recentResults/recentGrades.svelte +++ b/src/lib/components/recentResults/recentGrades.svelte @@ -1,7 +1,7 @@