-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Programming exercises: Add visualization of test case errors (#9213)
- Loading branch information
Showing
15 changed files
with
458 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/java/de/tum/in/www1/artemis/web/rest/dto/feedback/FeedbackDetailDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package de.tum.in.www1.artemis.web.rest.dto.feedback; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
public record FeedbackDetailDTO(long count, double relativeCount, String detailText, String testCaseName, int taskNumber) { | ||
} |
27 changes: 27 additions & 0 deletions
27
...p/exercises/programming/manage/grading/feedback-analysis/feedback-analysis.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<div class="m-3"> | ||
<h2 class="mb-3" jhiTranslate="artemisApp.programmingExercise.configureGrading.feedbackAnalysis.title" [translateValues]="{ exerciseTitle: exerciseTitle }"></h2> | ||
<table class="table table-striped mb-3"> | ||
<thead> | ||
<tr> | ||
<th scope="col" jhiTranslate="artemisApp.programmingExercise.configureGrading.feedbackAnalysis.occurrence"></th> | ||
<th scope="col" jhiTranslate="artemisApp.programmingExercise.configureGrading.feedbackAnalysis.feedback"></th> | ||
<th scope="col" jhiTranslate="artemisApp.programmingExercise.configureGrading.feedbackAnalysis.task"></th> | ||
<th scope="col" jhiTranslate="artemisApp.programmingExercise.configureGrading.feedbackAnalysis.testcase"></th> | ||
<th scope="col" jhiTranslate="artemisApp.programmingExercise.configureGrading.feedbackAnalysis.errorCategory"></th> | ||
</tr> | ||
</thead> | ||
<tbody class="table-group-divider"> | ||
@for (item of feedbackDetails; track item) { | ||
<tr> | ||
<td class="text-center">{{ item.count }} ({{ item.relativeCount | number: '1.0-0' }}%)</td> | ||
<td>{{ item.detailText }}</td> | ||
<td class="text-center">{{ item.taskNumber }}</td> | ||
<td>{{ item.testCaseName }}</td> | ||
<td>Student Error</td> | ||
<!-- This is a placeholder, will be covered in follow up PRs --> | ||
</tr> | ||
} | ||
</tbody> | ||
</table> | ||
<div jhiTranslate="artemisApp.programmingExercise.configureGrading.feedbackAnalysis.totalItems" [translateValues]="{ count: feedbackDetails.length }"></div> | ||
</div> |
34 changes: 34 additions & 0 deletions
34
...app/exercises/programming/manage/grading/feedback-analysis/feedback-analysis.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Component, Input, OnInit } from '@angular/core'; | ||
import { FeedbackAnalysisService, FeedbackDetail } from 'app/exercises/programming/manage/grading/feedback-analysis/feedback-analysis.service'; | ||
import { ArtemisSharedModule } from 'app/shared/shared.module'; | ||
import { AlertService } from 'app/core/util/alert.service'; | ||
|
||
@Component({ | ||
selector: 'jhi-feedback-analysis', | ||
templateUrl: './feedback-analysis.component.html', | ||
standalone: true, | ||
imports: [ArtemisSharedModule], | ||
providers: [FeedbackAnalysisService], | ||
}) | ||
export class FeedbackAnalysisComponent implements OnInit { | ||
@Input() exerciseTitle: string; | ||
@Input() exerciseId: number; | ||
feedbackDetails: FeedbackDetail[] = []; | ||
|
||
constructor( | ||
private feedbackAnalysisService: FeedbackAnalysisService, | ||
private alertService: AlertService, | ||
) {} | ||
|
||
ngOnInit(): void { | ||
this.loadFeedbackDetails(this.exerciseId); | ||
} | ||
|
||
async loadFeedbackDetails(exerciseId: number): Promise<void> { | ||
try { | ||
this.feedbackDetails = await this.feedbackAnalysisService.getFeedbackDetailsForExercise(exerciseId); | ||
} catch (error) { | ||
this.alertService.error(`artemisApp.programmingExercise.configureGrading.feedbackAnalysis.error`); | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...p/app/exercises/programming/manage/grading/feedback-analysis/feedback-analysis.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { BaseApiHttpService } from 'app/course/learning-paths/services/base-api-http.service'; | ||
|
||
export interface FeedbackDetail { | ||
count: number; | ||
relativeCount: number; | ||
detailText: string; | ||
testCaseName: string; | ||
taskNumber: number; | ||
} | ||
|
||
@Injectable() | ||
export class FeedbackAnalysisService extends BaseApiHttpService { | ||
private readonly EXERCISE_RESOURCE_URL = 'exercises'; | ||
|
||
getFeedbackDetailsForExercise(exerciseId: number): Promise<FeedbackDetail[]> { | ||
return this.get<FeedbackDetail[]>(`${this.EXERCISE_RESOURCE_URL}/${exerciseId}/feedback-details`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.