Implemented exam accommodations handling#2
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a user-configurable “exam accommodations” option that, when enabled, adjusts generated iCal exam events based on a dedicated “Horaire TT” line in the raw Aurion exam content. It also improves exam parsing by recognizing an alternate exam raw type.
Changes:
- Add exam accommodations time parsing/override when formatting exam iCal events.
- Add a persisted
User.ExamAccommodationsflag plus endpoints to read/update it, and wire it into calendar feed generation. - Extend exam type parsing to treat
EXAM_SURVas an exam.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Services/Formatters/CalendarEventFormatter.cs | Adds parsing for “Horaire TT” and optional start/end override for exam events. |
| Services/CourseTypeMappings.cs | Maps an alternate raw course type (EXAM_SURV) to Epreuve and simplifies parsing logic. |
| Services/CalendarService.cs | Propagates the new examAccommodations option into iCal event generation. |
| Endpoints/GetCalendarFeedEndpoint.cs | Uses the user’s ExamAccommodations setting when generating the .ics feed. |
| Endpoints/GetUserProfileEndpoint.cs | Exposes ExamAccommodations in the user profile response. |
| Endpoints/SetExamAccommodationsEndpoint.cs | Adds an authenticated endpoint to enable/disable exam accommodations for the user. |
| Entities/User.cs | Adds the ExamAccommodations property to the User entity. |
| Enums/CourseTypes.cs | Introduces RawCourseTypes.EpreuveAlt = "EXAM_SURV". |
| Migrations/20260622000000_AddExamAccommodations.cs | Adds the ExamAccommodations column to Users with a default value. |
| Migrations/20260622000000_AddExamAccommodations.Designer.cs | EF migration designer output for the new column. |
| Migrations/ApplicationDbContextModelSnapshot.cs | Updates snapshot to include ExamAccommodations. |
| AurionCal.Api.csproj | Disables generation of assembly info + target framework attributes (not described in PR). |
Files not reviewed (1)
- Migrations/20260622000000_AddExamAccommodations.Designer.cs: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+9
to
+10
| <GenerateAssemblyInfo>false</GenerateAssemblyInfo> | ||
| <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute> |
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 12 changed files in this pull request and generated no new comments.
Files not reviewed (1)
- Migrations/20260622000000_AddExamAccommodations.Designer.cs: Generated file
Comments suppressed due to low confidence (1)
Services/CourseTypeMappings.cs:21
RawToEnumis intended to be case-insensitive (it’s built from aDictionaryusingStringComparer.OrdinalIgnoreCase), but callingToImmutableDictionary()without passing a comparer creates anImmutableDictionarywith the default (case-sensitive) comparer. That meansParse()may fail for inputs whose casing differs (e.g.,exam_survvsEXAM_SURV), undermining the addedEpreuveAltmapping and the normalization logic.
private static readonly ImmutableDictionary<string, CourseType> RawToEnum =
new Dictionary<string, CourseType>(StringComparer.OrdinalIgnoreCase)
{
[RawCourseTypes.CoursTd] = CourseType.CoursTd,
[RawCourseTypes.Td] = CourseType.CoursTd,
[RawCourseTypes.CoursTp] = CourseType.CoursTp,
[RawCourseTypes.Projet] = CourseType.Projet,
[RawCourseTypes.Epreuve] = CourseType.Epreuve,
[RawCourseTypes.EpreuveAlt] = CourseType.Epreuve,
[RawCourseTypes.AutoAppr] = CourseType.AutoAppr,
[RawCourseTypes.Reunion] = CourseType.Reunion,
[RawCourseTypes.Conference] = CourseType.Conference,
[RawCourseTypes.TdAutoGere] = CourseType.TdAutoGere,
}.ToImmutableDictionary();
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added exam accommodations formatting and option for users
Fixed a parsing issue with exams in some cases