Skip to content

Commit

Permalink
Development: Fix e2e tests for exam information pages (#7269)
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-glombik authored Sep 26, 2023
1 parent 0877ccb commit 66370ee
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ <h3 *ngIf="!displayOnExamCover" id="general-information-title">
<table class="table table-borderless mx-auto d-block">
<tbody>
<tr *ngIf="isTestExam">
<th class="text-end text-right">{{ 'artemisApp.examManagement.testExam.examMode' | artemisTranslate }}:</th>
<th>{{ 'artemisApp.examManagement.testExam.examMode' | artemisTranslate }}:</th>
<td>
<span class="mx-2 badge bg-primary">{{ 'artemisApp.examManagement.testExam.testExam' | artemisTranslate }}</span>
<span class="badge bg-primary">{{ 'artemisApp.examManagement.testExam.testExam' | artemisTranslate }}</span>
</td>
</tr>
<tr *ngIf="exam?.moduleNumber">
Expand All @@ -23,6 +23,10 @@ <h3 *ngIf="!displayOnExamCover" id="general-information-title">
<th>{{ 'artemisApp.examManagement.examiner' | artemisTranslate }}:</th>
<td>{{ exam.examiner }}</td>
</tr>
<tr *ngIf="exam?.title" id="exam-title">
<th>{{ 'artemisApp.examManagement.examTitle' | artemisTranslate }}:</th>
<td>{{ exam.title }}</td>
</tr>
<ng-container *ngIf="exam && !isTestExam && exam.startDate">
<tr *ngIf="isExamOverMultipleDays; else examSingleDay">
<th>{{ 'artemisApp.exam.time' | artemisTranslate }}:</th>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div>
<h2 id="exam-title">
<h2>
<ng-container>
{{ 'artemisApp.exam.examSummary.examResults' | artemisTranslate }}
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ <h3>
*ngIf="studentExamWithGrade.studentResult.overallScoreAchieved !== undefined; else totalScoreNotDefinedPlaceholder"
[class]="hasPassed ? 'text-success' : 'text-danger'"
>
{{ studentExamWithGrade.studentResult.overallScoreAchieved }}%
{{ overallAchievedPercentageRoundedByCourseSettings }}%
</span>
<ng-template #totalScoreNotDefinedPlaceholder>
<span>-</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export class ExamResultOverviewComponent implements OnInit, OnChanges {
*/
maxPoints = 0;
overallAchievedPoints = 0;
overallAchievedPercentageRoundedByCourseSettings = 0;
isBonusGradingKeyDisplayed = false;

exerciseInfos: Record<number, ExerciseInfo>;
Expand Down Expand Up @@ -82,9 +83,14 @@ export class ExamResultOverviewComponent implements OnInit, OnChanges {
this.showResultOverview = !!(this.isExamResultPublished() && this.hasAtLeastOneResult());
this.showIncludedInScoreColumn = this.containsExerciseThatIsNotIncludedCompletely();
this.maxPoints = this.studentExamWithGrade?.maxPoints ?? 0;
this.overallAchievedPoints = this.studentExamWithGrade?.studentResult.overallPointsAchieved ?? 0;
this.isBonusGradingKeyDisplayed = this.studentExamWithGrade.studentResult.gradeWithBonus?.bonusGrade != undefined;

this.overallAchievedPoints = this.studentExamWithGrade?.studentResult.overallPointsAchieved ?? 0;
this.overallAchievedPercentageRoundedByCourseSettings = roundScorePercentSpecifiedByCourseSettings(
(this.studentExamWithGrade.studentResult.overallScoreAchieved ?? 0) / 100,
this.studentExamWithGrade.studentExam?.exam?.course,
);

this.exerciseInfos = this.getExerciseInfos();
}

Expand Down Expand Up @@ -169,7 +175,6 @@ export class ExamResultOverviewComponent implements OnInit, OnChanges {
}

const course = this.studentExamWithGrade.studentExam?.exam?.course;

if (result.achievedScore !== undefined) {
return roundScorePercentSpecifiedByCourseSettings(result.achievedScore / 100, course);
}
Expand Down

0 comments on commit 66370ee

Please sign in to comment.