Skip to content

Commit

Permalink
Do not show request feedback if it was not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
krusche committed Oct 13, 2024
1 parent 6549075 commit 494e40d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@if (!isExamExercise) {
@if (!isExamExercise && requestFeedbackEnabled) {
@if (athenaEnabled) {
@if (exercise().type === ExerciseType.TEXT) {
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { ParticipationService } from 'app/exercises/shared/participation/partici
export class RequestFeedbackButtonComponent implements OnInit {
faPenSquare = faPenSquare;
athenaEnabled = false;
requestFeedbackEnabled = false;
isExamExercise: boolean;
participation?: StudentParticipation;

Expand All @@ -34,7 +35,6 @@ export class RequestFeedbackButtonComponent implements OnInit {
exercise = input.required<Exercise>();
generatingFeedback = output<void>();

private feedbackSent = false;
private profileService = inject(ProfileService);
private alertService = inject(AlertService);
private courseExerciseService = inject(CourseExerciseService);
Expand All @@ -52,6 +52,7 @@ export class RequestFeedbackButtonComponent implements OnInit {
if (this.isExamExercise || !this.exercise().id) {
return;
}
this.requestFeedbackEnabled = this.exercise().allowFeedbackRequests ?? false;
this.updateParticipation();
}

Expand All @@ -77,7 +78,6 @@ export class RequestFeedbackButtonComponent implements OnInit {
next: (participation: StudentParticipation) => {
if (participation) {
this.generatingFeedback.emit();
this.feedbackSent = true;
this.alertService.success('artemisApp.exercise.feedbackRequestSent');
}
},
Expand Down

0 comments on commit 494e40d

Please sign in to comment.