Skip to content

Commit

Permalink
[#12649] When adding a comment while submitting responses, show visib…
Browse files Browse the repository at this point in the history
…ility of the comment as well (#12659)

* Add visibility information for question comments

* Fix lint issue

* Fix snapshot issues

* Standardise text with existing one in response body

* Update snapshots

---------

Co-authored-by: Wei Qing <[email protected]>
Co-authored-by: Jason Qiu <[email protected]>
Co-authored-by: Dominic Lim <[email protected]>
  • Loading branch information
4 people authored Dec 31, 2023
1 parent 8643431 commit e33c810
Show file tree
Hide file tree
Showing 2 changed files with 140 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,20 @@ <h2 class="question-details"><b>Question {{ model.questionNumber }}: </b>{{ mode
</div>

<div id="comment-section-qn-{{ model.questionNumber }}-idx-{{ i }}" class="col-12 margin-bottom-20px margin-top-10px indent">
<div *ngIf="recipientSubmissionFormModel.commentByGiver">
<div class="card-body visibility-card">
<p class="text-secondary">Only the following persons can see your comments: </p>
<ul class="visibility-list text-secondary">
<li *ngIf="model.recipientType === FeedbackParticipantType.SELF">You can see your own feedback in the results page later on.</li>
<ng-container *ngFor="let visibilityType of FeedbackVisibilityType | enumToArray">
<li *ngIf="visibilityStateMachine.isVisibilityTypeApplicable(visibilityType) && visibilityStateMachine.hasAnyVisibilityControl(visibilityType)">
{{ visibilityType | visibilityEntityName:model.recipientType:model.numberOfEntitiesToGiveFeedbackToSetting:model.customNumberOfEntitiesToGiveFeedbackTo }} {{ visibilityStateMachine.getVisibilityControlUnderVisibilityType(visibilityType) | visibilityCapability }}
</li>
</ng-container>
<li *ngIf="!visibilityStateMachine.hasAnyVisibilityControlForAll()">No-one can see your responses</li>
</ul>
</div>
</div>
<div *ngIf="recipientSubmissionFormModel.commentByGiver && recipientSubmissionFormModel.commentByGiver.originalComment else newComment">
<tm-comment-row [mode]="CommentRowMode.EDIT" [isVisibilityOptionEnabled]="false"
[model]="recipientSubmissionFormModel.commentByGiver"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,27 @@ exports[`SessionSubmissionPageComponent should snap with feedback session questi
class="col-12 margin-bottom-20px margin-top-10px indent"
id="comment-section-qn-1-idx-0"
>
<div>
<div
class="card-body visibility-card"
>
<p
class="text-secondary"
>
Only the following persons can see your comments:
</p>
<ul
class="visibility-list text-secondary"
>
<li>
Other students in the course can see your response, but not the name of the recipient, or your name
</li>
<li>
Instructors in this course can see your response, but not the name of the recipient, or your name
</li>
</ul>
</div>
</div>
<div>
<tm-comment-row>
<div
Expand Down Expand Up @@ -1294,6 +1315,27 @@ exports[`SessionSubmissionPageComponent should snap with feedback session questi
class="col-12 margin-bottom-20px margin-top-10px indent"
id="comment-section-qn-3-idx-0"
>
<div>
<div
class="card-body visibility-card"
>
<p
class="text-secondary"
>
Only the following persons can see your comments:
</p>
<ul
class="visibility-list text-secondary"
>
<li>
Your team members can see your response, but not the name of the recipient, or your name
</li>
<li>
Instructors in this course can see your response, but not the name of the recipient, or your name
</li>
</ul>
</div>
</div>
<div
style="display: inline-block;"
>
Expand Down Expand Up @@ -1693,6 +1735,27 @@ exports[`SessionSubmissionPageComponent should snap with feedback session questi
class="col-12 margin-bottom-20px margin-top-10px indent"
id="comment-section-qn-4-idx-0"
>
<div>
<div
class="card-body visibility-card"
>
<p
class="text-secondary"
>
Only the following persons can see your comments:
</p>
<ul
class="visibility-list text-secondary"
>
<li>
The receiving students can see your response, the name of the recipient, and your name
</li>
<li>
Instructors in this course can see your response, the name of the recipient, and your name
</li>
</ul>
</div>
</div>
<div>
<tm-comment-row>
<div
Expand Down Expand Up @@ -3927,6 +3990,27 @@ exports[`SessionSubmissionPageComponent should snap with feedback session questi
class="col-12 margin-bottom-20px margin-top-10px indent"
id="comment-section-qn-1-idx-0"
>
<div>
<div
class="card-body visibility-card"
>
<p
class="text-secondary"
>
Only the following persons can see your comments:
</p>
<ul
class="visibility-list text-secondary"
>
<li>
Other students in the course can see your response, but not the name of the recipient, or your name
</li>
<li>
Instructors in this course can see your response, but not the name of the recipient, or your name
</li>
</ul>
</div>
</div>
<div>
<tm-comment-row>
<div
Expand Down Expand Up @@ -4145,6 +4229,27 @@ exports[`SessionSubmissionPageComponent should snap with feedback session questi
class="col-12 margin-bottom-20px margin-top-10px indent"
id="comment-section-qn-3-idx-0"
>
<div>
<div
class="card-body visibility-card"
>
<p
class="text-secondary"
>
Only the following persons can see your comments:
</p>
<ul
class="visibility-list text-secondary"
>
<li>
Your team members can see your response, but not the name of the recipient, or your name
</li>
<li>
Instructors in this course can see your response, but not the name of the recipient, or your name
</li>
</ul>
</div>
</div>
<div
style="display: inline-block;"
>
Expand Down Expand Up @@ -4548,6 +4653,27 @@ exports[`SessionSubmissionPageComponent should snap with feedback session questi
class="col-12 margin-bottom-20px margin-top-10px indent"
id="comment-section-qn-4-idx-0"
>
<div>
<div
class="card-body visibility-card"
>
<p
class="text-secondary"
>
Only the following persons can see your comments:
</p>
<ul
class="visibility-list text-secondary"
>
<li>
The receiving students can see your response, the name of the recipient, and your name
</li>
<li>
Instructors in this course can see your response, the name of the recipient, and your name
</li>
</ul>
</div>
</div>
<div>
<tm-comment-row>
<div
Expand Down

0 comments on commit e33c810

Please sign in to comment.