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

[#10843] Instructor viewing results: incorrect state shown briefly when expanding the non-submitters panel #11595

Merged
Merged
Show file tree
Hide file tree
Changes from 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,48 @@
</div>
</div>
<div *ngIf="isTabExpanded" @collapseAnim>
<div class="card-body p-0">
<div *ngIf="noResponseStudentsInSection.length">
<table id="no-response-table" class="table table-striped">
<thead>
<tr>
<th class="cursor-pointer" (click)="sortParticipantsBy(SortBy.TEAM_NAME)">
Team
<span class="fa-stack"><i class="fas fa-sort"></i>
<i *ngIf="sortBy === SortBy.TEAM_NAME && sortOrder === SortOrder.DESC" class="fas fa-sort-down"></i>
<i *ngIf="sortBy === SortBy.TEAM_NAME && sortOrder === SortOrder.ASC" class="fas fa-sort-up"></i>
</span>
</th>
<th id="sort-by-name" class="cursor-pointer" (click)="sortParticipantsBy(SortBy.RESPONDENT_NAME)">
Name
<span class="fa-stack"><i class="fas fa-sort"></i>
<i *ngIf="sortBy === SortBy.RESPONDENT_NAME && sortOrder === SortOrder.DESC" class="fas fa-sort-down"></i>
<i *ngIf="sortBy === SortBy.RESPONDENT_NAME && sortOrder === SortOrder.ASC" class="fas fa-sort-up"></i>
</span>
</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let noResponseStudent of noResponseStudentsInSection">
<td>{{ noResponseStudent.teamName }}</td>
<td>{{ noResponseStudent.name }}</td>
<td>
<a *ngIf="!isDisplayOnly; else displayOnlySubmitResponseButton" tmRouterLink="/web/sessions/submission" rel="noopener noreferrer" target="_blank"
[queryParams]="{courseid: session.courseId, fsname: session.feedbackSessionName, moderatedperson: noResponseStudent.email}"
class="btn btn-light btn-sm button">
Submit responses
</a>
<ng-template #displayOnlySubmitResponseButton><a class="btn btn-light btn-sm button">Submit response</a></ng-template>
</td>
</tr>
</tbody>
</table>
</div>
<div *ngIf="!noResponseStudentsInSection.length">
<i>All students have responded to some questions in this session.</i>
<div *tmIsLoading="!isNoResponseStudentsLoaded" class="card-body">
<div class="card-body p-0">
<div *ngIf="noResponseStudentsInSection.length">
<table id="no-response-table" class="table table-striped">
<thead>
<tr>
<th class="cursor-pointer" (click)="sortParticipantsBy(SortBy.TEAM_NAME)">
Team
<span class="fa-stack"><i class="fas fa-sort"></i>
<i *ngIf="sortBy === SortBy.TEAM_NAME && sortOrder === SortOrder.DESC" class="fas fa-sort-down"></i>
<i *ngIf="sortBy === SortBy.TEAM_NAME && sortOrder === SortOrder.ASC" class="fas fa-sort-up"></i>
</span>
</th>
<th id="sort-by-name" class="cursor-pointer" (click)="sortParticipantsBy(SortBy.RESPONDENT_NAME)">
Name
<span class="fa-stack"><i class="fas fa-sort"></i>
<i *ngIf="sortBy === SortBy.RESPONDENT_NAME && sortOrder === SortOrder.DESC" class="fas fa-sort-down"></i>
<i *ngIf="sortBy === SortBy.RESPONDENT_NAME && sortOrder === SortOrder.ASC" class="fas fa-sort-up"></i>
</span>
</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let noResponseStudent of noResponseStudentsInSection">
<td>{{ noResponseStudent.teamName }}</td>
<td>{{ noResponseStudent.name }}</td>
<td>
<a *ngIf="!isDisplayOnly; else displayOnlySubmitResponseButton" tmRouterLink="/web/sessions/submission" rel="noopener noreferrer" target="_blank"
[queryParams]="{courseid: session.courseId, fsname: session.feedbackSessionName, moderatedperson: noResponseStudent.email}"
class="btn btn-light btn-sm button">
Submit responses
</a>
<ng-template #displayOnlySubmitResponseButton><a class="btn btn-light btn-sm button">Submit response</a></ng-template>
</td>
</tr>
</tbody>
</table>
</div>
<div *ngIf="!noResponseStudentsInSection.length">
<i>All students have responded to some questions in this session.</i>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { RouterModule } from '@angular/router';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';

import { LoadingSpinnerModule } from '../../components/loading-spinner/loading-spinner.module';
import { PanelChevronModule } from '../../components/panel-chevron/panel-chevron.module';
import { TeammatesRouterModule } from '../../components/teammates-router/teammates-router.module';
import { InstructorSessionNoResponsePanelComponent } from './instructor-session-no-response-panel.component';
Expand All @@ -19,6 +19,7 @@ describe('InstructorSessionNoResponsePanelComponent', () => {
HttpClientTestingModule,
NgbModule,
PanelChevronModule,
LoadingSpinnerModule,
TeammatesRouterModule,
],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class InstructorSessionNoResponsePanelComponent implements OnInit, OnChan
SortBy: typeof SortBy = SortBy;
SortOrder: typeof SortOrder = SortOrder;

@Input() isNoResponseStudentsLoaded: boolean = false;
@Input() isDisplayOnly: boolean = false;
@Input() allStudents: Student[] = [];
@Input() noResponseStudents: Student[] = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ <h1>
<tm-instructor-session-no-response-panel [allStudents]="allStudentsInCourse"
[noResponseStudents]="noResponseStudents"
[section]="section" [session]="session"
[isNoResponseStudentsLoaded]="isNoResponseStudentsLoaded"
(studentsToRemindEvent)="sendReminderToStudents($event)" ></tm-instructor-session-no-response-panel>
</div>
</tm-loading-retry>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export class InstructorSessionResultPageComponent extends InstructorCommentsComp
questionsModel: Record<string, QuestionTabModel> = {};
isQuestionsLoaded: boolean = false;
hasQuestionsLoadingFailed: boolean = false;
isNoResponseStudentsLoaded: boolean = false;

isFeedbackSessionLoading: boolean = false;
hasFeedbackSessionLoadingFailed: boolean = false;
Expand Down Expand Up @@ -270,6 +271,7 @@ export class InstructorSessionResultPageComponent extends InstructorCommentsComp
// TODO team is missing
this.noResponseStudents = this.allStudentsInCourse.filter((student: Student) =>
!feedbackSessionSubmittedGiverSet.giverIdentifiers.includes(student.email));
this.isNoResponseStudentsLoaded = true;
}, (resp: ErrorMessageOutput) => {
this.hasNoResponseLoadingFailed = true;
this.statusMessageService.showErrorToast(resp.error.message);
Expand Down