From da59350c4c6840c70b2c046244d55c209a8cb971 Mon Sep 17 00:00:00 2001 From: Florian Glombik Date: Sun, 17 Sep 2023 23:56:36 +0200 Subject: [PATCH] Adding column for percentage and indicate exercise type by adding icons --- .../summary/exam-participation-summary.component.ts | 6 ++---- .../points-summary/exam-points-summary.component.html | 11 +++++++++++ .../points-summary/exam-points-summary.component.ts | 8 +++++++- src/main/webapp/i18n/de/exam.json | 1 + src/main/webapp/i18n/en/exam.json | 1 + 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/main/webapp/app/exam/participate/summary/exam-participation-summary.component.ts b/src/main/webapp/app/exam/participate/summary/exam-participation-summary.component.ts index e9fdd36b29c6..f86b253e5ac7 100644 --- a/src/main/webapp/app/exam/participate/summary/exam-participation-summary.component.ts +++ b/src/main/webapp/app/exam/participate/summary/exam-participation-summary.component.ts @@ -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; } @@ -248,4 +244,6 @@ export class ExamParticipationSummaryComponent implements OnInit { } return false; } + + protected readonly getIcon = getIcon; } diff --git a/src/main/webapp/app/exam/participate/summary/points-summary/exam-points-summary.component.html b/src/main/webapp/app/exam/participate/summary/points-summary/exam-points-summary.component.html index 280b0bcb9860..43cc28a1524a 100644 --- a/src/main/webapp/app/exam/participate/summary/points-summary/exam-points-summary.component.html +++ b/src/main/webapp/app/exam/participate/summary/points-summary/exam-points-summary.component.html @@ -11,6 +11,7 @@

{{ 'artemisApp.exercise.includedInOverallScore' | artemisTranslate }} {{ 'artemisApp.exam.examSummary.points.yourPoints' | artemisTranslate }} {{ 'artemisApp.exam.examSummary.points.maxPoints' | artemisTranslate }} + {{ 'artemisApp.exam.examSummary.points.achievedPercentage' | artemisTranslate }} {{ 'artemisApp.exam.examSummary.points.maxBonus' | artemisTranslate }} @@ -24,6 +25,7 @@

> {{ exerciseIndex + 1 }} +    {{ exercise?.exerciseGroup?.title ?? '-' }} {{ exerciseService.isIncludedInScore(exercise) }} @@ -35,6 +37,12 @@

exercise.includedInOverallScore === IncludedInOverallScore.INCLUDED_AS_BONUS ? 0 : exercise.maxPoints }} + + + {{ + exercise.includedInOverallScore === IncludedInOverallScore.INCLUDED_AS_BONUS ? 0 : exercise.maxPoints + }} + {{ exercise.includedInOverallScore === IncludedInOverallScore.INCLUDED_AS_BONUS ? exercise.maxPoints : exercise.bonusPoints @@ -52,6 +60,9 @@

{{ getMaxNormalPointsSum() }} + + {{ getAchievedPointsPercentageSum() }} + {{ getMaxBonusPointsSum() }} diff --git a/src/main/webapp/app/exam/participate/summary/points-summary/exam-points-summary.component.ts b/src/main/webapp/app/exam/participate/summary/points-summary/exam-points-summary.component.ts index 8c11f3933ad6..e76b973e4dfc 100644 --- a/src/main/webapp/app/exam/participate/summary/points-summary/exam-points-summary.component.ts +++ b/src/main/webapp/app/exam/participate/summary/points-summary/exam-points-summary.component.ts @@ -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'; @@ -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; } @@ -119,4 +123,6 @@ export class ExamPointsSummaryComponent implements OnInit { } return false; } + + protected readonly getIcon = getIcon; } diff --git a/src/main/webapp/i18n/de/exam.json b/src/main/webapp/i18n/de/exam.json index d4ff9892d469..3d4dc73552f2 100644 --- a/src/main/webapp/i18n/de/exam.json +++ b/src/main/webapp/i18n/de/exam.json @@ -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.", diff --git a/src/main/webapp/i18n/en/exam.json b/src/main/webapp/i18n/en/exam.json index 7e570879ad5e..90c9fe147a9e 100644 --- a/src/main/webapp/i18n/en/exam.json +++ b/src/main/webapp/i18n/en/exam.json @@ -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.",