Skip to content

Commit

Permalink
refactor(StudentGradingComponent, TeacherDataService): simplify logic…
Browse files Browse the repository at this point in the history
… and remove unused properties
  • Loading branch information
hirokiterashima committed Dec 19, 2024
1 parent 2e323c5 commit b97fa08
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -351,31 +351,14 @@ export class StudentGradingComponent implements OnInit {
* @returns boolean whether the workgroup should be shown
*/
private isNodeShown(nodeId: string): boolean {
let show = false;
const node = this.nodesById[nodeId];

if (node.isVisible && (this.projectService.nodeHasWork(nodeId) || this.showNonWorkNodes)) {
let currentStep = this.dataService.getCurrentStep();
if (currentStep) {
// there is a currently selected step, so check if this one matches
if (currentStep.nodeId === parseInt(nodeId)) {
show = true;
}
} else {
// there is no currently selected step, so show this one
show = true;
}
}

return show;
return (
this.nodesById[nodeId].isVisible &&
(this.projectService.nodeHasWork(nodeId) || this.showNonWorkNodes)
);
}

setSort(value: string): void {
if (this.sort === value) {
this.sort = `-${value}`;
} else {
this.sort = value;
}
protected setSort(value: string): void {
this.sort = this.sort === value ? `-${value}` : value;

// update value in the teacher data service so we can persist across view instances and
// workgroup changes
Expand Down
9 changes: 0 additions & 9 deletions src/assets/wise5/services/teacherDataService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export class TeacherDataService extends DataService {
studentData: any;
currentPeriod = null;
currentWorkgroup = null;
currentStep = null;
previousStep = null;
periods = [];
nodeGradingSort = 'team';
Expand Down Expand Up @@ -438,14 +437,6 @@ export class TeacherDataService extends DataService {
return this.currentWorkgroup;
}

setCurrentStep(step) {
this.currentStep = step;
}

getCurrentStep() {
return this.currentStep;
}

getTotalScoreByWorkgroupId(workgroupId: number) {
return this.annotationService.getTotalScore(
this.studentData.annotationsToWorkgroupId[workgroupId]
Expand Down

0 comments on commit b97fa08

Please sign in to comment.