Skip to content

Commit

Permalink
Adding column for percentage and indicate exercise type by adding icons
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-glombik committed Sep 17, 2023
1 parent 0471340 commit da59350
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,6 @@ export class ExamParticipationSummaryComponent implements OnInit {
return exam?.publishResultsDate && dayjs(exam.publishResultsDate).isBefore(this.serverDateService.now());
}

getIcon(exerciseType: ExerciseType) {
return getIcon(exerciseType);
}

asProgrammingExercise(exercise: Exercise): ProgrammingExercise {
return exercise as ProgrammingExercise;
}
Expand Down Expand Up @@ -248,4 +244,6 @@ export class ExamParticipationSummaryComponent implements OnInit {
}
return false;
}

protected readonly getIcon = getIcon;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ <h3>
<th scope="col" *ngIf="showIncludedInScoreColumn()">{{ 'artemisApp.exercise.includedInOverallScore' | artemisTranslate }}</th>
<th scope="col">{{ 'artemisApp.exam.examSummary.points.yourPoints' | artemisTranslate }}</th>
<th scope="col">{{ 'artemisApp.exam.examSummary.points.maxPoints' | artemisTranslate }}</th>
<th scope="col">{{ 'artemisApp.exam.examSummary.points.achievedPercentage' | artemisTranslate }}</th>
<th scope="col" *ngIf="getMaxBonusPointsSum() != 0">{{ 'artemisApp.exam.examSummary.points.maxBonus' | artemisTranslate }}</th>
</tr>
</thead>
Expand All @@ -24,6 +25,7 @@ <h3>
>
<th scope="row">{{ exerciseIndex + 1 }}</th>
<td>
&nbsp;<fa-icon *ngIf="exercise?.type" [icon]="getIcon(exercise.type!)"></fa-icon>&nbsp;
<span>{{ exercise?.exerciseGroup?.title ?? '-' }}</span>
</td>
<td *ngIf="showIncludedInScoreColumn()">{{ exerciseService.isIncludedInScore(exercise) }}</td>
Expand All @@ -35,6 +37,12 @@ <h3>
exercise.includedInOverallScore === IncludedInOverallScore.INCLUDED_AS_BONUS ? 0 : exercise.maxPoints
}}</span>
</td>
<td>
<!-- TODO adjust calculation-->
<span *ngIf="exercise.maxPoints != undefined">{{
exercise.includedInOverallScore === IncludedInOverallScore.INCLUDED_AS_BONUS ? 0 : exercise.maxPoints
}}</span>
</td>
<td *ngIf="getMaxBonusPointsSum() != 0">
<span *ngIf="exercise.bonusPoints != undefined">{{
exercise.includedInOverallScore === IncludedInOverallScore.INCLUDED_AS_BONUS ? exercise.maxPoints : exercise.bonusPoints
Expand All @@ -52,6 +60,9 @@ <h3>
<td>
{{ getMaxNormalPointsSum() }}
</td>
<td>
{{ getAchievedPointsPercentageSum() }}
</td>
<td *ngIf="getMaxBonusPointsSum() != 0">
{{ getMaxBonusPointsSum() }}
</td>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ChangeDetectorRef, Component, Input, OnInit } from '@angular/core';
import dayjs from 'dayjs/esm';
import { Exercise, IncludedInOverallScore } from 'app/entities/exercise.model';
import { Exercise, IncludedInOverallScore, getIcon } from 'app/entities/exercise.model';
import { ArtemisServerDateService } from 'app/shared/server-date.service';
import { ExerciseService } from 'app/exercises/shared/exercise/exercise.service';
import { GradeType } from 'app/entities/grading-scale.model';
Expand Down Expand Up @@ -92,6 +92,10 @@ export class ExamPointsSummaryComponent implements OnInit {
return this.studentExamWithGrade?.maxPoints ?? 0;
}

getAchievedPointsPercentageSum() {
return 10;
}

getAchievedPoints(exercise: Exercise): number {
return this.studentExamWithGrade?.achievedPointsPerExercise?.[exercise.id!] ?? 0;
}
Expand Down Expand Up @@ -119,4 +123,6 @@ export class ExamPointsSummaryComponent implements OnInit {
}
return false;
}

protected readonly getIcon = getIcon;
}
1 change: 1 addition & 0 deletions src/main/webapp/i18n/de/exam.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"total": "Gesamt",
"yourPoints": "Deine Punkte",
"maxPoints": "Erreichbare Punkte",
"achievedPercentage": "Erreichte Punkte in %",
"maxBonus": "Erreichbare Bonuspunkte",
"youAchievedWithBonus": "Du hast {{achievedPoints}} Punkte von {{normalPoints}} möglichen Punkten (einschließlich Bonuspunkten) erreicht.",
"youAchieved": "Du hast {{achievedPoints}} von möglichen {{normalPoints}} Punkten.",
Expand Down
1 change: 1 addition & 0 deletions src/main/webapp/i18n/en/exam.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"total": "Total",
"yourPoints": "Your Points",
"maxPoints": "Achievable Points",
"achievedPercentage": "Achieved Percentage",
"maxBonus": "Achievable Bonus Points",
"youAchievedWithBonus": "You achieved {{achievedPoints}} out of a maximum {{normalPoints}} possible points (including bonus points).",
"youAchieved": "You achieved {{achievedPoints}} out of {{normalPoints}} possible points.",
Expand Down

0 comments on commit da59350

Please sign in to comment.