Skip to content
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

[#13174] Add toggle to hide self responses on feedback results page #13186

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"src/web/robots.txt"
],
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/web/styles.scss"
]
},
Expand Down
1,703 changes: 1,060 additions & 643 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@ng-bootstrap/ng-bootstrap": "^15.1.2",
"@popperjs/core": "^2.11.8",
"@tinymce/tinymce-angular": "^7.0.0",
"bootstrap": "^5.3.3",
"d3": "^7.8.5",
"file-saver": "^2.0.5",
"firebase": "^10.7.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<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 && !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 @@ -25,6 +25,9 @@ import { FeedbackQuestionModel } from '../../pages-session/session-result-page/s
})
export class QuestionResponsePanelComponent {

@Input()
hideSelfResponses: boolean = false;

readonly RESPONSE_HIDDEN_QUESTIONS: FeedbackQuestionType[] = [
FeedbackQuestionType.CONTRIB,
];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<!-- Add 'Hide my own responses' Switch-->
<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>
<h1>
Feedback Session Results
</h1>
Expand Down Expand Up @@ -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 @@ -59,6 +59,7 @@ export class SessionResultPageComponent implements OnInit {

// enum
Intent: typeof Intent = Intent;
hideSelfResponses: boolean = false;

session: FeedbackSession = {
courseId: '',
Expand Down Expand Up @@ -96,7 +97,6 @@ export class SessionResultPageComponent implements OnInit {

previewAsPerson: string = '';
isPreviewHintExpanded: boolean = false;

isCourseLoading: boolean = true;
isFeedbackSessionDetailsLoading: boolean = true;
isFeedbackSessionResultsLoading: boolean = true;
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 @@ -23,16 +24,17 @@ const routes: Routes = [
* Module for feedback session result page.
*/
@NgModule({
imports: [
CommonModule,
QuestionTextWithInfoModule,
StudentViewResponsesModule,
SingleStatisticsModule,
RouterModule.forChild(routes),
LoadingSpinnerModule,
LoadingRetryModule,
QuestionResponsePanelModule,
],
imports: [
CommonModule,
QuestionTextWithInfoModule,
StudentViewResponsesModule,
SingleStatisticsModule,
RouterModule.forChild(routes),
LoadingSpinnerModule,
LoadingRetryModule,
QuestionResponsePanelModule,
FormsModule,
],
declarations: [
SessionResultPageComponent,
],
Expand Down
Loading