Skip to content

Commit 03b06d3

Browse files
committed
Merge branch 'develop' into feature/lectures/add-status-bar
2 parents d17ecf7 + 2710447 commit 03b06d3

27 files changed

+153
-90
lines changed

jest.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ module.exports = {
105105
coverageThreshold: {
106106
global: {
107107
// TODO: in the future, the following values should increase to at least 90%
108-
statements: 87.73,
109-
branches: 73.87,
110-
functions: 82.44,
111-
lines: 87.78,
108+
statements: 87.78,
109+
branches: 73.93,
110+
functions: 82.47,
111+
lines: 87.83,
112112
},
113113
},
114114
coverageReporters: ['clover', 'json', 'lcov', 'text-summary'],

src/main/webapp/app/exam/manage/exam-management.module.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,16 @@ import { ArtemisProgrammingExerciseModule } from 'app/exercises/programming/shar
6666
import { DetailModule } from 'app/detail-overview-list/detail.module';
6767
import { ArtemisDurationFromSecondsPipe } from 'app/shared/pipes/artemis-duration-from-seconds.pipe';
6868
import { NoDataComponent } from 'app/shared/no-data-component';
69+
import { SafeHtmlPipe } from 'app/shared/pipes/safe-html.pipe';
70+
import { GradeStepBoundsPipe } from 'app/shared/pipes/grade-step-bounds.pipe';
6971
import { examScoresState } from 'app/exam/exam-scores/exam-scores.route';
7072
import { GitDiffLineStatComponent } from 'app/exercises/programming/git-diff-report/git-diff-line-stat.component';
7173

7274
const ENTITY_STATES = [...examManagementState, ...examScoresState];
7375

7476
@NgModule({
7577
// TODO: For better modularization we could define an exercise module with the corresponding exam routes
76-
providers: [ArtemisDurationFromSecondsPipe],
78+
providers: [ArtemisDurationFromSecondsPipe, SafeHtmlPipe, GradeStepBoundsPipe],
7779
imports: [
7880
RouterModule.forChild(ENTITY_STATES),
7981
ArtemisTextExerciseModule,
@@ -108,6 +110,9 @@ const ENTITY_STATES = [...examManagementState, ...examScoresState];
108110
DetailModule,
109111
NoDataComponent,
110112
GitDiffLineStatComponent,
113+
SafeHtmlPipe,
114+
GradeStepBoundsPipe,
115+
BonusComponent,
111116
],
112117
declarations: [
113118
ExamManagementComponent,
@@ -135,7 +140,6 @@ const ENTITY_STATES = [...examManagementState, ...examScoresState];
135140
StudentExamDetailTableRowComponent,
136141
ExamImportComponent,
137142
ExamExerciseImportComponent,
138-
BonusComponent,
139143
ExamEditWorkingTimeComponent,
140144
ExamEditWorkingTimeDialogComponent,
141145
ExamLiveAnnouncementCreateModalComponent,

src/main/webapp/app/exercises/programming/shared/instructions-render/programming-exercise-instructions-render.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ import { ProgrammingExerciseInstructionStepWizardComponent } from 'app/exercises
66
import { ProgrammingExerciseInstructionTaskStatusComponent } from 'app/exercises/programming/shared/instructions-render/task/programming-exercise-instruction-task-status.component';
77
import { ArtemisMarkdownModule } from 'app/shared/markdown.module';
88
import { ExamExerciseUpdateHighlighterModule } from 'app/exam/participate/exercises/exam-exercise-update-highlighter/exam-exercise-update-highlighter.module';
9+
import { SafeHtmlPipe } from 'app/shared/pipes/safe-html.pipe';
910

1011
@NgModule({
11-
imports: [ArtemisSharedModule, ArtemisResultModule, ArtemisMarkdownModule, ExamExerciseUpdateHighlighterModule],
12+
imports: [ArtemisSharedModule, ArtemisResultModule, ArtemisMarkdownModule, ExamExerciseUpdateHighlighterModule, SafeHtmlPipe],
1213
declarations: [ProgrammingExerciseInstructionComponent, ProgrammingExerciseInstructionStepWizardComponent, ProgrammingExerciseInstructionTaskStatusComponent],
1314
exports: [ProgrammingExerciseInstructionComponent],
1415
})

src/main/webapp/app/grading-system/base-grading-system/base-grading-system.component.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit } from '@angular/core';
1+
import { Component, OnInit, inject } from '@angular/core';
22
import { GradeType, GradingScale } from 'app/entities/grading-scale.model';
33
import { GradeStep } from 'app/entities/grade-step.model';
44
import { ActivatedRoute } from '@angular/router';
@@ -39,6 +39,12 @@ export enum GradeEditMode {
3939

4040
@Component({ template: '' })
4141
export abstract class BaseGradingSystemComponent implements OnInit {
42+
protected gradingSystemService = inject(GradingSystemService);
43+
private route = inject(ActivatedRoute);
44+
private translateService = inject(TranslateService);
45+
private courseService = inject(CourseManagementService);
46+
private examService = inject(ExamManagementService);
47+
4248
GradeType = GradeType;
4349
ButtonSize = ButtonSize;
4450
GradingScale = GradingScale;
@@ -67,14 +73,6 @@ export abstract class BaseGradingSystemComponent implements OnInit {
6773
faExclamationTriangle = faExclamationTriangle;
6874
faInfo = faInfo;
6975

70-
constructor(
71-
protected gradingSystemService: GradingSystemService,
72-
private route: ActivatedRoute,
73-
private translateService: TranslateService,
74-
private courseService: CourseManagementService,
75-
private examService: ExamManagementService,
76-
) {}
77-
7876
ngOnInit(): void {
7977
this.route.parent?.params.subscribe((params) => {
8078
this.isLoading = true;

src/main/webapp/app/grading-system/bonus/bonus.component.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit } from '@angular/core';
1+
import { Component, OnInit, inject } from '@angular/core';
22
import { BonusService } from 'app/grading-system/bonus/bonus.service';
33
import { GradingSystemService } from 'app/grading-system/grading-system.service';
44
import { GradingScale } from 'app/entities/grading-scale.model';
@@ -9,10 +9,14 @@ import { faExclamationTriangle, faPlus, faQuestionCircle, faSave, faTimes } from
99
import { GradeStep, GradeStepsDTO } from 'app/entities/grade-step.model';
1010
import { ButtonSize } from 'app/shared/components/button.component';
1111
import { Subject, forkJoin, of } from 'rxjs';
12-
import { TranslateService } from '@ngx-translate/core';
1312
import { SearchTermPageableSearch, SortingOrder } from 'app/shared/table/pageable-table';
1413
import { GradeEditMode } from 'app/grading-system/base-grading-system/base-grading-system.component';
1514
import { AlertService } from 'app/core/util/alert.service';
15+
import { ArtemisSharedModule } from 'app/shared/shared.module';
16+
import { ArtemisSharedComponentModule } from 'app/shared/components/shared-component.module';
17+
import { SafeHtmlPipe } from 'app/shared/pipes/safe-html.pipe';
18+
import { GradeStepBoundsPipe } from 'app/shared/pipes/grade-step-bounds.pipe';
19+
import { ArtemisModePickerModule } from 'app/exercises/shared/mode-picker/mode-picker.module';
1620

1721
export enum BonusStrategyOption {
1822
GRADES,
@@ -28,8 +32,16 @@ export enum BonusStrategyDiscreteness {
2832
selector: 'jhi-bonus',
2933
templateUrl: './bonus.component.html',
3034
styleUrls: ['./bonus.component.scss'],
35+
standalone: true,
36+
imports: [ArtemisSharedModule, ArtemisSharedComponentModule, ArtemisModePickerModule, SafeHtmlPipe, GradeStepBoundsPipe],
3137
})
3238
export class BonusComponent implements OnInit {
39+
private bonusService = inject(BonusService);
40+
private gradingSystemService = inject(GradingSystemService);
41+
private route = inject(ActivatedRoute);
42+
private router = inject(Router);
43+
private alertService = inject(AlertService);
44+
3345
readonly CALCULATION_PLUS = 1;
3446
readonly CALCULATION_MINUS = -1;
3547

@@ -98,15 +110,6 @@ export class BonusComponent implements OnInit {
98110
sortedColumn: 'ID',
99111
};
100112

101-
constructor(
102-
private bonusService: BonusService,
103-
private gradingSystemService: GradingSystemService,
104-
private route: ActivatedRoute,
105-
private router: Router,
106-
private translateService: TranslateService,
107-
private alertService: AlertService,
108-
) {}
109-
110113
ngOnInit(): void {
111114
this.isLoading = true;
112115

src/main/webapp/app/grading-system/bonus/bonus.service.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Injectable } from '@angular/core';
1+
import { Injectable, inject } from '@angular/core';
22
import { HttpClient, HttpParams, HttpResponse } from '@angular/common/http';
33
import { Observable } from 'rxjs';
44
import { GradeStep, GradeStepsDTO } from 'app/entities/grade-step.model';
@@ -11,12 +11,10 @@ export type EntityResponseType = HttpResponse<Bonus>;
1111

1212
@Injectable({ providedIn: 'root' })
1313
export class BonusService {
14-
public resourceUrl = 'api';
14+
private http = inject(HttpClient);
15+
private gradingSystemService = inject(GradingSystemService);
1516

16-
constructor(
17-
private http: HttpClient,
18-
private gradingSystemService: GradingSystemService,
19-
) {}
17+
public resourceUrl = 'api';
2018

2119
/**
2220
* Deletes the bonus.

src/main/webapp/app/grading-system/detailed-grading-system/detailed-grading-system.component.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
import { Component } from '@angular/core';
22
import { BaseGradingSystemComponent, CsvGradeStep } from 'app/grading-system/base-grading-system/base-grading-system.component';
33
import { parse } from 'papaparse';
4+
import { TranslateDirective } from 'app/shared/language/translate.directive';
5+
import { ArtemisSharedComponentModule } from 'app/shared/components/shared-component.module';
6+
import { FormsModule } from '@angular/forms';
7+
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
8+
import { ArtemisSharedModule } from 'app/shared/shared.module';
9+
import { ArtemisTranslatePipe } from 'app/shared/pipes/artemis-translate.pipe';
410

511
@Component({
612
selector: 'jhi-detailed-grading-system',
713
templateUrl: './detailed-grading-system.component.html',
814
styleUrls: ['./detailed-grading-system.component.scss'],
15+
standalone: true,
16+
imports: [TranslateDirective, ArtemisSharedComponentModule, FormsModule, FaIconComponent, ArtemisSharedModule, ArtemisTranslatePipe],
917
})
1018
export class DetailedGradingSystemComponent extends BaseGradingSystemComponent {
1119
/**

src/main/webapp/app/grading-system/grading-key-overview/grading-key-overview.component.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
1-
import { Component, OnInit } from '@angular/core';
1+
import { Component, OnInit, inject } from '@angular/core';
22
import { ActivatedRoute } from '@angular/router';
3-
import { GradingSystemService } from 'app/grading-system/grading-system.service';
43
import { GradeStep } from 'app/entities/grade-step.model';
54
import { ArtemisNavigationUtilService } from 'app/utils/navigation.utils';
65
import { faChevronLeft, faPrint } from '@fortawesome/free-solid-svg-icons';
76
import { ThemeService } from 'app/core/theme/theme.service';
87
import { loadGradingKeyUrlParams } from 'app/grading-system/grading-key-overview/grading-key-helper';
8+
import { TranslateDirective } from 'app/shared/language/translate.directive';
9+
import { GradingKeyTableComponent } from 'app/grading-system/grading-key-overview/grading-key/grading-key-table.component';
10+
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
11+
import { ArtemisTranslatePipe } from 'app/shared/pipes/artemis-translate.pipe';
912

1013
@Component({
1114
selector: 'jhi-grade-key-overview',
1215
templateUrl: './grading-key-overview.component.html',
1316
styleUrls: ['./grading-key-overview.scss'],
17+
standalone: true,
18+
imports: [TranslateDirective, GradingKeyTableComponent, FaIconComponent, ArtemisTranslatePipe],
1419
})
1520
export class GradingKeyOverviewComponent implements OnInit {
21+
private route = inject(ActivatedRoute);
22+
private navigationUtilService = inject(ArtemisNavigationUtilService);
23+
private themeService = inject(ThemeService);
24+
1625
readonly faChevronLeft = faChevronLeft;
1726
readonly faPrint = faPrint;
1827

1928
plagiarismGrade: string;
2029
noParticipationGrade: string;
2130

22-
constructor(
23-
private route: ActivatedRoute,
24-
private gradingSystemService: GradingSystemService,
25-
private navigationUtilService: ArtemisNavigationUtilService,
26-
private themeService: ThemeService,
27-
) {}
28-
2931
isExam = false;
3032

3133
courseId?: number;

src/main/webapp/app/grading-system/grading-key-overview/grading-key-overview.module.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import { ArtemisSharedComponentModule } from 'app/shared/components/shared-compo
55
import { GradingKeyTableComponent } from 'app/grading-system/grading-key-overview/grading-key/grading-key-table.component';
66

77
@NgModule({
8-
declarations: [GradingKeyOverviewComponent, GradingKeyTableComponent],
9-
imports: [ArtemisSharedModule, ArtemisSharedComponentModule],
8+
imports: [ArtemisSharedModule, ArtemisSharedComponentModule, GradingKeyOverviewComponent, GradingKeyTableComponent],
109
exports: [GradingKeyOverviewComponent, GradingKeyTableComponent],
1110
})
1211
export class GradingKeyOverviewModule {}

src/main/webapp/app/grading-system/grading-key-overview/grading-key/grading-key-table.component.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, Input, OnInit } from '@angular/core';
1+
import { Component, Input, OnInit, inject } from '@angular/core';
22
import { GradingSystemService } from 'app/grading-system/grading-system.service';
33
import { GradeStep, GradeStepsDTO } from 'app/entities/grade-step.model';
44
import { GradeType, GradingScale } from 'app/entities/grading-scale.model';
@@ -11,27 +11,32 @@ import { ScoresStorageService } from 'app/course/course-scores/scores-storage.se
1111
import { ScoreType } from 'app/shared/constants/score-type.constants';
1212
import { ActivatedRoute } from '@angular/router';
1313
import { loadGradingKeyUrlParams } from 'app/grading-system/grading-key-overview/grading-key-helper';
14+
import { TranslateDirective } from 'app/shared/language/translate.directive';
15+
import { ArtemisTranslatePipe } from 'app/shared/pipes/artemis-translate.pipe';
16+
import { GradeStepBoundsPipe } from 'app/shared/pipes/grade-step-bounds.pipe';
17+
import { SafeHtmlPipe } from 'app/shared/pipes/safe-html.pipe';
18+
import { ArtemisSharedComponentModule } from 'app/shared/components/shared-component.module';
1419

1520
@Component({
1621
selector: 'jhi-grade-key-table',
1722
templateUrl: './grading-key-table.component.html',
1823
styleUrls: ['../grading-key-overview.scss'],
24+
standalone: true,
25+
imports: [TranslateDirective, ArtemisTranslatePipe, GradeStepBoundsPipe, SafeHtmlPipe, ArtemisSharedComponentModule],
1926
})
2027
export class GradingKeyTableComponent implements OnInit {
28+
private route = inject(ActivatedRoute);
29+
private gradingSystemService = inject(GradingSystemService);
30+
private bonusService = inject(BonusService);
31+
private scoresStorageService = inject(ScoresStorageService);
32+
2133
readonly faChevronLeft = faChevronLeft;
2234

2335
readonly GradeEditMode = GradeEditMode;
2436

2537
@Input() studentGradeOrBonusPointsOrGradeBonus?: string;
2638
@Input() forBonus?: boolean;
2739

28-
constructor(
29-
private route: ActivatedRoute,
30-
private gradingSystemService: GradingSystemService,
31-
private bonusService: BonusService,
32-
private scoresStorageService: ScoresStorageService,
33-
) {}
34-
3540
plagiarismGrade: string;
3641
noParticipationGrade: string;
3742

0 commit comments

Comments
 (0)