From 870f648fbd0b7d61598fe57b15b4a66647a918fe Mon Sep 17 00:00:00 2001 From: "SD." Date: Mon, 14 Oct 2024 13:36:00 +1100 Subject: [PATCH 1/2] Add copy button without practical function --- .../instructor-course-enroll-page.component.html | 10 ++++++++++ .../instructor-course-enroll-page.component.ts | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.html b/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.html index c73db728e8f..aef2706a2f3 100644 --- a/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.html +++ b/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.html @@ -108,6 +108,16 @@

Enroll Students for {{ courseId }}

Enroll students + +
diff --git a/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.ts b/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.ts index a7344b7a82a..b13d1357953 100644 --- a/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.ts +++ b/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.ts @@ -656,4 +656,11 @@ export class InstructorCourseEnrollPageComponent implements OnInit { scrollOffset: 70, }); } + + /** + * Implement the copy method + */ + copyToClipboard() { + alert("Copy the student information") + } } From 4d2d3c96ecb23aac3f5412e427a15d4848b2de95 Mon Sep 17 00:00:00 2001 From: simon liu Date: Thu, 17 Oct 2024 15:29:19 +1100 Subject: [PATCH 2/2] Implemented copyToClipboard function. --- .../instructor-course-enroll-page.component.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.ts b/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.ts index b13d1357953..84892cbba3d 100644 --- a/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.ts +++ b/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.ts @@ -660,7 +660,12 @@ export class InstructorCourseEnrollPageComponent implements OnInit { /** * Implement the copy method */ - copyToClipboard() { - alert("Copy the student information") + copyToClipboard(): void { + const existingStudentsHOTInstance: Handsontable = this.hotRegisterer.getInstance(this.existingStudentsHOT); + const newStudentsHOTInstance: Handsontable = this.hotRegisterer.getInstance(this.newStudentsHOT); + + const existingStudentsData = existingStudentsHOTInstance.getData(); + + newStudentsHOTInstance.loadData(existingStudentsData); } }