-
Notifications
You must be signed in to change notification settings - Fork 297
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
Development
: Add client support for programming exercise feedback suggestions
#7099
Development
: Add client support for programming exercise feedback suggestions
#7099
Conversation
Programming Exercises
: Add support for Athena feedback suggestionsProgramming Exercises
: Add client-side support for feedback suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a few notes for code reviewers to make it easier to understand changes.
@@ -1,71 +0,0 @@ | |||
<div (drop)="updateAssessmentOnDrop($event)" (dragover)="$event.preventDefault()" class="card mb-3" id="assessment-detail"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for code reviewers: I renamed this component to unreferenced-feedback-detail
, as that's what it really is.
@@ -25,21 +26,22 @@ const ENTITY_STATES = [...assessmentLocksRoute]; | |||
RouterModule.forChild(ENTITY_STATES), | |||
ArtemisMarkdownModule, | |||
ArtemisGradingInstructionLinkIconModule, | |||
ArtemisFeedbackModule, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for code reviewers: This is needed to get the new feedback-suggestion-badge
component.
// For debugging: Return basic feedback suggestions for BubbleSort.java | ||
const referencedFeedbackSuggestion = new Feedback(); | ||
referencedFeedbackSuggestion.id = 1; | ||
referencedFeedbackSuggestion.credits = 1; | ||
referencedFeedbackSuggestion.text = 'FeedbackSuggestion:'; | ||
referencedFeedbackSuggestion.detailText = 'This is a referenced feedback suggestion - test test'; | ||
referencedFeedbackSuggestion.gradingInstruction = undefined; | ||
referencedFeedbackSuggestion.reference = 'file:src/de/athena/BubbleSort.java_line:14'; | ||
referencedFeedbackSuggestion.type = FeedbackType.AUTOMATIC; | ||
const unreferencedFeedbackSuggestion = new Feedback(); | ||
unreferencedFeedbackSuggestion.id = 2; | ||
unreferencedFeedbackSuggestion.credits = -1; | ||
unreferencedFeedbackSuggestion.text = 'FeedbackSuggestion:'; | ||
unreferencedFeedbackSuggestion.detailText = 'This is an unreferenced feedback suggestion'; | ||
unreferencedFeedbackSuggestion.gradingInstruction = undefined; | ||
unreferencedFeedbackSuggestion.reference = undefined; | ||
unreferencedFeedbackSuggestion.type = FeedbackType.AUTOMATIC; | ||
return of([referencedFeedbackSuggestion, unreferencedFeedbackSuggestion]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must and will be removed before the PR is merged. It's nice for testing, though.
<div (drop)="updateFeedbackOnDrop($event)" (dragover)="$event.preventDefault()" class="card mb-3" [class.is-suggestion]="isSuggestion" id="assessment-detail"> | ||
<div class="card-header"> | ||
<jhi-feedback-suggestion-badge *ngIf="isSuggestion || Feedback.isFeedbackSuggestion(feedback)" [feedback]="feedback"></jhi-feedback-suggestion-badge> | ||
<jhi-grading-instruction-link-icon *ngIf="feedback.gradingInstruction" [feedback]="feedback"></jhi-grading-instruction-link-icon> | ||
<fa-icon [icon]="faTrashAlt" class="float-end" (click)="delete()" *ngIf="!readOnly"></fa-icon> | ||
<!-- Accept/Discard for feedback suggestions --> | ||
<div class="row float-end suggestion-action-buttons" *ngIf="isSuggestion"> | ||
<button class="btn btn-success m-1" (click)="onAcceptSuggestion.emit(feedback)"> | ||
<fa-icon [icon]="faCheck"></fa-icon> | ||
<span jhiTranslate="artemisApp.assessment.detail.accept">Accept</span> | ||
</button> | ||
<button class="btn btn-danger m-1" (click)="onDiscardSuggestion.emit(feedback)"> | ||
<fa-icon [icon]="faTrash"></fa-icon> | ||
<span jhiTranslate="artemisApp.assessment.detail.discard">Discard</span> | ||
</button> | ||
</div> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for code reviewers: The card-header
and the is-suggestion
class are the only new parts apart from the rename of the component from assessment-detail
to unreferenced-feedback-detail
return !feedback.text.includes(STATIC_CODE_ANALYSIS_FEEDBACK_IDENTIFIER, 0) && !feedback.text.includes(SUBMISSION_POLICY_FEEDBACK_IDENTIFIER, 0); | ||
return !feedback.text.startsWith(STATIC_CODE_ANALYSIS_FEEDBACK_IDENTIFIER) && !feedback.text.startsWith(SUBMISSION_POLICY_FEEDBACK_IDENTIFIER); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for code reviewers: This is just a nicer way to write it
@@ -202,10 +236,6 @@ export class CodeEditorContainerComponent implements ComponentCanDeactivate { | |||
this.onFileChanged.emit(); | |||
} | |||
|
|||
updateFeedback(feedbacks: Feedback[]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for code reviewers: We now call onUpdateFeedback.emit
directly
@@ -0,0 +1,4 @@ | |||
<span class="badge" [class.on-colored-background]="onColoredBackground" [ngbTooltip]="tooltip"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<!-- File level actions --> | ||
<span class="file-icons" [ngClass]="item.checked ? 'text-white' : 'primary'"> | ||
<button [disabled]="disableActions" (click)="setRenamingNode($event)" class="btn btn-small"> | ||
<span class="file-icons" [ngClass]="item.checked ? 'text-white' : 'primary'" *ngIf="!disableActions"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for code reviewers: We now hide the file actions completely if they are not available: A tutor doesn't need to see a rename button they can't press anyway.
@@ -3,25 +3,31 @@ | |||
<button id="add-unreferenced-feedback" class="btn btn-success mt-4" (click)="addUnreferencedFeedback()" [disabled]="readOnly"> | |||
{{ 'artemisApp.fileUploadAssessment.addFeedback' | artemisTranslate }} | |||
</button> | |||
<ng-container *ngIf="!busy"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for code reviewers: The busy
property was never set to true
, so I removed this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only the part with <div *ngFor="let suggestion of feedbackSuggestions" class="col-12 col-lg-6 col-xl-6">
(line 22+) is new.
faExclamation = faExclamation; | ||
faBalanceScaleRight = faBalanceScaleRight; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for code reviewers: This was just unused
b4932cc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, did a quick code review. Retesting should not be necessary for these changes
Quick links:
Programming exercises
: Add Athena Feedback Suggestions #7094Development
: Add client support for programming exercise feedback suggestions #7099Programming exercises
: Add server support for feedback suggestions #7136Programming exercises
: Add support for feedback suggestions (both other PRs combined) #7138Checklist
General
Client
Motivation and Context
See #7094. We want to implement programming feedback suggestions on the client. Also, this PR refactors some parts of the code editor assessment area, making it more robust.
Description
Programming exercises
: Add Athena Feedback Suggestions #7094 (feature proposal).Programming exercises
: Cancelling feedback can go back too many steps #7102Programming exercises
: Inline feedback sticks to top of online editor #7033 as a byproduct (inline feedback sometimes "escapes" editor).Programming exercises
,Assessment
: Unnecessary empty space below tutor comments #6367: I slightly adjusted the spacing below the feedback cards.Steps for Testing
Prerequisites:
de.athena
and includeBubbleSort.java
because otherwise, the hardcoded example feedback suggestion will point nowhere!BubbleSort.java
andMergeSort.java
. Accept or discard them. You can get it back by not saving the whole assessment and refreshing the page. It is expected that discarded feedback re-appears this way. Try editing it as well. Check that the feedback suggestion badge always appropriately represents the state of the suggestion. Also, switch around in files again.src/de/athena
folder. The feedback suggestions badge should sum up the badges of all files and show up next to the collapsed folder.Review Progress
Performance Review
Code Review
Manual Tests
Test Coverage
Client
Screenshots
Student view: No feedback suggestion badges: