diff --git a/app/util/datetime/DateTimeHandlerImpl.java b/app/util/datetime/DateTimeHandlerImpl.java index 4c85b7239..406d8d9ee 100644 --- a/app/util/datetime/DateTimeHandlerImpl.java +++ b/app/util/datetime/DateTimeHandlerImpl.java @@ -32,7 +32,6 @@ import org.joda.time.DateTimeZone; import org.joda.time.Interval; import org.joda.time.LocalDate; -import org.joda.time.LocalTime; import util.config.ConfigReader; public class DateTimeHandlerImpl implements DateTimeHandler { @@ -115,13 +114,25 @@ public List getExceptionEvents( DateTime end = new DateTime(ewh.getEndDate()).plusMillis(ewh.getEndDateTimezoneOffset()); Interval exception = new Interval(start, end); Interval wholeDay = date.toInterval(); + // exception covers this day fully if (exception.contains(wholeDay) || exception.equals(wholeDay)) { exceptions.clear(); exceptions.add(wholeDay); - break; - } - if (exception.overlaps(wholeDay)) { - exceptions.add(new Interval(exception.getStart(), exception.getEnd())); + } else if (exception.overlaps(wholeDay)) { + // exception starts this day but ends on a later day + if (start.toLocalDate().equals(date) && end.toLocalDate().isAfter(date)) { + exceptions.add(new Interval(exception.getStart(), wholeDay.getEnd())); + } + // exception ends this day but starts on an earlier day + else if (start.toLocalDate().isBefore(date) && end.toLocalDate().equals(date)) { + exceptions.add(new Interval(wholeDay.getStart(), exception.getEnd())); + } + // exception starts and ends this day + else { + exceptions.add( + new Interval(exception.getStart().withDate(date), exception.getEnd().withDate(date)) + ); + } } } } @@ -275,17 +286,9 @@ public List getWorkingHoursForDate(LocalDate date, ExamRoom room) List unifiedIntervals = mergeSlots( Stream.concat(workingHours.stream().map(OpeningHours::getHours), extensionEvents.stream()).toList() ); - int tzOffset; - if (workingHours.isEmpty()) { - LocalTime lt = LocalTime.now().withHourOfDay(java.time.LocalTime.NOON.getHour()); - tzOffset = DateTimeZone.forID(room.getLocalTimezone()).getOffset(date.toDateTime(lt)); - } else { - tzOffset = workingHours.getFirst().getTimezoneOffset(); - } + int offset = DateTimeZone.forID(room.getLocalTimezone()).getOffset(DateTime.now().withDayOfYear(1)); workingHours.clear(); - workingHours.addAll( - unifiedIntervals.stream().map(interval -> new OpeningHours(interval, tzOffset)).toList() - ); + workingHours.addAll(unifiedIntervals.stream().map(interval -> new OpeningHours(interval, offset)).toList()); } if (!restrictionEvents.isEmpty()) { for (OpeningHours hours : workingHours) { diff --git a/ui/src/app/navigation/navigation.component.html b/ui/src/app/navigation/navigation.component.html index 623017138..b8d0ded76 100644 --- a/ui/src/app/navigation/navigation.component.html +++ b/ui/src/app/navigation/navigation.component.html @@ -15,9 +15,10 @@ class="mobile-menu" (click)="openMenu()" [hidden]="!user" - [attr.aria-open]="mobileMenuOpen" + [attr.aria-expanded]="mobileMenuOpen" + [attr.aria-label]="'i18n_open_main_menu' | translate" > - {{ 'i18n_mobile_menu' | translate }} + diff --git a/ui/src/app/review/assessment/sections/section.component.ts b/ui/src/app/review/assessment/sections/section.component.ts index 501f3986b..fd63b7dee 100644 --- a/ui/src/app/review/assessment/sections/section.component.ts +++ b/ui/src/app/review/assessment/sections/section.component.ts @@ -60,9 +60,11 @@ export class ExamSectionComponent implements OnInit, AfterViewInit { this.essayQuestionAmounts = this.Question.getEssayQuestionAmountsBySection(this.section); }; + // getReviewProgress gathers the questions that have been reviewed by calculating essay answers that have been evaluated plus the rest of the questions. + // Since the essay questions are the only ones that need to be evaluated and the rest of the questions are evaluated automatically. getReviewProgress = () => { return this.section.sectionQuestions.filter((q: ExamSectionQuestion) => { - return q.forcedScore || q.essayAnswer?.evaluatedScore; + return q.question.type !== 'EssayQuestion' || q.essayAnswer?.evaluatedScore; }).length; }; diff --git a/ui/src/assets/i18n/en.json b/ui/src/assets/i18n/en.json index d28299130..5ff4c08d7 100644 --- a/ui/src/assets/i18n/en.json +++ b/ui/src/assets/i18n/en.json @@ -1112,7 +1112,7 @@ "i18n_date_too_far_in_future": "Selected date is later than latest date allowed:", "i18n_enrolment_assessment_not_received": "Re-enrolment is not possible because your previous examination has not returned from exam visit university", "i18n_not_allowed_to_modify_reservation": "Your current reservation is active so you can't edit it", - "i18n_mobile_menu": "Mobile menu", + "i18n_open_main_menu": "Open main menu", "i18n_exam_logo": "Exam logo", "i18n_show_hide_clock": "Show/hide time", "i18n_select_time_in_future": "Time must be in future", diff --git a/ui/src/assets/i18n/fi.json b/ui/src/assets/i18n/fi.json index 3f705d6d5..ffccf2d50 100644 --- a/ui/src/assets/i18n/fi.json +++ b/ui/src/assets/i18n/fi.json @@ -1112,7 +1112,7 @@ "i18n_date_too_far_in_future": "Valittu ajankohta on myöhemmin kuin kaukaisin tällä hetkellä sallittu:", "i18n_enrolment_assessment_not_received": "Uudelleen ilmoittautuminen ei sallittu, edellinen tenttivierailusuoritus ei ole vielä saapunut", "i18n_not_allowed_to_modify_reservation": "Varaus on käynnissä ja sitä ei voi muuttaa", - "i18n_mobile_menu": "Mobiili-menu", + "i18n_open_main_menu": "Avaa päävalikko", "i18n_exam_logo": "Exam-logo", "i18n_show_hide_clock": "Näytä/piilota aika", "i18n_select_time_in_future": "Valitse aika tulevaisuudesta", diff --git a/ui/src/assets/i18n/sv.json b/ui/src/assets/i18n/sv.json index b9bb05668..3aa032ef3 100644 --- a/ui/src/assets/i18n/sv.json +++ b/ui/src/assets/i18n/sv.json @@ -1112,7 +1112,7 @@ "i18n_date_too_far_in_future": "Det valda datumet är senare än sista möjliga tidpunkt:", "i18n_enrolment_assessment_not_received": "Det är inte tillåtet att anmäla sig på nytt, eftersom den föregående tentamensprestationen inte ännu har kommit från den högskola där du skrev tentamen. ", "i18n_not_allowed_to_modify_reservation": "Din bokning pågår och kan därför inte ändras", - "i18n_mobile_menu": "Mobilmeny", + "i18n_open_main_menu": "Öppna huvudmenyn", "i18n_exam_logo": "Examlogo", "i18n_show_hide_clock": "Visa/dölj tiden", "i18n_select_time_in_future": "Välj tidpunkt i framtiden",