Skip to content

Commit

Permalink
implement the issue TEAMMATES#13175
Browse files Browse the repository at this point in the history
  • Loading branch information
EVALEEE committed Oct 15, 2024
1 parent 6d4f9f4 commit eae7801
Show file tree
Hide file tree
Showing 7 changed files with 139 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q
<tm-question-response-panel
RESPONSE_HIDDEN_QUESTIONS={[Function Array]}
feedbackSessionsService={[Function FeedbackSessionsService]}
hideSelfResponses="false"
intent={[Function String]}
previewAsPerson=""
questions={[Function Array]}
Expand Down Expand Up @@ -438,6 +439,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q
<tm-question-response-panel
RESPONSE_HIDDEN_QUESTIONS={[Function Array]}
feedbackSessionsService={[Function FeedbackSessionsService]}
hideSelfResponses="false"
intent={[Function String]}
previewAsPerson=""
questions={[Function Array]}
Expand Down Expand Up @@ -745,6 +747,7 @@ exports[`QuestionResponsePanelComponent should snap with questions and responses
<tm-question-response-panel
RESPONSE_HIDDEN_QUESTIONS={[Function Array]}
feedbackSessionsService={[Function FeedbackSessionsService]}
hideSelfResponses="false"
intent={[Function String]}
previewAsPerson=""
questions={[Function Array]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
<strong>Other responses (to you): </strong>Responses are not visible to you.
</div>
</ng-template>
<div class="given-responses mt-4" *ngIf="question.responsesFromSelf.length">
<!-- <div class="given-responses mt-4" *ngIf="question.responsesFromSelf.length">-->
<div class="given-responses mt-4" *ngIf="question.responsesFromSelf.length && !hideSelfResponses">
<strong>Your own responses (to others):</strong>
<div *ngFor="let responseFromSelf of question.responsesFromSelf">
<tm-student-view-responses [responses]="[responseFromSelf]" [isSelfResponses]="true" [feedbackQuestion]="question.feedbackQuestion" [timezone]="session.timeZone" [statistics]="question.questionStatistics"></tm-student-view-responses>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ export class QuestionResponsePanelComponent {
@Input()
previewAsPerson: string = '';

@Input()
hideSelfResponses: boolean = false;

canUserSeeResponses(question: FeedbackQuestionModel): boolean {
const showResponsesTo: FeedbackVisibilityType[] = question.feedbackQuestion.showResponsesTo;
if (this.intent === Intent.STUDENT_RESULT) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ exports[`SessionResultPageComponent should snap when previewing results 1`] = `
formattedSessionClosingTime=""
formattedSessionOpeningTime=""
hasFeedbackSessionResultsLoadingFailed="false"
hideSelfResponses="false"
instructorService={[Function InstructorService]}
intent={[Function String]}
isCourseLoading="false"
Expand Down Expand Up @@ -128,6 +129,20 @@ exports[`SessionResultPageComponent should snap when previewing results 1`] = `
</div>
</div>
</div>
</div><div
class="form-check form-switch"
>
<input
class="form-check-input"
id="hideOwnResponses"
type="checkbox"
/>
<label
class="form-check-label"
for="hideOwnResponses"
>
Hide my own responses
</label>
</div><tm-loading-retry>
<div>
<div
Expand Down Expand Up @@ -165,6 +180,7 @@ exports[`SessionResultPageComponent should snap when session results failed to l
formattedSessionClosingTime=""
formattedSessionOpeningTime=""
hasFeedbackSessionResultsLoadingFailed={[Function Boolean]}
hideSelfResponses="false"
instructorService={[Function InstructorService]}
intent={[Function String]}
isCourseLoading="false"
Expand Down Expand Up @@ -277,6 +293,20 @@ exports[`SessionResultPageComponent should snap when session results failed to l
</div>
</div>
</div>
</div><div
class="form-check form-switch"
>
<input
class="form-check-input"
id="hideOwnResponses"
type="checkbox"
/>
<label
class="form-check-label"
for="hideOwnResponses"
>
Hide my own responses
</label>
</div><tm-loading-retry>
<div
class="text-center"
Expand Down Expand Up @@ -317,6 +347,7 @@ exports[`SessionResultPageComponent should snap with an open feedback session wi
formattedSessionClosingTime=""
formattedSessionOpeningTime=""
hasFeedbackSessionResultsLoadingFailed="false"
hideSelfResponses="false"
instructorService={[Function InstructorService]}
intent={[Function String]}
isCourseLoading="false"
Expand Down Expand Up @@ -429,6 +460,20 @@ exports[`SessionResultPageComponent should snap with an open feedback session wi
</div>
</div>
</div>
</div><div
class="form-check form-switch"
>
<input
class="form-check-input"
id="hideOwnResponses"
type="checkbox"
/>
<label
class="form-check-label"
for="hideOwnResponses"
>
Hide my own responses
</label>
</div><tm-loading-retry>
<div>
<div
Expand Down Expand Up @@ -466,6 +511,7 @@ exports[`SessionResultPageComponent should snap with default fields 1`] = `
formattedSessionClosingTime=""
formattedSessionOpeningTime=""
hasFeedbackSessionResultsLoadingFailed="false"
hideSelfResponses="false"
instructorService={[Function InstructorService]}
intent={[Function String]}
isCourseLoading="false"
Expand Down Expand Up @@ -578,6 +624,20 @@ exports[`SessionResultPageComponent should snap with default fields 1`] = `
</div>
</div>
</div>
</div><div
class="form-check form-switch"
>
<input
class="form-check-input"
id="hideOwnResponses"
type="checkbox"
/>
<label
class="form-check-label"
for="hideOwnResponses"
>
Hide my own responses
</label>
</div><tm-loading-retry>
<div>
<div
Expand Down Expand Up @@ -615,6 +675,7 @@ exports[`SessionResultPageComponent should snap with session details and results
formattedSessionClosingTime=""
formattedSessionOpeningTime=""
hasFeedbackSessionResultsLoadingFailed="false"
hideSelfResponses="false"
instructorService={[Function InstructorService]}
intent={[Function String]}
isCourseLoading={[Function Boolean]}
Expand Down Expand Up @@ -676,7 +737,21 @@ exports[`SessionResultPageComponent should snap with session details and results
Loading...
</div>
</div>
</tm-loading-spinner><tm-loading-retry>
</tm-loading-spinner><div
class="form-check form-switch"
>
<input
class="form-check-input"
id="hideOwnResponses"
type="checkbox"
/>
<label
class="form-check-label"
for="hideOwnResponses"
>
Hide my own responses
</label>
</div><tm-loading-retry>
<tm-loading-spinner>
<div
class="loading-container"
Expand Down Expand Up @@ -713,6 +788,7 @@ exports[`SessionResultPageComponent should snap with session details loaded and
formattedSessionClosingTime=""
formattedSessionOpeningTime=""
hasFeedbackSessionResultsLoadingFailed="false"
hideSelfResponses="false"
instructorService={[Function InstructorService]}
intent={[Function String]}
isCourseLoading="false"
Expand Down Expand Up @@ -825,6 +901,20 @@ exports[`SessionResultPageComponent should snap with session details loaded and
</div>
</div>
</div>
</div><div
class="form-check form-switch"
>
<input
class="form-check-input"
id="hideOwnResponses"
type="checkbox"
/>
<label
class="form-check-label"
for="hideOwnResponses"
>
Hide my own responses
</label>
</div><tm-loading-retry>
<tm-loading-spinner>
<div
Expand Down Expand Up @@ -862,6 +952,7 @@ exports[`SessionResultPageComponent should snap with user that is logged in and
formattedSessionClosingTime=""
formattedSessionOpeningTime=""
hasFeedbackSessionResultsLoadingFailed="false"
hideSelfResponses="false"
instructorService={[Function InstructorService]}
intent={[Function String]}
isCourseLoading="false"
Expand Down Expand Up @@ -975,6 +1066,20 @@ exports[`SessionResultPageComponent should snap with user that is logged in and
</div>
</div>
</div>
</div><div
class="form-check form-switch"
>
<input
class="form-check-input"
id="hideOwnResponses"
type="checkbox"
/>
<label
class="form-check-label"
for="hideOwnResponses"
>
Hide my own responses
</label>
</div><tm-loading-retry>
<div>
<div
Expand Down Expand Up @@ -1012,6 +1117,7 @@ exports[`SessionResultPageComponent should snap with user that is not logged in
formattedSessionClosingTime=""
formattedSessionOpeningTime=""
hasFeedbackSessionResultsLoadingFailed="false"
hideSelfResponses="false"
instructorService={[Function InstructorService]}
intent={[Function String]}
isCourseLoading="false"
Expand Down Expand Up @@ -1124,6 +1230,20 @@ exports[`SessionResultPageComponent should snap with user that is not logged in
</div>
</div>
</div>
</div><div
class="form-check form-switch"
>
<input
class="form-check-input"
id="hideOwnResponses"
type="checkbox"
/>
<label
class="form-check-label"
for="hideOwnResponses"
>
Hide my own responses
</label>
</div><tm-loading-retry>
<div>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ <h4>Previewing Session Results as
</div>
</div>

<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="hideOwnResponses" [(ngModel)]="hideSelfResponses">
<label class="form-check-label" for="hideOwnResponses">Hide my own responses</label>
</div>

<div class="card bg-light" style="margin-bottom: 20px;" *ngIf="intent === Intent.INSTRUCTOR_RESULT && !isCourseLoading && !isFeedbackSessionDetailsLoading">
<div class="card-body">
If you wish to view the feedback results of the entire course, <a href="javascript:;" (click)="navigateToSessionReportPage(); $event.preventDefault()">click here</a>.
Expand All @@ -82,6 +87,7 @@ <h4>Previewing Session Results as
</div>
<tm-question-response-panel [questions]="questions" [session]="session"
[intent]="intent" [regKey]="regKey" [previewAsPerson]="previewAsPerson"
[hideSelfResponses]="hideSelfResponses"
></tm-question-response-panel>
</div>
</tm-loading-retry>
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ export class SessionResultPageComponent implements OnInit {
feedbackSessionId: string | undefined = '';
studentId: string | undefined = '';

hideSelfResponses: boolean = false;

private backendUrl: string = environment.backendUrl;

constructor(private feedbackQuestionsService: FeedbackQuestionsService,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { RouterModule, Routes } from '@angular/router';

import { SessionResultPageComponent } from './session-result-page.component';
Expand All @@ -25,6 +26,7 @@ const routes: Routes = [
@NgModule({
imports: [
CommonModule,
FormsModule,
QuestionTextWithInfoModule,
StudentViewResponsesModule,
SingleStatisticsModule,
Expand Down

0 comments on commit eae7801

Please sign in to comment.