Skip to content

Implemented exam accommodations handling#2

Merged
AngryKiller merged 3 commits into
mainfrom
feat/exam-accomodations
Jun 22, 2026
Merged

Implemented exam accommodations handling#2
AngryKiller merged 3 commits into
mainfrom
feat/exam-accomodations

Conversation

@AngryKiller

Copy link
Copy Markdown
Owner

Added exam accommodations formatting and option for users
Fixed a parsing issue with exams in some cases

Copilot AI review requested due to automatic review settings June 22, 2026 20:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ExamAccommodations flag plus endpoints to read/update it, and wire it into calendar feed generation.
  • Extend exam type parsing to treat EXAM_SURV as 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 thread Services/Formatters/CalendarEventFormatter.cs
Comment thread AurionCal.Api.csproj Outdated
Comment on lines +9 to +10
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • RawToEnum is intended to be case-insensitive (it’s built from a Dictionary using StringComparer.OrdinalIgnoreCase), but calling ToImmutableDictionary() without passing a comparer creates an ImmutableDictionary with the default (case-sensitive) comparer. That means Parse() may fail for inputs whose casing differs (e.g., exam_surv vs EXAM_SURV), undermining the added EpreuveAlt mapping 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();

@AngryKiller AngryKiller merged commit da5c170 into main Jun 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants