Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programming exercises: Do not always show the request feedback button in the online code editor #9475

Merged
merged 5 commits into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
krusche marked this conversation as resolved.
Show resolved Hide resolved
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
Loading