diff --git a/src/app/services/projectService.spec.ts b/src/app/services/projectService.spec.ts index 9083c3302b0..1b3b469bb74 100644 --- a/src/app/services/projectService.spec.ts +++ b/src/app/services/projectService.spec.ts @@ -79,8 +79,6 @@ describe('ProjectService', () => { // TODO: add test for service.removeDuplicatePaths() // TODO: add test for service.pathsEqual() // TODO: add test for service.getNodeContentByNodeId() - // TODO: add test for service.createGroup() - // TODO: add test for service.createNode() // TODO: add test for service.createNodeInside() // TODO: add test for service.createNodeAfter() // TODO: add test for service.insertNodeAfterInGroups() diff --git a/src/assets/wise5/authoringTool/addLesson/add-lesson-configure/add-lesson-configure.component.ts b/src/assets/wise5/authoringTool/addLesson/add-lesson-configure/add-lesson-configure.component.ts index 7de3dc6664e..880044e5a9b 100644 --- a/src/assets/wise5/authoringTool/addLesson/add-lesson-configure/add-lesson-configure.component.ts +++ b/src/assets/wise5/authoringTool/addLesson/add-lesson-configure/add-lesson-configure.component.ts @@ -34,9 +34,17 @@ export class AddLessonConfigureComponent { protected submit(): void { this.submitting = true; - const newLesson = this.projectService.createGroup( - this.addLessonFormGroup.controls['title'].value - ); + const newLesson = { + id: this.projectService.getNextAvailableGroupId(), + type: 'group', + title: this.addLessonFormGroup.controls['title'].value, + startId: '', + constraints: [], + transitionLogic: { + transitions: [] + }, + ids: [] + }; if (this.target === 'group0' || this.target === 'inactiveGroups') { this.projectService.createNodeInside(newLesson, this.target); } else { diff --git a/src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.ts b/src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.ts index 277af642145..800ace2427c 100644 --- a/src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.ts +++ b/src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.ts @@ -80,7 +80,18 @@ export class AddYourOwnNodeComponent { protected submit(): void { this.submitting = true; - const newNode = this.projectService.createNode(this.addNodeFormGroup.controls['title'].value); + const newNode = { + id: this.projectService.getNextAvailableNodeId(), + title: this.addNodeFormGroup.controls['title'].value, + type: 'node', + constraints: [], + transitionLogic: { + transitions: [] + }, + showSaveButton: false, + showSubmitButton: false, + components: [] + }; if (this.isGroupNode(this.targetId)) { this.projectService.createNodeInside(newNode, this.targetId); } else { diff --git a/src/assets/wise5/services/teacherProjectService.ts b/src/assets/wise5/services/teacherProjectService.ts index 3c531eafb79..bdd88d87d0d 100644 --- a/src/assets/wise5/services/teacherProjectService.ts +++ b/src/assets/wise5/services/teacherProjectService.ts @@ -82,45 +82,6 @@ export class TeacherProjectService extends ProjectService { }); } - /** - * Create a new group - * @param title the title of the group - * @returns the group object - */ - createGroup(title: string): any { - return { - id: this.getNextAvailableGroupId(), - type: 'group', - title: title, - startId: '', - constraints: [], - transitionLogic: { - transitions: [] - }, - ids: [] - }; - } - - /** - * Create a new node - * @param title the title of the node - * @returns the node object - */ - createNode(title) { - return { - id: this.getNextAvailableNodeId(), - title: title, - type: 'node', - constraints: [], - transitionLogic: { - transitions: [] - }, - showSaveButton: false, - showSubmitButton: false, - components: [] - }; - } - getNodesWithNewIds(nodes: any[]): any[] { const oldToNewIds = this.getOldToNewIds(nodes); return nodes.map((node: any) => {