Skip to content

Commit

Permalink
SAK-50178 grader Show feedback and private remove links appropriately (
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianfish authored Jun 18, 2024
1 parent 95c8d65 commit 2f74c2c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions webcomponents/bundle/src/main/bundle/grader.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
at=at
attachment=Attachment
confirm_remove_feedback_comment=Are you sure you want to remove the feedback comment?
confirm_remove_private_notes=Are you sure you want to remove the private notes?
done=Done
grade=Grade:
no_submission=No submission
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,22 +304,22 @@ export class SakaiGrader extends graderRenderingMixin(gradableDataMixin(SakaiEle
this._showingFullPrivateNotes = false;
this._allPrivateNotesVisible = false;
this.updateComplete.then(() => this._setupVisibleFlags());
} else {
this._privateNotesRemoved = false;
}
}

_toggleFeedbackCommentEditor() {

this._feedbackCommentEditorShowing = !this._feedbackCommentEditorShowing;

this._showRemoveFeedbackComment
= !this._feedbackCommentEditorShowing && (!this.modified
|| this._submission.feedbackComment === this._nonEditedSubmission.feedbackComment);

if (!this._feedbackCommentEditorShowing) {

this._showingFullFeedbackComment = false;
this._allFeedbackCommentVisible = false;
this.updateComplete.then(() => this._setupVisibleFlags());
} else {
this._feedbackCommentRemoved = false;
}
}

Expand Down Expand Up @@ -749,6 +749,8 @@ export class SakaiGrader extends graderRenderingMixin(gradableDataMixin(SakaiEle

_removePrivateNotes() {

if (!confirm(this.i18n.confirm_remove_private_notes)) return false;

this._submission.privateNotes = "";
this.privateNotesEditor && this.privateNotesEditor.setData("");
this.modified = true;
Expand All @@ -757,6 +759,8 @@ export class SakaiGrader extends graderRenderingMixin(gradableDataMixin(SakaiEle

_removeFeedbackComment() {

if (!confirm(this.i18n.confirm_remove_feedback_comment)) return false;

this._submission.feedbackComment = "";
this.feedbackCommentEditor && this.feedbackCommentEditor.setData("");
this.modified = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ export const graderRenderingMixin = Base => class extends Base {
</button>
</div>
</div>
<div class="mt-2 ms-3 ${this._showRemoveFeedbackComment ? "d-block" : "d-none"}">
<div class="mt-2 ms-3 ${!this._feedbackCommentEditorShowing ? "d-block" : "d-none"}">
<button class="btn btn-transparent text-decoration-underline"
@click=${this._removeFeedbackComment}>
${this.i18n["gen.remove"]}
Expand Down Expand Up @@ -625,14 +625,12 @@ export const graderRenderingMixin = Base => class extends Base {
</button>
</div>
</div>
${!this.modified || this._submission.privateNotes === this._nonEditedSubmission.privateNotes ? html`
<div class="mt-2 ms-3 ${this._privateNotesEditorShowing ? "d-none" : "d-block"}">
<button class="btn btn-transparent text-decoration-underline"
@click=${this._removePrivateNotes}>
${this.i18n["gen.remove"]}
</button>
</div>
` : nothing }
` : nothing }
<div id="private-notes-block" class="ms-2 ${this._privateNotesEditorShowing ? "d-block" : "d-none"}">
Expand Down

0 comments on commit 2f74c2c

Please sign in to comment.