diff --git a/src/app/services/teacherProjectService.spec.ts b/src/app/services/teacherProjectService.spec.ts index 9c710ea1617..58479a719d0 100644 --- a/src/app/services/teacherProjectService.spec.ts +++ b/src/app/services/teacherProjectService.spec.ts @@ -61,7 +61,6 @@ describe('TeacherProjectService', () => { getNextAvailableNodeId(); shouldReturnTheNextAvailableGroupId(); shouldReturnTheGroupIdsInTheProject(); - shouldReturnTheMaxScoreOfTheProject(); shouldNotAddSpaceIfItDoesExist(); shouldAddSpaceIfItDoesntExist(); shouldRemoveSpaces(); @@ -293,18 +292,6 @@ function shouldReturnTheGroupIdsInTheProject() { }); } -function shouldReturnTheMaxScoreOfTheProject() { - it('should return the max score of the project', () => { - service.setProject(demoProjectJSON); - const demoProjectMaxScoreActual = service.getMaxScore(); - expect(demoProjectMaxScoreActual).toEqual(9); - service.setProject(scootersProjectJSON); - const scootersProjectMaxScoreExpected = 18; - const scootersProjectMaxScoreActual = service.getMaxScore(); - expect(scootersProjectMaxScoreActual).toEqual(scootersProjectMaxScoreExpected); - }); -} - function shouldNotAddSpaceIfItDoesExist() { it('should not add space if it does exist', () => { service.setProject(scootersProjectJSON); diff --git a/src/assets/wise5/services/teacherProjectService.ts b/src/assets/wise5/services/teacherProjectService.ts index 7cd6fe6c573..04ed3486fb9 100644 --- a/src/assets/wise5/services/teacherProjectService.ts +++ b/src/assets/wise5/services/teacherProjectService.ts @@ -670,42 +670,6 @@ export class TeacherProjectService extends ProjectService { } } - addNodeToGroup(node, group) { - if (this.isGroupHasNode(group)) { - this.insertAfterLastNode(node, group); - } else { - this.insertAsFirstNode(node, group); - } - } - - isGroupHasNode(group) { - return group.ids.length != 0; - } - - getLastNodeInGroup(group) { - const lastNodeId = group.ids[group.ids.length - 1]; - return this.idToNode[lastNodeId]; - } - - insertAsFirstNode(node, group) { - this.insertNodeInsideOnlyUpdateTransitions(node.id, group.id); - this.insertNodeInsideInGroups(node.id, group.id); - } - - insertAfterLastNode(node, group) { - const lastNode = this.getLastNodeInGroup(group); - this.insertNodeAfterInTransitions(node, lastNode.id); - this.insertNodeAfterInGroups(node.id, lastNode.id); - } - - createNodeAndAddToLocalStorage(nodeTitle) { - const node = this.createNode(nodeTitle); - this.setIdToNode(node.id, node); - this.addNode(node); - this.applicationNodes.push(node); - return node; - } - getAutomatedAssessmentProjectId(): number { return this.configService.getConfigParam('automatedAssessmentProjectId') || -1; } @@ -1789,38 +1753,6 @@ export class TeacherProjectService extends ProjectService { } } - /** - * TODO: Deprecated, should be removed; replaced by getMaxScoreForWorkgroupId in - * ClassroomStatusService - * Get the max score for the project. If the project contains branches, we - * will only calculate the max score for a single path from the first node - * to the last node in the project. - * @returns the max score for the project or null if none of the components in the project - * has max scores. - */ - getMaxScore() { - let maxScore = null; - const startNodeId = this.getStartNodeId(); - - // get all the paths in the project - const allPaths = this.getAllPaths([], startNodeId); - - if (allPaths != null && allPaths.length > -1) { - const firstPath = allPaths[0]; - for (let nodeId of firstPath) { - const nodeMaxScore = this.getMaxScoreForNode(nodeId); - if (nodeMaxScore != null) { - if (maxScore == null) { - maxScore = nodeMaxScore; - } else { - maxScore += nodeMaxScore; - } - } - } - } - return maxScore; - } - setMaxScoreForComponent(nodeId: string, componentId: string, maxScore: number): void { const component = this.getComponent(nodeId, componentId); if (component != null) {