From a28c36aae73913b309a1bd0c0a5bc6ebb28d4563 Mon Sep 17 00:00:00 2001 From: Yong Jun Xi <89063663+TobyCyan@users.noreply.github.com> Date: Sun, 8 Feb 2026 00:10:21 +0800 Subject: [PATCH 01/23] [#13498] Remove "archive courses" back-end tests (#13510) --- .../teammates/e2e/cases/BaseE2ETestCase.java | 4 - .../cases/InstructorCoursesPageE2ETest.java | 106 ++-------- .../e2e/cases/InstructorHomePageE2ETest.java | 21 +- .../pageobjects/InstructorCoursesPage.java | 102 --------- .../e2e/pageobjects/InstructorHomePage.java | 7 - .../pageobjects/InstructorHomePageSql.java | 7 - .../resources/data/AdminHomePageE2ETest.json | 1 - .../data/InstructorCourseEditPageE2ETest.json | 1 - .../InstructorCourseEditPageE2ETestSql.json | 1 - .../data/InstructorCoursesPageE2ETest.json | 1 - .../InstructorNotificationsPageE2ETest.json | 1 - .../InstructorStudentListPageE2ETest.json | 3 - .../storage/sqlsearch/InstructorSearchIT.java | 14 +- .../it/storage/sqlsearch/StudentSearchIT.java | 6 - .../it/ui/webapi/GetCoursesActionIT.java | 4 +- .../it/ui/webapi/SearchStudentsActionIT.java | 4 +- .../data/FeedbackResponsesITBundle.json | 54 ----- src/it/resources/data/GetCoursesActionIT.json | 20 -- src/it/resources/data/typicalDataBundle.json | 54 ----- .../attributes/InstructorAttributesTest.java | 11 - .../logic/core/AccountsLogicTest.java | 21 -- .../core/FeedbackQuestionsLogicTest.java | 9 - .../logic/core/FeedbackSessionsLogicTest.java | 4 +- .../logic/core/InstructorsLogicTest.java | 19 +- .../logic/core/StudentsLogicTest.java | 12 +- .../sqlui/webapi/GetCoursesActionTest.java | 13 -- .../storage/api/InstructorsDbTest.java | 35 +-- .../search/AccountRequestSearchTest.java | 3 +- .../storage/search/InstructorSearchTest.java | 6 - .../storage/search/StudentSearchTest.java | 18 +- .../java/teammates/test/AbstractBackDoor.java | 45 ---- .../ui/webapi/ArchiveCourseActionTest.java | 129 ----------- .../ui/webapi/GetCoursesActionTest.java | 24 +-- .../webapi/GetFeedbackSessionsActionTest.java | 4 +- .../ui/webapi/SearchStudentsActionTest.java | 4 +- .../data/CourseRosterDataBundle.json | 25 --- .../resources/data/EmailGeneratorTest.json | 8 - .../FeedbackContributionQuestionTest.json | 83 -------- .../data/FeedbackResponseCommentCRUDTest.json | 1 - .../data/FeedbackResponseVisibilityTest.json | 6 - .../FeedbackSessionResultsBundleTest.json | 1 - .../data/FeedbackSessionResultsTest.json | 4 - .../data/FeedbackSessionsLogicTest.json | 82 +++---- .../resources/data/GetCoursesActionTest.json | 14 -- ...tFeedbackQuestionRecipientsActionTest.json | 111 ---------- .../SqlFeedbackSessionResultsBundleTest.json | 54 ----- .../resources/data/typicalDataBundle.json | 200 +++++++----------- 47 files changed, 153 insertions(+), 1204 deletions(-) delete mode 100644 src/test/java/teammates/ui/webapi/ArchiveCourseActionTest.java diff --git a/src/e2e/java/teammates/e2e/cases/BaseE2ETestCase.java b/src/e2e/java/teammates/e2e/cases/BaseE2ETestCase.java index 7b953f7a50a..2beaaadb20e 100644 --- a/src/e2e/java/teammates/e2e/cases/BaseE2ETestCase.java +++ b/src/e2e/java/teammates/e2e/cases/BaseE2ETestCase.java @@ -256,10 +256,6 @@ protected CourseAttributes getCourse(CourseAttributes course) { return getCourse(course.getId()); } - CourseAttributes getArchivedCourse(String instructorId, String courseId) { - return BACKDOOR.getArchivedCourse(instructorId, courseId); - } - FeedbackQuestionAttributes getFeedbackQuestion(String courseId, String feedbackSessionName, int qnNumber) { return BACKDOOR.getFeedbackQuestion(courseId, feedbackSessionName, qnNumber); } diff --git a/src/e2e/java/teammates/e2e/cases/InstructorCoursesPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/InstructorCoursesPageE2ETest.java index fdc1114d1ee..9306b2ee8cf 100644 --- a/src/e2e/java/teammates/e2e/cases/InstructorCoursesPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/InstructorCoursesPageE2ETest.java @@ -18,7 +18,6 @@ import teammates.common.util.AppUrl; import teammates.common.util.Const; import teammates.e2e.pageobjects.InstructorCoursesPage; -import teammates.test.ThreadHelper; /** * SUT: {@link Const.WebPageURIs#INSTRUCTOR_COURSES_PAGE}. @@ -38,9 +37,9 @@ protected void prepareTestData() { sqlTestData = removeAndRestoreSqlDataBundle(loadSqlDataBundle("/InstructorCoursesPageE2ETest_SqlEntities.json")); courses[0] = testData.courses.get("CS1101"); - courses[1] = testData.courses.get("CS2104"); - courses[2] = testData.courses.get("CS2105"); - courses[3] = testData.courses.get("CS1231"); + courses[1] = testData.courses.get("CS1231"); + courses[2] = testData.courses.get("CS2104"); + courses[3] = testData.courses.get("CS2105"); FeedbackSessionAttributes session = testData.feedbackSessions.get("session"); InstructorAttributes instructor = testData.instructors.get("instructorCS1231"); @@ -109,12 +108,10 @@ public void testAll() { InstructorCoursesPage coursesPage = loginToPage(url, InstructorCoursesPage.class, instructorId); ______TS("verify loaded data"); - CourseAttributes[] activeCourses = { courses[0], courses[3] }; - CourseAttributes[] archivedCourses = { courses[1] }; - CourseAttributes[] deletedCourses = { courses[2] }; + CourseAttributes[] activeCourses = { courses[2], courses[0], courses[1] }; + CourseAttributes[] deletedCourses = { courses[3] }; coursesPage.verifyActiveCoursesDetails(activeCourses); - coursesPage.verifyArchivedCoursesDetails(archivedCourses); coursesPage.verifyDeletedCoursesDetails(deletedCourses); ______TS("verify statistics"); @@ -124,7 +121,7 @@ public void testAll() { coursesPage.verifyNotModifiable(courses[0].getId()); ______TS("add new course"); - CourseAttributes[] activeCoursesWithNewCourse = { courses[0], courses[3], newCourse }; + CourseAttributes[] activeCoursesWithNewCourse = { courses[0], courses[1], courses[2], newCourse }; coursesPage.addCourse(newCourse); coursesPage.verifyStatusMessage("The course has been added."); @@ -133,8 +130,8 @@ public void testAll() { verifyPresentInDatabase(newCourse); ______TS("copy course with session of modified timings"); - CourseAttributes[] activeCoursesWithCopyCourse = { courses[0], courses[3], newCourse, copyCourse }; - coursesPage.copyCourse(courses[3].getId(), copyCourse); + CourseAttributes[] activeCoursesWithCopyCourse = { courses[0], courses[1], courses[2], newCourse, copyCourse }; + coursesPage.copyCourse(courses[1].getId(), copyCourse); coursesPage.waitForConfirmationModalAndClickOk(); coursesPage.sortByCourseId(); @@ -143,7 +140,8 @@ public void testAll() { verifyPresentInDatabase(copySession); ______TS("copy course with session of same timings"); - CourseAttributes[] activeCoursesWithCopyCourse2 = { courses[0], courses[3], newCourse, copyCourse, copyCourse2 }; + CourseAttributes[] activeCoursesWithCopyCourse2 = { courses[0], courses[1], courses[2], + newCourse, copyCourse, copyCourse2 }; coursesPage.copyCourse(copyCourse.getId(), copyCourse2); coursesPage.verifyStatusMessage("The course has been added."); coursesPage.sortByCourseId(); @@ -151,42 +149,21 @@ public void testAll() { verifyPresentInDatabase(copyCourse2); verifyPresentInDatabase(copySession2); - ______TS("archive course"); - CourseAttributes[] archivedCoursesWithNewCourse = { newCourse, courses[1] }; - coursesPage.archiveCourse(newCourse.getId()); - - coursesPage.verifyStatusMessage("The course " + newCourse.getId() + " has been archived. " - + "It will not appear on the home page anymore."); - coursesPage.verifyNumActiveCourses(4); - coursesPage.verifyArchivedCoursesDetails(archivedCoursesWithNewCourse); - verifyCourseArchivedInDatabase(instructorId, newCourse); - - ______TS("unarchive course"); - CourseAttributes[] activeCoursesWithNewCourseSortedByName = { copyCourse, copyCourse2, courses[3], newCourse, - courses[0] }; - coursesPage.unarchiveCourse(newCourse.getId()); - - coursesPage.verifyStatusMessage("The course has been unarchived."); - coursesPage.verifyNumArchivedCourses(1); - coursesPage.sortByCourseName(); - coursesPage.verifyActiveCoursesDetails(activeCoursesWithNewCourseSortedByName); - verifyCourseNotArchivedInDatabase(instructorId, newCourse); - ______TS("move active course to recycle bin"); newCourse.setDeletedAt(Instant.now()); - CourseAttributes[] deletedCoursesWithNewCourse = { newCourse, courses[2] }; + CourseAttributes[] deletedCoursesWithNewCourse = { newCourse, courses[3] }; coursesPage.moveCourseToRecycleBin(newCourse.getId()); coursesPage.verifyStatusMessage("The course " + newCourse.getId() + " has been deleted. " + "You can restore it from the Recycle Bin manually."); - coursesPage.verifyNumActiveCourses(4); + coursesPage.verifyNumActiveCourses(5); coursesPage.verifyDeletedCoursesDetails(deletedCoursesWithNewCourse); assertTrue(BACKDOOR.isCourseInRecycleBin(newCourse.getId())); ______TS("restore active course"); newCourse.setDeletedAt(null); CourseAttributes[] activeCoursesWithNewCourseSortedByCreationDate = - { copyCourse2, copyCourse, newCourse, courses[0], courses[3] }; + { copyCourse2, copyCourse, newCourse, courses[2], courses[0], courses[1] }; coursesPage.restoreCourse(newCourse.getId()); coursesPage.verifyStatusMessage("The course " + newCourse.getId() + " has been restored."); @@ -196,30 +173,8 @@ public void testAll() { coursesPage.verifyActiveCoursesDetails(activeCoursesWithNewCourseSortedByCreationDate); assertFalse(BACKDOOR.isCourseInRecycleBin(newCourse.getId())); - ______TS("move archived course to recycle bin"); - coursesPage.archiveCourse(newCourse.getId()); - newCourse.setDeletedAt(Instant.now()); - coursesPage.moveArchivedCourseToRecycleBin(newCourse.getId()); - - coursesPage.verifyStatusMessage("The course " + newCourse.getId() + " has been deleted. " - + "You can restore it from the Recycle Bin manually."); - coursesPage.verifyNumArchivedCourses(1); - coursesPage.verifyDeletedCoursesDetails(deletedCoursesWithNewCourse); - assertTrue(BACKDOOR.isCourseInRecycleBin(newCourse.getId())); - - ______TS("restore archived course"); - newCourse.setDeletedAt(null); - coursesPage.restoreCourse(newCourse.getId()); - - coursesPage.verifyStatusMessage("The course " + newCourse.getId() + " has been restored."); - coursesPage.waitForPageToLoad(); - coursesPage.verifyNumDeletedCourses(1); - coursesPage.verifyArchivedCoursesDetails(archivedCoursesWithNewCourse); - assertFalse(BACKDOOR.isCourseInRecycleBin(newCourse.getId())); - verifyCourseArchivedInDatabase(instructorId, newCourse); - ______TS("permanently delete course"); - coursesPage.moveArchivedCourseToRecycleBin(newCourse.getId()); + coursesPage.moveCourseToRecycleBin(newCourse.getId()); coursesPage.deleteCourse(newCourse.getId()); coursesPage.verifyStatusMessage("The course " + newCourse.getId() @@ -228,27 +183,26 @@ public void testAll() { verifyAbsentInDatabase(newCourse); ______TS("restore all"); - coursesPage.moveArchivedCourseToRecycleBin(courses[1].getId()); - CourseAttributes[] activeCoursesWithRestored = { courses[0], courses[3], courses[2], copyCourse, copyCourse2 }; + coursesPage.moveCourseToRecycleBin(courses[1].getId()); + CourseAttributes[] activeCoursesWithRestored = { courses[0], courses[1], courses[2], + courses[3], copyCourse, copyCourse2 }; coursesPage.restoreAllCourses(); coursesPage.verifyStatusMessage("All courses have been restored."); coursesPage.waitForPageToLoad(); coursesPage.sortByCourseId(); coursesPage.verifyActiveCoursesDetails(activeCoursesWithRestored); - coursesPage.verifyArchivedCoursesDetails(archivedCourses); coursesPage.verifyNumDeletedCourses(0); assertFalse(BACKDOOR.isCourseInRecycleBin(courses[1].getId())); - assertFalse(BACKDOOR.isCourseInRecycleBin(courses[2].getId())); + assertFalse(BACKDOOR.isCourseInRecycleBin(courses[3].getId())); ______TS("permanently delete all"); - coursesPage.moveArchivedCourseToRecycleBin(courses[1].getId()); + coursesPage.moveCourseToRecycleBin(courses[1].getId()); coursesPage.moveCourseToRecycleBin(courses[2].getId()); coursesPage.deleteAllCourses(); coursesPage.verifyStatusMessage("All courses have been permanently deleted."); coursesPage.verifyNumActiveCourses(4); - coursesPage.verifyNumArchivedCourses(0); coursesPage.verifyNumDeletedCourses(0); verifyAbsentInDatabase(courses[1]); verifyAbsentInDatabase(courses[2]); @@ -282,26 +236,4 @@ private void verifyActiveCourseStatistics(InstructorCoursesPage coursesPage, Cou coursesPage.verifyActiveCourseStatistics(course, Integer.toString(numSections), Integer.toString(numTeams), Integer.toString(numStudents), Integer.toString(numUnregistered)); } - - private void verifyCourseArchivedInDatabase(String instructorId, CourseAttributes course) { - int retryLimit = 5; - CourseAttributes actual = getArchivedCourse(instructorId, course.getId()); - while (actual == null && retryLimit > 0) { - retryLimit--; - ThreadHelper.waitFor(1000); - actual = getArchivedCourse(instructorId, course.getId()); - } - assertEquals(actual, course); - } - - private void verifyCourseNotArchivedInDatabase(String instructorId, CourseAttributes course) { - int retryLimit = 5; - CourseAttributes actual = getArchivedCourse(instructorId, course.getId()); - while (actual != null && retryLimit > 0) { - retryLimit--; - ThreadHelper.waitFor(1000); - actual = getArchivedCourse(instructorId, course.getId()); - } - assertNull(actual); - } } diff --git a/src/e2e/java/teammates/e2e/cases/InstructorHomePageE2ETest.java b/src/e2e/java/teammates/e2e/cases/InstructorHomePageE2ETest.java index f22da51cf4f..f59da986919 100644 --- a/src/e2e/java/teammates/e2e/cases/InstructorHomePageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/InstructorHomePageE2ETest.java @@ -216,21 +216,13 @@ public void testAll() { assertNotNull(getSoftDeletedSession(copiedSession.getFeedbackSessionName(), instructor.getGoogleId())); - ______TS("archive course"); - homePage.archiveCourse(courseIndex); - - homePage.verifyStatusMessage("The course " + course.getId() + " has been archived. " - + "You can retrieve it from the Courses page."); - homePage.verifyNumCourses(1); - verifyCourseArchivedInDatabase(instructor.getGoogleId(), course); - ______TS("delete course"); otherCourseIndex = 0; homePage.deleteCourse(otherCourseIndex); homePage.verifyStatusMessage("The course " + otherCourse.getId() + " has been deleted. " + "You can restore it from the Recycle Bin manually."); - homePage.verifyNumCourses(0); + homePage.verifyNumCourses(1); assertTrue(BACKDOOR.isCourseInRecycleBin(otherCourse.getId())); } @@ -271,15 +263,4 @@ private void verifySessionPublishedState(FeedbackSessionAttributes feedbackSessi } assertEquals(actual.isPublished(), state); } - - private void verifyCourseArchivedInDatabase(String instructorId, CourseAttributes course) { - int retryLimit = 5; - CourseAttributes actual = getArchivedCourse(instructorId, course.getId()); - while (actual == null && retryLimit > 0) { - retryLimit--; - ThreadHelper.waitFor(1000); - actual = getArchivedCourse(instructorId, course.getId()); - } - assertEquals(actual, course); - } } diff --git a/src/e2e/java/teammates/e2e/pageobjects/InstructorCoursesPage.java b/src/e2e/java/teammates/e2e/pageobjects/InstructorCoursesPage.java index 2240ae1c117..f0af41a59d8 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/InstructorCoursesPage.java +++ b/src/e2e/java/teammates/e2e/pageobjects/InstructorCoursesPage.java @@ -64,10 +64,6 @@ private WebElement getActiveCoursesTable() { return browser.driver.findElement(By.id("active-courses-table")); } - private WebElement getArchivedCoursesTable() { - return browser.driver.findElement(By.id("archived-courses-table")); - } - private WebElement getDeletedCoursesTable() { return browser.driver.findElement(By.id("deleted-courses-table")); } @@ -87,16 +83,6 @@ public void verifyActiveCourseStatistics(CourseAttributes course, String numSect verifyTableRowValues(getActiveTableRow(course.getId()), courseDetail); } - public void verifyArchivedCoursesDetails(CourseAttributes[] courses) { - showArchiveTable(); - this.waitUntilAnimationFinish(); - String[][] courseDetails = getCourseDetails(courses); - for (int i = 0; i < courses.length; i++) { - // use verifyTableRowValues as archive courses are not sorted - verifyTableRowValues(getArchivedTableRow(courses[i].getId()), courseDetails[i]); - } - } - public void verifyDeletedCoursesDetails(CourseAttributes[] courses) { showDeleteTable(); this.waitUntilAnimationFinish(); @@ -124,10 +110,6 @@ public void verifyNumActiveCourses(int expectedNum) { assertEquals(expectedNum, getCourseCount()); } - public void verifyNumArchivedCourses(int expectedNum) { - assertEquals(expectedNum, getArchivedCourseCount()); - } - public void verifyNumDeletedCourses(int expectedNum) { assertEquals(expectedNum, getDeletedCourseCount()); } @@ -152,14 +134,6 @@ public void showStatistics(String courseId) { } } - public void archiveCourse(String courseId) { - WebElement otherActionButton = getOtherActionsButton(courseId); - click(otherActionButton); - click(getArchiveButton(courseId)); - - waitUntilAnimationFinish(); - } - public void copyCourse(String courseId, CourseAttributes newCourse) { WebElement otherActionButton = getOtherActionsButton(courseId); click(otherActionButton); @@ -182,32 +156,12 @@ public void moveCourseToRecycleBin(String courseId) { waitUntilAnimationFinish(); } - public void unarchiveCourse(String courseId) { - WebElement unarchiveButton = getUnarchiveButton(courseId); - click(unarchiveButton); - - waitUntilAnimationFinish(); - } - - public void moveArchivedCourseToRecycleBin(String courseId) { - WebElement moveArchivedToRecycleBinButton = getMoveArchivedToRecycleBinButton(courseId); - clickAndConfirm(moveArchivedToRecycleBinButton); - - waitUntilAnimationFinish(); - } - public void showDeleteTable() { if (!isElementVisible(By.id("deleted-course-id-0"))) { click(By.id("deleted-table-heading")); } } - public void showArchiveTable() { - if (!isElementVisible(By.id("archived-course-id-0"))) { - click(By.id("archived-table-heading")); - } - } - public void restoreCourse(String courseId) { WebElement restoreButton = getRestoreButton(courseId); click(restoreButton); @@ -249,11 +203,6 @@ private WebElement getActiveTableRow(String courseId) { return getActiveCoursesTable().findElements(By.cssSelector("tbody tr")).get(courseRowNumber); } - private WebElement getArchivedTableRow(String courseId) { - int courseRowNumber = getRowNumberOfArchivedCourse(courseId); - return getArchivedCoursesTable().findElements(By.cssSelector("tbody tr")).get(courseRowNumber); - } - private WebElement getDeletedTableRow(String courseId) { int courseRowNumber = getRowNumberOfDeletedCourse(courseId); return getDeletedCoursesTable().findElements(By.cssSelector("tbody tr")).get(courseRowNumber); @@ -319,11 +268,6 @@ private WebElement getOtherActionsButton(String courseId) { return getOtherActionsButtonInRow(courseRowNumber); } - private WebElement getArchiveButton(String courseId) { - int courseRowNumber = getRowNumberOfCourse(courseId); - return getArchiveButtonInRow(courseRowNumber); - } - private WebElement getCopyButton(String courseId) { int courseRowNumber = getRowNumberOfCourse(courseId); return getCopyButtonInRow(courseRowNumber); @@ -334,16 +278,6 @@ private WebElement getMoveToRecycleBinButton(String courseId) { return getMoveToRecycleBinButtonInRow(courseRowNumber); } - private WebElement getUnarchiveButton(String courseId) { - int courseRowNumber = getRowNumberOfArchivedCourse(courseId); - return getUnarchiveButtonInRow(courseRowNumber); - } - - private WebElement getMoveArchivedToRecycleBinButton(String courseId) { - int courseRowNumber = getRowNumberOfArchivedCourse(courseId); - return getMoveArchivedToRecycleBinButtonInRow(courseRowNumber); - } - private WebElement getRestoreButton(String courseId) { showDeleteTable(); int courseRowNumber = getRowNumberOfDeletedCourse(courseId); @@ -364,14 +298,6 @@ private int getCourseCount() { } } - private int getArchivedCourseCount() { - try { - return getArchivedCoursesTable().findElements(By.cssSelector("tbody tr")).size(); - } catch (NoSuchElementException e) { - return 0; - } - } - private int getDeletedCourseCount() { try { return getDeletedCoursesTable().findElements(By.cssSelector("tbody tr")).size(); @@ -389,15 +315,6 @@ private int getRowNumberOfCourse(String courseId) { return -1; } - private int getRowNumberOfArchivedCourse(String courseId) { - for (int i = 0; i < getArchivedCourseCount(); i++) { - if (getArchivedCourseIdCell(i).getText().equals(courseId)) { - return i; - } - } - return -1; - } - private int getRowNumberOfDeletedCourse(String courseId) { for (int i = 0; i < getDeletedCourseCount(); i++) { if (getDeletedCourseIdCell(i).getText().equals(courseId)) { @@ -411,10 +328,6 @@ private WebElement getCourseIdCell(int rowId) { return browser.driver.findElement(By.id("course-id-" + rowId)); } - private WebElement getArchivedCourseIdCell(int rowId) { - return browser.driver.findElement(By.id("archived-course-id-" + rowId)); - } - private WebElement getDeletedCourseIdCell(int rowId) { return browser.driver.findElement(By.id("deleted-course-id-" + rowId)); } @@ -429,11 +342,6 @@ private WebElement getOtherActionsButtonInRow(int rowId) { return browser.driver.findElement(otherActionsButton); } - private WebElement getArchiveButtonInRow(int rowId) { - By archiveButton = By.id("btn-archive-" + rowId); - return browser.driver.findElement(archiveButton); - } - private WebElement getCopyButtonInRow(int rowId) { By copyButton = By.id("btn-copy-" + rowId); return browser.driver.findElement(copyButton); @@ -444,16 +352,6 @@ private WebElement getMoveToRecycleBinButtonInRow(int rowId) { return browser.driver.findElement(moveToRecycleBinButton); } - private WebElement getUnarchiveButtonInRow(int rowId) { - By archiveButton = By.id("btn-unarchive-" + rowId); - return browser.driver.findElement(archiveButton); - } - - private WebElement getMoveArchivedToRecycleBinButtonInRow(int rowId) { - By moveToRecycleBinButton = By.id("btn-soft-delete-archived-" + rowId); - return browser.driver.findElement(moveToRecycleBinButton); - } - private WebElement getRestoreButtonInRow(int rowId) { By restoreButton = By.id("btn-restore-" + rowId); return browser.driver.findElement(restoreButton); diff --git a/src/e2e/java/teammates/e2e/pageobjects/InstructorHomePage.java b/src/e2e/java/teammates/e2e/pageobjects/InstructorHomePage.java index 21dbce2247a..2927ff56b07 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/InstructorHomePage.java +++ b/src/e2e/java/teammates/e2e/pageobjects/InstructorHomePage.java @@ -116,13 +116,6 @@ public void deleteSession(int courseTabIndex, int sessionIndex) { waitUntilAnimationFinish(); } - public void archiveCourse(int courseTabIndex) { - WebElement courseTab = getCourseTab(courseTabIndex); - click(courseTab.findElement(By.className("btn-course"))); - clickAndConfirm(browser.driver.findElement(By.cssSelector("body > div > div > .btn-archive-course"))); - waitUntilAnimationFinish(); - } - public void deleteCourse(int courseTabIndex) { WebElement courseTab = getCourseTab(courseTabIndex); click(courseTab.findElement(By.className("btn-course"))); diff --git a/src/e2e/java/teammates/e2e/pageobjects/InstructorHomePageSql.java b/src/e2e/java/teammates/e2e/pageobjects/InstructorHomePageSql.java index cfdfb0eeff6..4ad094ad2ba 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/InstructorHomePageSql.java +++ b/src/e2e/java/teammates/e2e/pageobjects/InstructorHomePageSql.java @@ -116,13 +116,6 @@ public void deleteSession(int courseTabIndex, int sessionIndex) { waitUntilAnimationFinish(); } - public void archiveCourse(int courseTabIndex) { - WebElement courseTab = getCourseTab(courseTabIndex); - click(courseTab.findElement(By.className("btn-course"))); - clickAndConfirm(browser.driver.findElement(By.cssSelector("body > div > div > .btn-archive-course"))); - waitUntilAnimationFinish(); - } - public void deleteCourse(int courseTabIndex) { WebElement courseTab = getCourseTab(courseTabIndex); click(courseTab.findElement(By.className("btn-course"))); diff --git a/src/e2e/resources/data/AdminHomePageE2ETest.json b/src/e2e/resources/data/AdminHomePageE2ETest.json index 39fbb3a0951..238defb385c 100644 --- a/src/e2e/resources/data/AdminHomePageE2ETest.json +++ b/src/e2e/resources/data/AdminHomePageE2ETest.json @@ -14,7 +14,6 @@ "courseId": "tm.e2e.AHome.course1", "name": "Teammates Instr1", "email": "AHome.instr1@gmail.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", diff --git a/src/e2e/resources/data/InstructorCourseEditPageE2ETest.json b/src/e2e/resources/data/InstructorCourseEditPageE2ETest.json index 80f33f08efb..2c1083b6370 100644 --- a/src/e2e/resources/data/InstructorCourseEditPageE2ETest.json +++ b/src/e2e/resources/data/InstructorCourseEditPageE2ETest.json @@ -230,7 +230,6 @@ "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", - "isArchived": true, "privileges": { "courseLevel": { "canViewStudentInSections": true, diff --git a/src/e2e/resources/data/InstructorCourseEditPageE2ETestSql.json b/src/e2e/resources/data/InstructorCourseEditPageE2ETestSql.json index a2796c562f8..07e234ad66c 100644 --- a/src/e2e/resources/data/InstructorCourseEditPageE2ETestSql.json +++ b/src/e2e/resources/data/InstructorCourseEditPageE2ETestSql.json @@ -343,7 +343,6 @@ "role": "INSTRUCTOR_PERMISSION_ROLE_COOWNER", "isDisplayedToStudents": true, "displayName": "Instructor", - "isArchived": true, "privileges": { "courseLevel": { "canViewStudentInSections": true, diff --git a/src/e2e/resources/data/InstructorCoursesPageE2ETest.json b/src/e2e/resources/data/InstructorCoursesPageE2ETest.json index ff18ab25fb6..764718c8783 100644 --- a/src/e2e/resources/data/InstructorCoursesPageE2ETest.json +++ b/src/e2e/resources/data/InstructorCoursesPageE2ETest.json @@ -85,7 +85,6 @@ "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", - "isArchived": true, "privileges": { "courseLevel": { "canViewStudentInSections": true, diff --git a/src/e2e/resources/data/InstructorNotificationsPageE2ETest.json b/src/e2e/resources/data/InstructorNotificationsPageE2ETest.json index 4e1ead2bb70..80a794ab38d 100644 --- a/src/e2e/resources/data/InstructorNotificationsPageE2ETest.json +++ b/src/e2e/resources/data/InstructorNotificationsPageE2ETest.json @@ -13,7 +13,6 @@ "courseId": "tm.e2e.INotifs.course1", "name": "Teammates Instr1", "email": "INotifs.instr@gmail.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", diff --git a/src/e2e/resources/data/InstructorStudentListPageE2ETest.json b/src/e2e/resources/data/InstructorStudentListPageE2ETest.json index a24baadebb1..615ad3f4e50 100644 --- a/src/e2e/resources/data/InstructorStudentListPageE2ETest.json +++ b/src/e2e/resources/data/InstructorStudentListPageE2ETest.json @@ -25,7 +25,6 @@ "courseId": "tm.e2e.ISList.course1", "name": "Instructor1 Course1", "email": "ISList.instr1@gmail.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -49,7 +48,6 @@ "courseId": "tm.e2e.ISList.course2", "name": "Instructor1 Course2", "email": "ISList.instr1@gmail.tmt", - "isArchived": false, "role": "Custom", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -73,7 +71,6 @@ "courseId": "tm.e2e.ISList.course3", "name": "Instructor1 Course3", "email": "ISList.instr1@gmail.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", diff --git a/src/it/java/teammates/it/storage/sqlsearch/InstructorSearchIT.java b/src/it/java/teammates/it/storage/sqlsearch/InstructorSearchIT.java index a8c101bb6ca..a2e96763f56 100644 --- a/src/it/java/teammates/it/storage/sqlsearch/InstructorSearchIT.java +++ b/src/it/java/teammates/it/storage/sqlsearch/InstructorSearchIT.java @@ -44,7 +44,6 @@ public void allTests() throws Exception { Instructor ins1InCourse4 = typicalBundle.instructors.get("instructor1OfCourse4"); Instructor ins2InCourse4 = typicalBundle.instructors.get("instructor2YetToJoinCourse4"); Instructor ins3InCourse4 = typicalBundle.instructors.get("instructor3YetToJoinCourse4"); - Instructor insInArchivedCourse = typicalBundle.instructors.get("instructorOfArchivedCourse"); Instructor insInUnregCourse = typicalBundle.instructors.get("instructorOfUnregisteredCourse"); Instructor insUniqueDisplayName = typicalBundle.instructors.get("instructorOfCourse2WithUniqueDisplayName"); Instructor ins1InCourse3 = typicalBundle.instructors.get("instructor1OfCourse3"); @@ -63,18 +62,13 @@ public void allTests() throws Exception { ______TS("success: search for instructors in whole system; query string matches some instructors"); results = usersDb.searchInstructorsInWholeSystem("\"Instructor of\""); - verifySearchResults(results, insInArchivedCourse, insInUnregCourse, insUniqueDisplayName); + verifySearchResults(results, insInUnregCourse, insUniqueDisplayName); ______TS("success: search for instructors in whole system; query string should be case-insensitive"); results = usersDb.searchInstructorsInWholeSystem("\"InStRuCtOr 2\""); verifySearchResults(results, ins2InCourse1, ins2InCourse4); - ______TS("success: search for instructors in whole system; instructors in archived courses should be included"); - - results = usersDb.searchInstructorsInWholeSystem("\"Instructor Of Archived Course\""); - verifySearchResults(results, insInArchivedCourse); - ______TS( "success: search for instructors in whole system; instructors in unregistered course should be included"); @@ -103,7 +97,7 @@ public void allTests() throws Exception { ______TS("success: search for instructors in whole system; instructors should be searchable by their role"); results = usersDb.searchInstructorsInWholeSystem("\"Co-owner\""); - verifySearchResults(results, ins1InCourse1, insInArchivedCourse, + verifySearchResults(results, ins1InCourse1, insInUnregCourse, insUniqueDisplayName, ins1InCourse3, ins1InCourse4, ins2InCourse4, ins3InCourse4); @@ -117,13 +111,13 @@ public void allTests() throws Exception { usersDb.deleteUser(insUniqueDisplayName); results = usersDb.searchInstructorsInWholeSystem("\"Instructor of\""); - verifySearchResults(results, insInArchivedCourse, insInUnregCourse); + verifySearchResults(results, insInUnregCourse); // This method used to use usersDb.putEntity, not sure if the .createInstructor method has the same functionality ______TS("success: search for instructors in whole system; instructors created without searchability unsearchable"); usersDb.createInstructor(insUniqueDisplayName); results = usersDb.searchInstructorsInWholeSystem("\"Instructor of\""); - verifySearchResults(results, insInArchivedCourse, insInUnregCourse, insUniqueDisplayName); + verifySearchResults(results, insInUnregCourse, insUniqueDisplayName); ______TS("success: search for instructors in whole system; deleting instructor without deleting document:" + "document deleted during search, instructor unsearchable"); diff --git a/src/it/java/teammates/it/storage/sqlsearch/StudentSearchIT.java b/src/it/java/teammates/it/storage/sqlsearch/StudentSearchIT.java index 0800272d5a1..25eac74d629 100644 --- a/src/it/java/teammates/it/storage/sqlsearch/StudentSearchIT.java +++ b/src/it/java/teammates/it/storage/sqlsearch/StudentSearchIT.java @@ -48,7 +48,6 @@ public void allTests() throws Exception { Student unregisteredStuInCourse1 = typicalBundle.students.get("unregisteredStudentInCourse1"); Student stu1InCourse3 = typicalBundle.students.get("student1InCourse3"); Student stu1InCourse4 = typicalBundle.students.get("student1InCourse4"); - Student stuOfArchivedCourse = typicalBundle.students.get("studentOfArchivedCourse"); Instructor ins1InCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); Instructor ins1InCourse4 = typicalBundle.instructors.get("instructor1OfCourse4"); @@ -73,11 +72,6 @@ public void allTests() throws Exception { results = usersDb.searchStudentsInWholeSystem("\"sTuDeNt1\""); verifySearchResults(results, stu1InCourse1, stu1InCourse2, stu1InCourse3, stu1InCourse4); - ______TS("success: search for students in whole system; students in archived courses should be included"); - - results = usersDb.searchStudentsInWholeSystem("\"Student In Archived Course\""); - verifySearchResults(results, stuOfArchivedCourse); - ______TS("success: search for students in whole system; students should be searchable by course id"); results = usersDb.searchStudentsInWholeSystem("\"course-1\""); diff --git a/src/it/java/teammates/it/ui/webapi/GetCoursesActionIT.java b/src/it/java/teammates/it/ui/webapi/GetCoursesActionIT.java index b10149b70b0..c2e329534c9 100644 --- a/src/it/java/teammates/it/ui/webapi/GetCoursesActionIT.java +++ b/src/it/java/teammates/it/ui/webapi/GetCoursesActionIT.java @@ -123,14 +123,12 @@ public void testGetCoursesAction_withStudentEntityType_shouldReturnCorrectCourse CoursesData courses = getValidCourses(params); courses.getCourses().sort((c1, c2) -> c1.getCourseId().compareTo(c2.getCourseId())); - assertEquals(3, courses.getCourses().size()); + assertEquals(2, courses.getCourses().size()); Course expectedCourse1 = typicalBundle.courses.get("typicalCourse1"); Course expectedCourse2 = typicalBundle.courses.get("typicalCourse2"); - Course expectedCourse3 = typicalBundle.courses.get("typicalCourse4"); verifySameCourseDataStudent(courses.getCourses().get(0), expectedCourse1); verifySameCourseDataStudent(courses.getCourses().get(1), expectedCourse2); - verifySameCourseDataStudent(courses.getCourses().get(2), expectedCourse3); } private void verifySameCourseData(CourseData actualCourse, Course expectedCourse) { diff --git a/src/it/java/teammates/it/ui/webapi/SearchStudentsActionIT.java b/src/it/java/teammates/it/ui/webapi/SearchStudentsActionIT.java index 9dc9fad18b8..ade7c5f6130 100644 --- a/src/it/java/teammates/it/ui/webapi/SearchStudentsActionIT.java +++ b/src/it/java/teammates/it/ui/webapi/SearchStudentsActionIT.java @@ -96,7 +96,7 @@ public void execute_adminSearchName_success() { JsonResult result = getJsonResult(a); StudentsData response = (StudentsData) result.getOutput(); - assertEquals(11, response.getStudents().size()); + assertEquals(10, response.getStudents().size()); } @Test @@ -114,7 +114,7 @@ public void execute_adminSearchCourseId_success() { JsonResult result = getJsonResult(a); StudentsData response = (StudentsData) result.getOutput(); - assertEquals(11, response.getStudents().size()); + assertEquals(10, response.getStudents().size()); } @Test diff --git a/src/it/resources/data/FeedbackResponsesITBundle.json b/src/it/resources/data/FeedbackResponsesITBundle.json index e3ef7fbd411..447db5f7736 100644 --- a/src/it/resources/data/FeedbackResponsesITBundle.json +++ b/src/it/resources/data/FeedbackResponsesITBundle.json @@ -12,12 +12,6 @@ "name": "Instructor 2", "email": "instr2@teammates.tmt" }, - "instructorOfArchivedCourse": { - "id": "00000000-0000-4000-8000-000000000003", - "googleId": "instructorOfArchivedCourse", - "name": "Instructor Of Archived Course", - "email": "instructorOfArchivedCourse@archiveCourse.tmt" - }, "instructorOfUnregisteredCourse": { "id": "00000000-0000-4000-8000-000000000004", "googleId": "InstructorOfUnregisteredCourse", @@ -173,12 +167,6 @@ "institute": "TEAMMATES Test Institute 1", "timeZone": "Asia/Singapore" }, - "archivedCourse": { - "id": "archived-course", - "name": "Archived Course", - "institute": "TEAMMATES Test Institute 2", - "timeZone": "UTC" - }, "unregisteredCourse": { "id": "unregistered-course", "name": "Unregistered Course", @@ -343,35 +331,6 @@ "sessionLevel": {} } }, - "instructorOfArchivedCourse": { - "id": "00000000-0000-4000-8000-000000000503", - "account": { - "id": "00000000-0000-4000-8000-000000000003" - }, - "course": { - "id": "archived-course" - }, - "name": "Instructor Of Archived Course", - "email": "instructorOfArchivedCourse@archiveCourse.tmt", - "isArchived": true, - "role": "INSTRUCTOR_PERMISSION_ROLE_COOWNER", - "isDisplayedToStudents": true, - "displayName": "Instructor", - "privileges": { - "courseLevel": { - "canModifyCourse": true, - "canModifyInstructor": true, - "canModifySession": true, - "canModifyStudent": true, - "canViewStudentInSections": true, - "canViewSessionInSections": true, - "canSubmitSessionInSections": true, - "canModifySessionCommentsInSections": false - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, "instructorOfUnregisteredCourse": { "id": "00000000-0000-4000-8000-000000000504", "account": { @@ -382,7 +341,6 @@ }, "name": "Instructor Of Unregistered Course", "email": "instructorOfUnregisteredCourse@UnregisteredCourse.tmt", - "isArchived": false, "role": "INSTRUCTOR_PERMISSION_ROLE_COOWNER", "isDisplayedToStudents": true, "displayName": "Instructor", @@ -682,18 +640,6 @@ "name": "student3YetToJoinCourse In Course4", "comments": "" }, - "studentOfArchivedCourse": { - "id": "00000000-0000-4000-8000-000000000610", - "course": { - "id": "archived-course" - }, - "team": { - "id": "00000000-0000-4000-8000-000000000302" - }, - "email": "studentOfArchivedCourse@teammates.tmt", - "name": "Student In Archived Course", - "comments": "" - }, "student4InCourse1": { "id": "00000000-0000-4000-8000-000000000611", "account": { diff --git a/src/it/resources/data/GetCoursesActionIT.json b/src/it/resources/data/GetCoursesActionIT.json index 05dbbbde0f0..1839430fe43 100644 --- a/src/it/resources/data/GetCoursesActionIT.json +++ b/src/it/resources/data/GetCoursesActionIT.json @@ -123,7 +123,6 @@ }, "name": "Instructor 1", "email": "instr1@course1.tmt", - "isArchived": false, "role": "INSTRUCTOR_PERMISSION_ROLE_COOWNER", "isDisplayedToStudents": true, "displayName": "Instructor", @@ -152,7 +151,6 @@ }, "name": "Instructor 1", "email": "instr1@course1.tmt", - "isArchived": false, "role": "INSTRUCTOR_PERMISSION_ROLE_COOWNER", "isDisplayedToStudents": true, "displayName": "Instructor", @@ -181,7 +179,6 @@ }, "name": "Instructor 1", "email": "instr1@course1.tmt", - "isArchived": true, "role": "INSTRUCTOR_PERMISSION_ROLE_COOWNER", "isDisplayedToStudents": true, "displayName": "Instructor", @@ -210,7 +207,6 @@ }, "name": "Instructor 1", "email": "instr1@course1.tmt", - "isArchived": true, "role": "INSTRUCTOR_PERMISSION_ROLE_COOWNER", "isDisplayedToStudents": true, "displayName": "Instructor", @@ -239,7 +235,6 @@ }, "name": "Instructor 1", "email": "instr1@course1.tmt", - "isArchived": false, "role": "INSTRUCTOR_PERMISSION_ROLE_COOWNER", "isDisplayedToStudents": true, "displayName": "Instructor", @@ -304,21 +299,6 @@ "email": "student1@gmail.tmt", "name": "student 1", "comments": "comment for student1InCourse3" - }, - "student1InArchivedCourse": { - "id": "00000000-0000-4000-8000-000000000604", - "account": { - "id": "00000000-0000-4000-8000-000000000002" - }, - "course": { - "id": "idOfTypicalCourse4" - }, - "team": { - "id": "00000000-0000-4000-8000-000000000304" - }, - "email": "student1@gmail.tmt", - "name": "student 1", - "comments": "" } } } diff --git a/src/it/resources/data/typicalDataBundle.json b/src/it/resources/data/typicalDataBundle.json index 8d8880176e4..80a963722b8 100644 --- a/src/it/resources/data/typicalDataBundle.json +++ b/src/it/resources/data/typicalDataBundle.json @@ -12,12 +12,6 @@ "name": "Instructor 2", "email": "instr2@teammates.tmt" }, - "instructorOfArchivedCourse": { - "id": "00000000-0000-4000-8000-000000000003", - "googleId": "instructorOfArchivedCourse", - "name": "Instructor Of Archived Course", - "email": "instructorOfArchivedCourse@archiveCourse.tmt" - }, "instructorOfUnregisteredCourse": { "id": "00000000-0000-4000-8000-000000000004", "googleId": "InstructorOfUnregisteredCourse", @@ -176,12 +170,6 @@ "institute": "TEAMMATES Test Institute 1", "timeZone": "Asia/Singapore" }, - "archivedCourse": { - "id": "archived-course", - "name": "Archived Course", - "institute": "TEAMMATES Test Institute 2", - "timeZone": "UTC" - }, "unregisteredCourse": { "id": "unregistered-course", "name": "Unregistered Course", @@ -339,35 +327,6 @@ "sessionLevel": {} } }, - "instructorOfArchivedCourse": { - "id": "00000000-0000-4000-8000-000000000503", - "account": { - "id": "00000000-0000-4000-8000-000000000003" - }, - "course": { - "id": "archived-course" - }, - "name": "Instructor Of Archived Course", - "email": "instructorOfArchivedCourse@archiveCourse.tmt", - "isArchived": true, - "role": "INSTRUCTOR_PERMISSION_ROLE_COOWNER", - "isDisplayedToStudents": true, - "displayName": "Instructor", - "privileges": { - "courseLevel": { - "canModifyCourse": true, - "canModifyInstructor": true, - "canModifySession": true, - "canModifyStudent": true, - "canViewStudentInSections": true, - "canViewSessionInSections": true, - "canSubmitSessionInSections": true, - "canModifySessionCommentsInSections": false - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, "instructorOfUnregisteredCourse": { "id": "00000000-0000-4000-8000-000000000504", "account": { @@ -378,7 +337,6 @@ }, "name": "Instructor Of Unregistered Course", "email": "instructorOfUnregisteredCourse@UnregisteredCourse.tmt", - "isArchived": false, "role": "INSTRUCTOR_PERMISSION_ROLE_COOWNER", "isDisplayedToStudents": true, "displayName": "Instructor", @@ -692,18 +650,6 @@ "email": "student3YetToJoinCourse4@teammates.tmt", "name": "student3YetToJoinCourse In Course4", "comments": "" - }, - "studentOfArchivedCourse": { - "id": "00000000-0000-4000-8000-000000000610", - "course": { - "id": "archived-course" - }, - "team": { - "id": "00000000-0000-4000-8000-000000000302" - }, - "email": "studentOfArchivedCourse@teammates.tmt", - "name": "Student In Archived Course", - "comments": "" } }, "feedbackSessions": { diff --git a/src/test/java/teammates/common/datatransfer/attributes/InstructorAttributesTest.java b/src/test/java/teammates/common/datatransfer/attributes/InstructorAttributesTest.java index 299ce58df3b..46fc8a43de8 100644 --- a/src/test/java/teammates/common/datatransfer/attributes/InstructorAttributesTest.java +++ b/src/test/java/teammates/common/datatransfer/attributes/InstructorAttributesTest.java @@ -32,7 +32,6 @@ public void testBuilder_buildNothing_shouldUseDefaultValues() { assertNull(instructor.getKey()); assertEquals(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_COOWNER, instructor.getRole()); assertEquals(Const.DEFAULT_DISPLAY_NAME_FOR_INSTRUCTOR, instructor.getDisplayedName()); - assertFalse(instructor.isArchived()); assertTrue(instructor.isDisplayedToStudents()); assertEquals(new InstructorPrivileges(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_COOWNER), instructor.getPrivileges()); @@ -96,7 +95,6 @@ public void testBuilder_withTypicalData_shouldBuildCorrectAttribute() { .withGoogleId("valid.google.id") .withRole(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_MANAGER) .withDisplayedName("instructor A") - .withIsArchived(false) .withIsDisplayedToStudents(false) .withPrivileges( new InstructorPrivileges(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_MANAGER)) @@ -107,7 +105,6 @@ public void testBuilder_withTypicalData_shouldBuildCorrectAttribute() { assertEquals("valid name", instructor.getName()); assertEquals("valid.google.id", instructor.getGoogleId()); assertEquals("instructor A", instructor.getDisplayedName()); - assertFalse(instructor.isArchived()); assertFalse(instructor.isDisplayedToStudents()); assertEquals(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_MANAGER, instructor.getRole()); assertEquals(new InstructorPrivileges(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_MANAGER), @@ -127,7 +124,6 @@ public void testValueOf_withAllFieldPopulatedInstructor_shouldGenerateAttributes assertEquals(instructor.getGoogleId(), instructorAttributes.getGoogleId()); assertEquals(instructor.getCourseId(), instructorAttributes.getCourseId()); - assertEquals(instructor.getIsArchived(), instructorAttributes.isArchived()); assertEquals(instructor.getName(), instructorAttributes.getName()); assertEquals(instructor.getEmail(), instructorAttributes.getEmail()); assertEquals(instructor.getRegistrationKey(), instructorAttributes.getKey()); @@ -149,7 +145,6 @@ public void testValueOf_withSomeFieldsPopulatedAsNull_shouldUseDefaultValues() { assertEquals(instructor.getGoogleId(), instructorAttributes.getGoogleId()); assertEquals(instructor.getCourseId(), instructorAttributes.getCourseId()); - assertEquals(instructor.getIsArchived(), instructorAttributes.isArchived()); assertEquals(instructor.getName(), instructorAttributes.getName()); assertEquals(instructor.getEmail(), instructorAttributes.getEmail()); assertEquals(instructor.getRegistrationKey(), instructorAttributes.getKey()); @@ -324,7 +319,6 @@ public void testUpdateOptionsWithEmail_withTypicalData_shouldUpdateAttributeCorr InstructorAttributes.updateOptionsWithEmailBuilder("courseId", "test@test.com") .withName("test") .withDisplayedName("Instructor") - .withIsArchived(false) .withPrivileges(new InstructorPrivileges( Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_MANAGER)) .withIsDisplayedToStudents(false) @@ -340,7 +334,6 @@ public void testUpdateOptionsWithEmail_withTypicalData_shouldUpdateAttributeCorr .withGoogleId("testGoogleId") .withName("test2") .withDisplayedName("Tutor") - .withIsArchived(true) .withPrivileges(new InstructorPrivileges( Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_COOWNER)) .withIsDisplayedToStudents(true) @@ -351,7 +344,6 @@ public void testUpdateOptionsWithEmail_withTypicalData_shouldUpdateAttributeCorr assertEquals("test", instructorAttributes.getName()); assertEquals("Instructor", instructorAttributes.getDisplayedName()); - assertFalse(instructorAttributes.isArchived()); assertTrue(instructorAttributes.getPrivileges().hasManagerPrivileges()); assertFalse(instructorAttributes.isDisplayedToStudents()); assertEquals("googleId", instructorAttributes.getGoogleId()); @@ -365,7 +357,6 @@ public void testUpdateOptionsWithGoogleId_withTypicalData_shouldUpdateAttributeC .withName("test") .withEmail("test@email.com") .withDisplayedName("Instructor") - .withIsArchived(false) .withPrivileges(new InstructorPrivileges( Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_MANAGER)) .withIsDisplayedToStudents(false) @@ -380,7 +371,6 @@ public void testUpdateOptionsWithGoogleId_withTypicalData_shouldUpdateAttributeC .withGoogleId("googleId") .withName("test2") .withDisplayedName("Tutor") - .withIsArchived(true) .withPrivileges(new InstructorPrivileges( Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_COOWNER)) .withIsDisplayedToStudents(true) @@ -391,7 +381,6 @@ public void testUpdateOptionsWithGoogleId_withTypicalData_shouldUpdateAttributeC assertEquals("test", instructorAttributes.getName()); assertEquals("Instructor", instructorAttributes.getDisplayedName()); - assertFalse(instructorAttributes.isArchived()); assertTrue(instructorAttributes.getPrivileges().hasManagerPrivileges()); assertFalse(instructorAttributes.isDisplayedToStudents()); assertEquals("test@email.com", instructorAttributes.getEmail()); diff --git a/src/test/java/teammates/logic/core/AccountsLogicTest.java b/src/test/java/teammates/logic/core/AccountsLogicTest.java index 3381f0b3c7c..cd191ea5b16 100644 --- a/src/test/java/teammates/logic/core/AccountsLogicTest.java +++ b/src/test/java/teammates/logic/core/AccountsLogicTest.java @@ -415,27 +415,6 @@ public void testDeleteAccountCascade_notLastInstructorInCourse_shouldNotDeleteCo assertNotNull(coursesLogic.getCourse(instructor1OfCourse1.getCourseId())); } - @Test - public void testDeleteAccountCascade_instructorArchivedAsLastInstructor_shouldDeleteCourseAlso() throws Exception { - InstructorAttributes instructor5 = dataBundle.instructors.get("instructor5"); - - assertNotNull(instructor5.getGoogleId()); - instructorsLogic.setArchiveStatusOfInstructor(instructor5.getGoogleId(), instructor5.getCourseId(), true); - - // verify the instructor is the last instructor of a course - assertEquals(1, instructorsLogic.getInstructorsForCourse(instructor5.getCourseId()).size()); - - assertTrue( - instructorsLogic.getInstructorForEmail(instructor5.getCourseId(), instructor5.getEmail()).isArchived()); - - accountsLogic.deleteAccountCascade(instructor5.getGoogleId()); - - // the archived instructor is also deleted - assertNull(instructorsLogic.getInstructorForEmail(instructor5.getCourseId(), instructor5.getEmail())); - // the course is also deleted - assertNull(coursesLogic.getCourse(instructor5.getCourseId())); - } - @Test public void testDeleteAccountCascade_nonExistentAccount_shouldPass() { InstructorAttributes instructor1OfCourse1 = dataBundle.instructors.get("instructor1OfCourse1"); diff --git a/src/test/java/teammates/logic/core/FeedbackQuestionsLogicTest.java b/src/test/java/teammates/logic/core/FeedbackQuestionsLogicTest.java index fa32b785f3f..28fa09e4a49 100644 --- a/src/test/java/teammates/logic/core/FeedbackQuestionsLogicTest.java +++ b/src/test/java/teammates/logic/core/FeedbackQuestionsLogicTest.java @@ -577,7 +577,6 @@ public void testDeleteFeedbackQuestions_byCourseId_shouldDeleteQuestions() { assertEquals(0, questions.size()); // test that questions in other courses are unaffected - assertNotNull(getQuestionFromDatabase("qn1InSessionInArchivedCourse")); assertNotNull(getQuestionFromDatabase("qn1InSession4InCourse1")); } @@ -909,10 +908,6 @@ private void testHasFeedbackQuestionsForInstructor() { FeedbackSessionAttributes fsa = fsLogic.getFeedbackSession("First feedback session", "idOfTypicalCourse1"); assertTrue(fqLogic.hasFeedbackQuestionsForInstructors(fsa, false)); - ______TS("Valid session without questions for instructor should return false"); - fsa = fsLogic.getFeedbackSession("session without instructor questions", "idOfArchivedCourse"); - assertFalse(fqLogic.hasFeedbackQuestionsForInstructors(fsa, false)); - ______TS("Invalid session should not have questions"); fsa.setFeedbackSessionName("non-existent session"); assertFalse(fqLogic.hasFeedbackQuestionsForInstructors(fsa, false)); @@ -981,10 +976,6 @@ private void testHasFeedbackQuestionsForStudents() { FeedbackSessionAttributes fsa = fsLogic.getFeedbackSession("First feedback session", "idOfTypicalCourse1"); assertTrue(fqLogic.hasFeedbackQuestionsForStudents(fsa)); - ______TS("Valid session without questions for students should return false"); - fsa = fsLogic.getFeedbackSession("session without student questions", "idOfArchivedCourse"); - assertFalse(fqLogic.hasFeedbackQuestionsForStudents(fsa)); - ______TS("Invalid session should not have questions"); fsa.setFeedbackSessionName("non-existent session"); assertFalse(fqLogic.hasFeedbackQuestionsForStudents(fsa)); diff --git a/src/test/java/teammates/logic/core/FeedbackSessionsLogicTest.java b/src/test/java/teammates/logic/core/FeedbackSessionsLogicTest.java index 4babd8be2a3..097290c4f66 100644 --- a/src/test/java/teammates/logic/core/FeedbackSessionsLogicTest.java +++ b/src/test/java/teammates/logic/core/FeedbackSessionsLogicTest.java @@ -508,7 +508,7 @@ private void testIsFeedbackSessionViewableToUserType() { assertTrue(fsLogic.isFeedbackSessionViewableToUserType(session, true)); ______TS("Session without questions for students, but with visible responses"); - session = dataBundle.feedbackSessions.get("archiveCourse.session1"); + session = dataBundle.feedbackSessions.get("noStudentQuestionsSessionInNoQuestionsCourse"); assertTrue(fsLogic.isFeedbackSessionViewableToUserType(session, false)); session = dataBundle.feedbackSessions.get("session1InCourse2"); @@ -536,7 +536,7 @@ private void testIsFeedbackSessionForUserTypeToAnswer() { assertFalse(fsLogic.isFeedbackSessionForUserTypeToAnswer(session, true)); ______TS("Session without student question should not be for students to answer"); - session = dataBundle.feedbackSessions.get("archiveCourse.session1"); + session = dataBundle.feedbackSessions.get("noStudentQuestionsSessionInNoQuestionsCourse"); assertFalse(fsLogic.isFeedbackSessionForUserTypeToAnswer(session, false)); assertTrue(fsLogic.isFeedbackSessionForUserTypeToAnswer(session, true)); diff --git a/src/test/java/teammates/logic/core/InstructorsLogicTest.java b/src/test/java/teammates/logic/core/InstructorsLogicTest.java index 0234faee667..53a404e50a0 100644 --- a/src/test/java/teammates/logic/core/InstructorsLogicTest.java +++ b/src/test/java/teammates/logic/core/InstructorsLogicTest.java @@ -643,23 +643,6 @@ public void testDeleteInstructors_byCourseId_shouldDeleteInstructorsAssociatedWi } - @Test - public void testDeleteInstructorsForGoogleIdCascade_archivedInstructor_shouldDeleteAlso() throws Exception { - InstructorAttributes instructor5 = dataBundle.instructors.get("instructor5"); - - assertNotNull(instructor5.getGoogleId()); - instructorsLogic.setArchiveStatusOfInstructor(instructor5.getGoogleId(), instructor5.getCourseId(), true); - - // this is an archived instructor - assertTrue( - instructorsLogic.getInstructorForEmail(instructor5.getCourseId(), instructor5.getEmail()).isArchived()); - - instructorsLogic.deleteInstructorsForGoogleIdCascade(instructor5.getGoogleId()); - - // the instructor should be deleted also - assertNull(instructorsLogic.getInstructorForEmail(instructor5.getCourseId(), instructor5.getEmail())); - } - @Test public void testDeleteInstructorsForGoogleIdCascade() throws Exception { @@ -774,7 +757,7 @@ private void testUpdateToEnsureValidityOfInstructorsForTheCourse() { Const.InstructorPermissions.CAN_MODIFY_INSTRUCTOR)); ______TS("The course has 1 registered instructor with modifying instructor privilege"); - courseId = "idOfArchivedCourse"; + courseId = "idOfSingleInstructorCourse"; instructorsLogic.updateToEnsureValidityOfInstructorsForTheCourse(courseId, instructorToUpdate); assertFalse(instructorToUpdate.getPrivileges().isAllowedForPrivilege( diff --git a/src/test/java/teammates/logic/core/StudentsLogicTest.java b/src/test/java/teammates/logic/core/StudentsLogicTest.java index 0d03625d38e..b3b25b5eeb5 100644 --- a/src/test/java/teammates/logic/core/StudentsLogicTest.java +++ b/src/test/java/teammates/logic/core/StudentsLogicTest.java @@ -821,12 +821,12 @@ public void testDeleteStudentsInCourseCascade_typicalCase_shouldDoCascadeDeletio @Test public void testDeleteStudents_byCourseId_shouldDeleteAllStudents() { StudentAttributes student1InCourse1 = dataBundle.students.get("student1InCourse1"); - StudentAttributes student1InArchivedCourse = dataBundle.students.get("student1InArchivedCourse"); + StudentAttributes student1InCourse2 = dataBundle.students.get("student1InCourse2"); // the two are in different course - assertNotEquals(student1InCourse1.getCourse(), student1InArchivedCourse.getCourse()); + assertNotEquals(student1InCourse1.getCourse(), student1InCourse2.getCourse()); - assertNotNull(studentsLogic.getStudentForEmail(student1InArchivedCourse.getCourse(), - student1InArchivedCourse.getEmail())); + assertNotNull(studentsLogic.getStudentForEmail(student1InCourse2.getCourse(), + student1InCourse2.getEmail())); // there are students in the course assertFalse(studentsLogic.getStudentsForCourse(student1InCourse1.getCourse()).isEmpty()); @@ -838,8 +838,8 @@ public void testDeleteStudents_byCourseId_shouldDeleteAllStudents() { // students are deleted assertTrue(studentsLogic.getStudentsForCourse(student1InCourse1.getCourse()).isEmpty()); // students in other courses are not affected - assertNotNull(studentsLogic.getStudentForEmail(student1InArchivedCourse.getCourse(), - student1InArchivedCourse.getEmail())); + assertNotNull(studentsLogic.getStudentForEmail(student1InCourse2.getCourse(), + student1InCourse2.getEmail())); } @Test diff --git a/src/test/java/teammates/sqlui/webapi/GetCoursesActionTest.java b/src/test/java/teammates/sqlui/webapi/GetCoursesActionTest.java index 04c84a28e19..5197b4c9d9c 100644 --- a/src/test/java/teammates/sqlui/webapi/GetCoursesActionTest.java +++ b/src/test/java/teammates/sqlui/webapi/GetCoursesActionTest.java @@ -69,19 +69,6 @@ void testExecute_withInstructorAndActiveCourses_success() { verifySameCoursesData(expectedCoursesData, data, false); } - @Test - void testExecute_withInstructorAndArchivedCourses_success() { - loginAsInstructor(stubInstructor.getGoogleId()); - String[] params = { - Const.ParamsNames.ENTITY_TYPE, Const.EntityType.INSTRUCTOR, - Const.ParamsNames.COURSE_STATUS, Const.CourseStatus.ARCHIVED, - }; - GetCoursesAction action = getAction(params); - JsonResult result = action.execute(); - CoursesData data = (CoursesData) result.getOutput(); - assertEquals(0, data.getCourses().size()); - } - @Test void testExecute_withInstructorAndSoftDeletedCourses_success() { loginAsInstructor(stubInstructor.getGoogleId()); diff --git a/src/test/java/teammates/storage/api/InstructorsDbTest.java b/src/test/java/teammates/storage/api/InstructorsDbTest.java index e55ad77876d..a0a7ae20f56 100644 --- a/src/test/java/teammates/storage/api/InstructorsDbTest.java +++ b/src/test/java/teammates/storage/api/InstructorsDbTest.java @@ -37,14 +37,6 @@ public void addInstructorsToDb() throws Exception { } } - private void setArchiveStatusOfInstructor(String googleId, String courseId, boolean archiveStatus) throws Exception { - instructorsDb.updateInstructorByGoogleId( - InstructorAttributes.updateOptionsWithGoogleIdBuilder(courseId, googleId) - .withIsArchived(archiveStatus) - .build() - ); - } - @Test public void testCreateInstructor() throws Exception { @@ -226,13 +218,6 @@ public void testGetInstructorsForGoogleId() throws Exception { assertEquals("idOfTypicalCourse1", instructor1.getCourseId()); assertEquals("idOfTypicalCourse2", instructor2.getCourseId()); - ______TS("Success: get instructors with specific googleId, with 1 archived course."); - - setArchiveStatusOfInstructor(googleId, instructor1.getCourseId(), true); - retrieved = instructorsDb.getInstructorsForGoogleId(googleId, true); - assertEquals(1, retrieved.size()); - setArchiveStatusOfInstructor(googleId, instructor1.getCourseId(), false); - ______TS("Failure: instructor does not exist"); retrieved = instructorsDb.getInstructorsForGoogleId("non-exist-id", false); @@ -341,7 +326,6 @@ public void testUpdateInstructorByGoogleId() throws Exception { instructorToEdit.setName("New Name"); instructorToEdit.setEmail("InstrDbT.new-email@email.tmt"); - instructorToEdit.setArchived(true); instructorToEdit.setRole(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_OBSERVER); instructorToEdit.setDisplayedToStudents(false); instructorToEdit.setDisplayedName("New Displayed Name"); @@ -353,7 +337,6 @@ public void testUpdateInstructorByGoogleId() throws Exception { instructorToEdit.getGoogleId()) .withName(instructorToEdit.getName()) .withEmail(instructorToEdit.getEmail()) - .withIsArchived(instructorToEdit.isArchived()) .withRole(instructorToEdit.getRole()) .withIsDisplayedToStudents(instructorToEdit.isDisplayedToStudents()) .withDisplayedName(instructorToEdit.getDisplayedName()) @@ -366,8 +349,6 @@ public void testUpdateInstructorByGoogleId() throws Exception { assertEquals(instructorToEdit.getName(), updatedInstructor.getName()); assertEquals(instructorToEdit.getEmail(), actualInstructor.getEmail()); assertEquals(instructorToEdit.getEmail(), updatedInstructor.getEmail()); - assertTrue(actualInstructor.isArchived()); - assertTrue(updatedInstructor.isArchived()); assertEquals(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_OBSERVER, actualInstructor.getRole()); assertEquals(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_OBSERVER, updatedInstructor.getRole()); assertFalse(actualInstructor.isDisplayedToStudents()); @@ -441,7 +422,6 @@ public void testUpdateInstructorByGoogleId_noChangeToInstructor_shouldNotIssueSa instructorToEdit.getCourseId(), instructorToEdit.getGoogleId()) .withName(instructorToEdit.getName()) .withEmail(instructorToEdit.getEmail()) - .withIsArchived(instructorToEdit.isArchived()) .withRole(instructorToEdit.getRole()) .withIsDisplayedToStudents(instructorToEdit.isDisplayedToStudents()) .withDisplayedName(instructorToEdit.getDisplayedName()) @@ -481,16 +461,12 @@ public void testUpdateInstructorByGoogleId_singleFieldUpdate_shouldUpdateCorrect assertEquals("testName", updatedInstructor.getName()); assertEquals("testName", actualInstructor.getName()); - assertFalse(actualInstructor.isArchived()); updatedInstructor = instructorsDb.updateInstructorByGoogleId( InstructorAttributes .updateOptionsWithGoogleIdBuilder(typicalInstructor.getCourseId(), typicalInstructor.getGoogleId()) - .withIsArchived(true) .build()); actualInstructor = instructorsDb.getInstructorForGoogleId(typicalInstructor.getCourseId(), typicalInstructor.getGoogleId()); - assertTrue(updatedInstructor.isArchived()); - assertTrue(actualInstructor.isArchived()); assertNotEquals(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_TUTOR, actualInstructor.getRole()); updatedInstructor = instructorsDb.updateInstructorByGoogleId( @@ -564,7 +540,6 @@ public void testUpdateInstructorByEmail_noChangeToInstructor_shouldNotIssueSaveR instructorToEdit.getCourseId(), instructorToEdit.getEmail()) .withName(instructorToEdit.getName()) .withGoogleId(instructorToEdit.getGoogleId()) - .withIsArchived(instructorToEdit.isArchived()) .withRole(instructorToEdit.getRole()) .withIsDisplayedToStudents(instructorToEdit.isDisplayedToStudents()) .withDisplayedName(instructorToEdit.getDisplayedName()) @@ -604,16 +579,12 @@ public void testUpdateInstructorByEmail_singleFieldUpdate_shouldUpdateCorrectly( assertEquals("testName", updatedInstructor.getName()); assertEquals("testName", actualInstructor.getName()); - assertFalse(actualInstructor.isArchived()); updatedInstructor = instructorsDb.updateInstructorByEmail( InstructorAttributes .updateOptionsWithEmailBuilder(typicalInstructor.getCourseId(), typicalInstructor.getEmail()) - .withIsArchived(true) .build()); actualInstructor = instructorsDb.getInstructorForEmail(typicalInstructor.getCourseId(), typicalInstructor.getEmail()); - assertTrue(updatedInstructor.isArchived()); - assertTrue(actualInstructor.isArchived()); assertNotEquals(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_TUTOR, actualInstructor.getRole()); updatedInstructor = instructorsDb.updateInstructorByEmail( @@ -678,7 +649,6 @@ public void testUpdateInstructorByEmail() throws Exception { instructorToEdit.setGoogleId("new-id"); instructorToEdit.setName("New Name"); - instructorToEdit.setArchived(true); instructorToEdit.setRole(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_OBSERVER); instructorToEdit.setDisplayedToStudents(false); instructorToEdit.setDisplayedName("New Displayed Name"); @@ -690,7 +660,6 @@ public void testUpdateInstructorByEmail() throws Exception { instructorToEdit.getEmail()) .withGoogleId(instructorToEdit.getGoogleId()) .withName(instructorToEdit.getName()) - .withIsArchived(instructorToEdit.isArchived()) .withRole(instructorToEdit.getRole()) .withIsDisplayedToStudents(instructorToEdit.isDisplayedToStudents()) .withDisplayedName(instructorToEdit.getDisplayedName()) @@ -703,8 +672,6 @@ public void testUpdateInstructorByEmail() throws Exception { assertEquals("new-id", updatedInstructor.getGoogleId()); assertEquals("New Name", actualInstructor.getName()); assertEquals("New Name", updatedInstructor.getName()); - assertTrue(actualInstructor.isArchived()); - assertTrue(updatedInstructor.isArchived()); assertEquals(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_OBSERVER, actualInstructor.getRole()); assertEquals(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_OBSERVER, updatedInstructor.getRole()); assertFalse(actualInstructor.isDisplayedToStudents()); @@ -801,7 +768,7 @@ public void testDeleteInstructors_byCourseId_shouldDeleteInstructorsAssociatedWi ______TS("Success: delete instructors of a specific course"); - String courseId = "idOfArchivedCourse"; + String courseId = "idOfTypicalCourse1"; instructorsDb.deleteInstructors(AttributesDeletionQuery.builder() .withCourseId(courseId) .build()); diff --git a/src/test/java/teammates/storage/search/AccountRequestSearchTest.java b/src/test/java/teammates/storage/search/AccountRequestSearchTest.java index 1057995953a..18e4ac4c96b 100644 --- a/src/test/java/teammates/storage/search/AccountRequestSearchTest.java +++ b/src/test/java/teammates/storage/search/AccountRequestSearchTest.java @@ -32,7 +32,6 @@ public void allTests() throws Exception { AccountRequestAttributes ins1InCourse3 = dataBundle.accountRequests.get("instructor1OfCourse3"); AccountRequestAttributes ins2InCourse3 = dataBundle.accountRequests.get("instructor2OfCourse3"); AccountRequestAttributes insInUnregCourse = dataBundle.accountRequests.get("instructor5"); - AccountRequestAttributes insOfArchivedCourse = dataBundle.accountRequests.get("instructorOfArchivedCourse"); AccountRequestAttributes unregisteredInstructor1 = dataBundle.accountRequests.get("unregisteredInstructor1"); AccountRequestAttributes unregisteredInstructor2 = @@ -72,7 +71,7 @@ public void allTests() throws Exception { ______TS("success: search for account requests; account requests should be searchable by their institute"); results = accountRequestsDb.searchAccountRequestsInWholeSystem("\"TEAMMATES Test Institute 5\""); - verifySearchResults(results, insOfArchivedCourse); + verifySearchResults(results, insInUnregCourse); ______TS("success: search for account requests; unregistered account requests should be searchable"); diff --git a/src/test/java/teammates/storage/search/InstructorSearchTest.java b/src/test/java/teammates/storage/search/InstructorSearchTest.java index 76956730e94..fea064a2640 100644 --- a/src/test/java/teammates/storage/search/InstructorSearchTest.java +++ b/src/test/java/teammates/storage/search/InstructorSearchTest.java @@ -35,7 +35,6 @@ public void allTests() throws Exception { InstructorAttributes ins1InCourse3 = dataBundle.instructors.get("instructor1OfCourse3"); InstructorAttributes ins2InCourse3 = dataBundle.instructors.get("instructor2OfCourse3"); InstructorAttributes ins1InCourse4 = dataBundle.instructors.get("instructor1OfCourse4"); - InstructorAttributes insInArchivedCourse = dataBundle.instructors.get("instructorOfArchivedCourse"); InstructorAttributes insInUnregCourse = dataBundle.instructors.get("instructor5"); InstructorAttributes ins1InTestingSanitizationCourse = dataBundle.instructors.get("instructor1OfTestingSanitizationCourse"); @@ -63,11 +62,6 @@ public void allTests() throws Exception { results = instructorsDb.searchInstructorsInWholeSystem("InStRuCtOr2"); verifySearchResults(results, ins2InCourse1, ins2InCourse2, ins2InCourse3); - ______TS("success: search for instructors in whole system; instructors in archived courses should be included"); - - results = instructorsDb.searchInstructorsInWholeSystem("archived"); - verifySearchResults(results, insInArchivedCourse); - ______TS("success: search for instructors in whole system; instructors in unregistered course should be included"); results = instructorsDb.searchInstructorsInWholeSystem("instructor5"); diff --git a/src/test/java/teammates/storage/search/StudentSearchTest.java b/src/test/java/teammates/storage/search/StudentSearchTest.java index 299447ce86a..c4e56cb9cae 100644 --- a/src/test/java/teammates/storage/search/StudentSearchTest.java +++ b/src/test/java/teammates/storage/search/StudentSearchTest.java @@ -35,7 +35,6 @@ public void allTests() throws Exception { StudentAttributes stu1InCourse3 = dataBundle.students.get("student1InCourse3"); StudentAttributes stu1InUnregCourse = dataBundle.students.get("student1InUnregisteredCourse"); StudentAttributes stu2InUnregCourse = dataBundle.students.get("student2InUnregisteredCourse"); - StudentAttributes stu1InArchCourse = dataBundle.students.get("student1InArchivedCourse"); ______TS("success: search for students in whole system; query string does not match any student"); @@ -48,9 +47,9 @@ public void allTests() throws Exception { studentList = studentsDb.searchStudentsInWholeSystem("student1"); - assertEquals(5, studentList.size()); + assertEquals(4, studentList.size()); AssertHelper.assertSameContentIgnoreOrder( - Arrays.asList(stu1InCourse1, stu1InCourse2, stu1InCourse3, stu1InUnregCourse, stu1InArchCourse), + Arrays.asList(stu1InCourse1, stu1InCourse2, stu1InCourse3, stu1InUnregCourse), studentList); ______TS("success: search for students in whole system; query string should be case-insensitive"); @@ -98,14 +97,13 @@ public void testSearchStudent_deleteAfterSearch_shouldNotBeSearchable() throws E StudentAttributes stu1InCourse2 = dataBundle.students.get("student1InCourse2"); StudentAttributes stu1InCourse3 = dataBundle.students.get("student1InCourse3"); StudentAttributes stu1InUnregCourse = dataBundle.students.get("student1InUnregisteredCourse"); - StudentAttributes stu1InArchCourse = dataBundle.students.get("student1InArchivedCourse"); List studentList = studentsDb.searchStudentsInWholeSystem("student1"); // there is search result before deletion - assertEquals(5, studentList.size()); + assertEquals(4, studentList.size()); AssertHelper.assertSameContentIgnoreOrder( - Arrays.asList(stu1InCourse1, stu1InCourse2, stu1InCourse3, stu1InUnregCourse, stu1InArchCourse), + Arrays.asList(stu1InCourse1, stu1InCourse2, stu1InCourse3, stu1InUnregCourse), studentList); // delete a student @@ -114,9 +112,9 @@ public void testSearchStudent_deleteAfterSearch_shouldNotBeSearchable() throws E // the search result will change studentList = studentsDb.searchStudentsInWholeSystem("student1"); - assertEquals(4, studentList.size()); + assertEquals(3, studentList.size()); AssertHelper.assertSameContentIgnoreOrder( - Arrays.asList(stu1InCourse2, stu1InCourse3, stu1InUnregCourse, stu1InArchCourse), + Arrays.asList(stu1InCourse2, stu1InCourse3, stu1InUnregCourse), studentList); // delete all students in course 2 @@ -127,9 +125,9 @@ public void testSearchStudent_deleteAfterSearch_shouldNotBeSearchable() throws E // the search result will change studentList = studentsDb.searchStudentsInWholeSystem("student1"); - assertEquals(3, studentList.size()); + assertEquals(2, studentList.size()); AssertHelper.assertSameContentIgnoreOrder( - Arrays.asList(stu1InCourse3, stu1InUnregCourse, stu1InArchCourse), + Arrays.asList(stu1InCourse3, stu1InUnregCourse), studentList); } diff --git a/src/test/java/teammates/test/AbstractBackDoor.java b/src/test/java/teammates/test/AbstractBackDoor.java index 90e8167ab14..fdf720b4d18 100644 --- a/src/test/java/teammates/test/AbstractBackDoor.java +++ b/src/test/java/teammates/test/AbstractBackDoor.java @@ -54,7 +54,6 @@ import teammates.ui.output.AccountData; import teammates.ui.output.AccountRequestData; import teammates.ui.output.CourseData; -import teammates.ui.output.CoursesData; import teammates.ui.output.DeadlineExtensionData; import teammates.ui.output.FeedbackQuestionData; import teammates.ui.output.FeedbackQuestionsData; @@ -413,50 +412,6 @@ public CourseAttributes getCourse(String courseId) { .build(); } - /** - * Gets archived course data from the database. - */ - public CourseData getArchivedCourseData(String instructorId, String courseId) { - Map params = new HashMap<>(); - params.put(Const.ParamsNames.USER_ID, instructorId); - params.put(Const.ParamsNames.COURSE_ID, courseId); - params.put(Const.ParamsNames.ENTITY_TYPE, Const.EntityType.INSTRUCTOR); - params.put(Const.ParamsNames.COURSE_STATUS, Const.CourseStatus.ARCHIVED); - - ResponseBodyAndCode response = executeGetRequest(Const.ResourceURIs.COURSES, params); - if (response.responseCode == HttpStatus.SC_NOT_FOUND) { - return null; - } - - CoursesData coursesData = JsonUtils.fromJson(response.responseBody, CoursesData.class); - CourseData courseData = coursesData.getCourses() - .stream() - .filter(cd -> cd.getCourseId().equals(courseId)) - .findFirst() - .orElse(null); - - if (courseData == null) { - return null; - } - - return courseData; - } - - /** - * Gets a archived course from the database. - */ - public CourseAttributes getArchivedCourse(String instructorId, String courseId) { - CourseData courseData = getArchivedCourseData(instructorId, courseId); - if (courseData == null) { - return null; - } - return CourseAttributes.builder(courseData.getCourseId()) - .withName(courseData.getCourseName()) - .withTimezone(courseData.getTimeZone()) - .withInstitute(courseData.getInstitute()) - .build(); - } - /** * Returns true if the course exists and is in recycle bin. */ diff --git a/src/test/java/teammates/ui/webapi/ArchiveCourseActionTest.java b/src/test/java/teammates/ui/webapi/ArchiveCourseActionTest.java deleted file mode 100644 index e0daff035d3..00000000000 --- a/src/test/java/teammates/ui/webapi/ArchiveCourseActionTest.java +++ /dev/null @@ -1,129 +0,0 @@ -package teammates.ui.webapi; - -import org.testng.annotations.Test; - -import teammates.common.datatransfer.attributes.InstructorAttributes; -import teammates.common.util.Const; -import teammates.ui.output.CourseArchiveData; -import teammates.ui.request.CourseArchiveRequest; - -/** - * SUT: {@link ArchiveCourseAction}. - */ -public class ArchiveCourseActionTest extends BaseActionTest { - - @Override - protected String getActionUri() { - return Const.ResourceURIs.COURSE_ARCHIVE; - } - - @Override - protected String getRequestMethod() { - return PUT; - } - - @Override - @Test - protected void testExecute() { - InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); - String instructorId = instructor1OfCourse1.getGoogleId(); - - loginAsInstructor(instructorId); - - String[] submissionParams = new String[] { - Const.ParamsNames.COURSE_ID, instructor1OfCourse1.getCourseId(), - }; - - CourseArchiveRequest courseArchiveRequest = new CourseArchiveRequest(); - courseArchiveRequest.setArchiveStatus(true); - - ______TS("Not enough parameters"); - verifyHttpParameterFailure(); - verifyHttpRequestBodyFailure(null, submissionParams); - verifyHttpParameterFailure(courseArchiveRequest); - - ______TS("Typical case: archive a course"); - - ArchiveCourseAction archiveCourseAction = getAction(courseArchiveRequest, submissionParams); - JsonResult result = getJsonResult(archiveCourseAction); - CourseArchiveData courseArchiveData = (CourseArchiveData) result.getOutput(); - - InstructorAttributes theInstructor = logic.getInstructorForGoogleId( - instructor1OfCourse1.getCourseId(), instructor1OfCourse1.getGoogleId()); - - assertTrue(theInstructor.isArchived()); - verifyCourseArchive(courseArchiveData, instructor1OfCourse1.getCourseId(), true); - - ______TS("Rare case: archive an already archived course"); - - courseArchiveRequest.setArchiveStatus(true); - - archiveCourseAction = getAction(courseArchiveRequest, submissionParams); - result = getJsonResult(archiveCourseAction); - courseArchiveData = (CourseArchiveData) result.getOutput(); - - theInstructor = logic.getInstructorForGoogleId( - instructor1OfCourse1.getCourseId(), instructor1OfCourse1.getGoogleId()); - - assertTrue(theInstructor.isArchived()); - verifyCourseArchive(courseArchiveData, instructor1OfCourse1.getCourseId(), true); - - ______TS("Typical case: unarchive a course"); - - courseArchiveRequest.setArchiveStatus(false); - - ArchiveCourseAction unarchiveAction = getAction(courseArchiveRequest, submissionParams); - result = getJsonResult(unarchiveAction); - courseArchiveData = (CourseArchiveData) result.getOutput(); - - theInstructor = logic.getInstructorForGoogleId(instructor1OfCourse1.getCourseId(), - instructor1OfCourse1.getGoogleId()); - - assertFalse(theInstructor.isArchived()); - verifyCourseArchive(courseArchiveData, instructor1OfCourse1.getCourseId(), false); - - ______TS("Rare case: unarchive an active course"); - - courseArchiveRequest.setArchiveStatus(false); - - unarchiveAction = getAction(courseArchiveRequest, submissionParams); - result = getJsonResult(unarchiveAction); - courseArchiveData = (CourseArchiveData) result.getOutput(); - - theInstructor = logic.getInstructorForGoogleId( - instructor1OfCourse1.getCourseId(), instructor1OfCourse1.getGoogleId()); - - assertFalse(theInstructor.isArchived()); - verifyCourseArchive(courseArchiveData, instructor1OfCourse1.getCourseId(), false); - - ______TS("Masquerade mode: archive course"); - - loginAsAdmin(); - courseArchiveRequest.setArchiveStatus(true); - - archiveCourseAction = getAction(courseArchiveRequest, addUserIdToParams(instructorId, submissionParams)); - result = getJsonResult(archiveCourseAction); - courseArchiveData = (CourseArchiveData) result.getOutput(); - - theInstructor = logic.getInstructorForGoogleId( - instructor1OfCourse1.getCourseId(), instructor1OfCourse1.getGoogleId()); - - assertTrue(theInstructor.isArchived()); - verifyCourseArchive(courseArchiveData, instructor1OfCourse1.getCourseId(), true); - } - - private void verifyCourseArchive(CourseArchiveData courseArchiveData, String courseId, boolean isArchived) { - assertEquals(courseArchiveData.getCourseId(), courseId); - assertEquals(courseArchiveData.getIsArchived(), isArchived); - } - - @Override - @Test - protected void testAccessControl() { - String[] submissionParams = new String[] { - Const.ParamsNames.COURSE_ID, typicalBundle.instructors.get("instructor1OfCourse1").getCourseId(), - }; - - verifyOnlyInstructorsOfTheSameCourseCanAccess(submissionParams); - } -} diff --git a/src/test/java/teammates/ui/webapi/GetCoursesActionTest.java b/src/test/java/teammates/ui/webapi/GetCoursesActionTest.java index 05deb3ad51c..482cc24cbd6 100644 --- a/src/test/java/teammates/ui/webapi/GetCoursesActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetCoursesActionTest.java @@ -84,27 +84,13 @@ public void testGetCoursesAction_withInstructorEntityTypeAndActiveCourses_should loginAsInstructor(instructor.getGoogleId()); CoursesData courses = getValidCourses(params); - assertEquals(2, courses.getCourses().size()); + assertEquals(3, courses.getCourses().size()); CourseAttributes expectedCourse1 = testData.courses.get("typicalCourse1"); CourseAttributes expectedCourse2 = testData.courses.get("typicalCourse2"); + CourseAttributes expectedCourse3 = testData.courses.get("typicalCourse4"); verifySameCourseData(courses.getCourses().get(0), expectedCourse1); verifySameCourseData(courses.getCourses().get(1), expectedCourse2); - } - - @Test - public void testGetCoursesAction_withInstructorEntityTypeAndArchivedCourses_shouldReturnCorrectCourses() { - String[] params = { - Const.ParamsNames.ENTITY_TYPE, Const.EntityType.INSTRUCTOR, - Const.ParamsNames.COURSE_STATUS, Const.CourseStatus.ARCHIVED, - }; - - InstructorAttributes instructor = testData.instructors.get("instructor1OfCourse1"); - loginAsInstructor(instructor.getGoogleId()); - - CoursesData courses = getValidCourses(params); - assertEquals(1, courses.getCourses().size()); - CourseAttributes expectedCourse = testData.courses.get("typicalCourse4"); - verifySameCourseData(courses.getCourses().get(0), expectedCourse); + verifySameCourseData(courses.getCourses().get(2), expectedCourse3); } @Test @@ -132,14 +118,12 @@ public void testGetCoursesAction_withStudentEntityType_shouldReturnCorrectCourse loginAsStudent(student.getGoogleId()); CoursesData courses = getValidCourses(params); - assertEquals(3, courses.getCourses().size()); + assertEquals(2, courses.getCourses().size()); CourseAttributes expectedCourse1 = testData.courses.get("typicalCourse1"); CourseAttributes expectedCourse2 = testData.courses.get("typicalCourse2"); - CourseAttributes expectedCourse3 = testData.courses.get("typicalCourse4"); verifySameCourseDataStudent(courses.getCourses().get(0), expectedCourse1); verifySameCourseDataStudent(courses.getCourses().get(1), expectedCourse2); - verifySameCourseDataStudent(courses.getCourses().get(2), expectedCourse3); } private void verifySameCourseData(CourseData actualCourse, CourseAttributes expectedCourse) { diff --git a/src/test/java/teammates/ui/webapi/GetFeedbackSessionsActionTest.java b/src/test/java/teammates/ui/webapi/GetFeedbackSessionsActionTest.java index c90ba863e3e..a0d8225da85 100644 --- a/src/test/java/teammates/ui/webapi/GetFeedbackSessionsActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetFeedbackSessionsActionTest.java @@ -51,6 +51,8 @@ protected void prepareTestData() { sessionsInCourse2 = new ArrayList<>(); sessionsInCourse2.add(typicalBundle.feedbackSessions.get("session1InCourse2")); sessionsInCourse2.add(typicalBundle.feedbackSessions.get("session2InCourse2")); + sessionsInCourse2.add(typicalBundle.feedbackSessions.get("noStudentQuestionsSessionInCourse2")); + sessionsInCourse2.add(typicalBundle.feedbackSessions.get("noInstructorQuestionsSessionInCourse2")); FeedbackSessionAttributes session1InCourse1 = typicalBundle.feedbackSessions.get("session1InCourse1"); session1InCourse1.setDeletedTime(Instant.now()); @@ -134,7 +136,7 @@ protected void testExecute_instructorAsStudent_shouldReturnAllSessionsForStudent GetFeedbackSessionsAction action = getAction(submissionParam); FeedbackSessionsData fsData = (FeedbackSessionsData) getJsonResult(action).getOutput(); - assertEquals(2, fsData.getFeedbackSessions().size()); + assertEquals(4, fsData.getFeedbackSessions().size()); assertAllStudentSessionsMatch(fsData, sessionsInCourse2, instructor1OfCourse1.getEmail()); } diff --git a/src/test/java/teammates/ui/webapi/SearchStudentsActionTest.java b/src/test/java/teammates/ui/webapi/SearchStudentsActionTest.java index b68ed207e9b..e5d9677ccb9 100644 --- a/src/test/java/teammates/ui/webapi/SearchStudentsActionTest.java +++ b/src/test/java/teammates/ui/webapi/SearchStudentsActionTest.java @@ -84,7 +84,7 @@ public void execute_adminSearchName_success() { SearchStudentsAction a = getAction(accNameParams); JsonResult result = getJsonResult(a); StudentsData response = (StudentsData) result.getOutput(); - assertEquals(11, response.getStudents().size()); + assertEquals(10, response.getStudents().size()); } @Test @@ -176,7 +176,7 @@ public void execute_adminSearchGoogleId_success() { JsonResult result = getJsonResult(a); StudentsData response = (StudentsData) result.getOutput(); - assertEquals(11, response.getStudents().size()); + assertEquals(10, response.getStudents().size()); } @Test diff --git a/src/test/resources/data/CourseRosterDataBundle.json b/src/test/resources/data/CourseRosterDataBundle.json index 7a6b7fcf2e8..196d97b3b29 100644 --- a/src/test/resources/data/CourseRosterDataBundle.json +++ b/src/test/resources/data/CourseRosterDataBundle.json @@ -5,7 +5,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor1 Course1", "email": "instructor1@course1.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -29,7 +28,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor2 Course1", "email": "instructor2@course1.tmt", - "isArchived": false, "role": "Manager", "isDisplayedToStudents": true, "displayedName": "Manager", @@ -53,7 +51,6 @@ "courseId": "idOfTypicalCourse1", "name": "Helper Course1", "email": "helper@course1.tmt", - "isArchived": false, "role": "Custom", "isDisplayedToStudents": false, "displayedName": "Helper", @@ -77,7 +74,6 @@ "courseId": "idOfTypicalCourse2", "name": "Instructor1 Course2", "email": "instructor1@course2.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -101,7 +97,6 @@ "courseId": "idOfTypicalCourse2", "name": "Instructor2 Course2", "email": "instructor2@course2.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -125,7 +120,6 @@ "courseId": "idOfTypicalCourse3", "name": "Instructor1 Course3", "email": "instructor1@course3.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -149,7 +143,6 @@ "courseId": "idOfTypicalCourse3", "name": "Instructor2 Course3", "email": "instructor2@course3.tmt", - "isArchived": false, "role": "Custom", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -173,7 +166,6 @@ "courseId": "idOfTypicalCourse4", "name": "Instructor1 Course4", "email": "instructor1@course3.tmt", - "isArchived": false, "role": "Custom", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -197,7 +189,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor3 Course1", "email": "instructor3@course1.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -221,7 +212,6 @@ "courseId": "idOfTypicalCourse2", "name": "Instructor3 Course2", "email": "instructor3@course2.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -245,7 +235,6 @@ "courseId": "idOfCourseNoEvals", "name": "Instructor4 name", "email": "instructor4@courseNoEvals.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -269,7 +258,6 @@ "courseId": "idOfUnregisteredCourse", "name": "Instructor 5 of CourseNoRegister", "email": "instructor5@courseNoRegister.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -293,7 +281,6 @@ "courseId": "idOfTestingInstructorsDisplayedCourse", "name": "name1", "email": "instructorNotDisplayed@NotDisplayed.tmt", - "isArchived": true, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -317,7 +304,6 @@ "courseId": "idOfTestingInstructorsDisplayedCourse", "name": "name2", "email": "secondInstructorNotDisplayed@NotDisplayed.tmt", - "isArchived": true, "role": "Co-owner", "isDisplayedToStudents": false, "displayedName": "Instructor", @@ -341,7 +327,6 @@ "name": "Instructor Not Yet Joined Course", "email": "instructorNotYetJoined@email.tmt", "key": "regKeyForInstrNotYetJoinCourse", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -365,7 +350,6 @@ "courseId": "idOfTestingSanitizationCourse", "name": "Instructor", "email": "instructor1@sanitization.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "inst'\"/>", @@ -487,15 +471,6 @@ "section": "Section 2", "key": "regKey2ForStuNotYetJoinCourse" }, - "student1InArchivedCourse": { - "googleId": "student1InArchivedCourse", - "email": "student1InArchivedCourse@gmail.tmt", - "course": "idOfArchivedCourse", - "name": "student1 In Course1", - "comments": "", - "team": "Team 2.1", - "section": "None" - }, "student1InTestingSanitizationCourse": { "googleId": "student1InTestingSanitizationCourse", "email": "normal@sanitization.tmt", diff --git a/src/test/resources/data/EmailGeneratorTest.json b/src/test/resources/data/EmailGeneratorTest.json index dfb7745fab5..c2184b1e8e8 100644 --- a/src/test/resources/data/EmailGeneratorTest.json +++ b/src/test/resources/data/EmailGeneratorTest.json @@ -118,7 +118,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor1 Course1", "email": "instructor1@course1.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -142,7 +141,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor2 Course1", "email": "instructor2@course1.tmt", - "isArchived": false, "role": "Manager", "isDisplayedToStudents": true, "displayedName": "Manager", @@ -166,7 +164,6 @@ "courseId": "idOfTypicalCourse1", "name": "Helper Course1", "email": "helper@course1.tmt", - "isArchived": false, "role": "Custom", "isDisplayedToStudents": false, "displayedName": "Helper", @@ -189,7 +186,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor Not Yet Joined Course 1", "email": "instructorNotYetJoinedCourse1@email.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -213,7 +209,6 @@ "courseId": "idOfTypicalCourse2", "name": "Instructor1 Course2", "email": "instructor1@course2.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -237,7 +232,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor3 Course1", "email": "instructor3@course1.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -261,7 +255,6 @@ "courseId": "idOfTestingNoEmailsSentCourse", "name": "Instructor1 No Emails Sent Course", "email": "instructor1@noemailssent.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -285,7 +278,6 @@ "courseId": "idOfTestingSanitizationCourse", "name": "Instructor", "email": "instructor1@sanitization.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "inst'\"/>", diff --git a/src/test/resources/data/FeedbackContributionQuestionTest.json b/src/test/resources/data/FeedbackContributionQuestionTest.json index 90f21d926f0..0c70db1c86c 100644 --- a/src/test/resources/data/FeedbackContributionQuestionTest.json +++ b/src/test/resources/data/FeedbackContributionQuestionTest.json @@ -72,12 +72,6 @@ "email": "iwosc@yahoo.tmt", "readNotifications": {} }, - "instructorOfArchivedCourse": { - "googleId": "idOfInstructorOfArchivedCourse", - "name": "InstructorOfArchiveCourse name", - "email": "instructorOfArchiveCourse@archiveCourse.tmt", - "readNotifications": {} - }, "instructor1OfTestingSanitizationCourse": { "googleId": "idOfInstructor1OfTestingSanitizationCourse", "name": "Instructor", @@ -96,12 +90,6 @@ "email": "student2InCourse1@gmail.tmt", "readNotifications": {} }, - "student1InArchivedCourse": { - "googleId": "student1InArchivedCourse", - "name": "Student in Archived Course", - "email": "student1InCourse1@gmail.tmt", - "readNotifications": {} - }, "student1InTestingSanitizationCourse": { "googleId": "student1InTestingSanitizationCourse", "name": "Stud1", @@ -151,12 +139,6 @@ "institute": "TEAMMATES Test Institute 7", "timeZone": "Africa/Johannesburg" }, - "archivedCourse": { - "id": "idOfArchivedCourse", - "name": "Archived Course", - "institute": "TEAMMATES Test Institute 5", - "timeZone": "Africa/Johannesburg" - }, "unregisteredCourse": { "id": "idOfUnregisteredCourse", "name": "Unregistered Course", @@ -184,7 +166,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor1 Course1", "email": "instructor1@course1.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -208,7 +189,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor2 Course1", "email": "instructor2@course1.tmt", - "isArchived": false, "role": "Manager", "isDisplayedToStudents": true, "displayedName": "Manager", @@ -232,7 +212,6 @@ "courseId": "idOfTypicalCourse1", "name": "Helper Course1", "email": "helper@course1.tmt", - "isArchived": false, "role": "Custom", "isDisplayedToStudents": false, "displayedName": "Helper", @@ -255,7 +234,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor Not Yet Joined Course 1", "email": "instructorNotYetJoinedCourse1@email.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -279,7 +257,6 @@ "courseId": "idOfTypicalCourse2", "name": "Instructor1 Course2", "email": "instructor1@course2.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -303,7 +280,6 @@ "courseId": "idOfTypicalCourse2", "name": "Instructor2 Course2", "email": "instructor2@course2.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -327,7 +303,6 @@ "courseId": "idOfTypicalCourse3", "name": "Instructor1 Course3", "email": "instructor1@course3.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -351,7 +326,6 @@ "courseId": "idOfTypicalCourse3", "name": "Instructor2 Course3", "email": "instructor2@course3.tmt", - "isArchived": false, "role": "Custom", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -375,7 +349,6 @@ "courseId": "idOfTypicalCourse4", "name": "Instructor1 Course4", "email": "instructor1@course3.tmt", - "isArchived": false, "role": "Custom", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -399,7 +372,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor3 Course1", "email": "instructor3@course1.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -423,7 +395,6 @@ "courseId": "idOfTypicalCourse2", "name": "Instructor3 Course2", "email": "instructor3@course2.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -447,7 +418,6 @@ "courseId": "idOfCourseNoEvals", "name": "Instructor4 name", "email": "instructor4@courseNoEvals.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -471,7 +441,6 @@ "courseId": "idOfUnregisteredCourse", "name": "Instructor 5 of CourseNoRegister", "email": "instructor5@courseNoRegister.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -495,31 +464,6 @@ "courseId": "idOfSampleCourse-demo", "name": "Instructor With Only One Sample Course", "email": "iwosc@yahoo.tmt", - "isArchived": false, - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canViewStudentInSections": true, - "canSubmitSessionInSections": true, - "canModifySessionCommentsInSections": true, - "canModifyCourse": true, - "canViewSessionInSections": true, - "canModifySession": true, - "canModifyStudent": true, - "canModifyInstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructorOfArchivedCourse": { - "googleId": "idOfInstructorOfArchivedCourse", - "courseId": "idOfArchivedCourse", - "name": "InstructorOfArchiveCourse name", - "email": "instructorOfArchiveCourse@archiveCourse.tmt", - "isArchived": true, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -543,7 +487,6 @@ "courseId": "idOfTestingInstructorsDisplayedCourse", "name": "name1", "email": "instructorNotDisplayed@NotDisplayed.tmt", - "isArchived": true, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -567,7 +510,6 @@ "courseId": "idOfTestingInstructorsDisplayedCourse", "name": "name2", "email": "secondInstructorNotDisplayed@NotDisplayed.tmt", - "isArchived": true, "role": "Co-owner", "isDisplayedToStudents": false, "displayedName": "Instructor", @@ -590,7 +532,6 @@ "courseId": "idOfSampleCourse-demo", "name": "Instructor Not Yet Joined Course", "email": "instructorNotYetJoined@email.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -614,7 +555,6 @@ "courseId": "idOfTestingSanitizationCourse", "name": "Instructor", "email": "instructor1@sanitization.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "inst'\"/>", @@ -847,29 +787,6 @@ "studentDeadlines": {}, "instructorDeadlines": {} }, - "archiveCourse.session1": { - "feedbackSessionName": "session without student questions", - "courseId": "idOfArchivedCourse", - "creatorEmail": "instructor1@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2013-01-20T23:00:00Z", - "startTime": "2013-02-20T23:00:00Z", - "endTime": "2026-04-28T23:00:00Z", - "sessionVisibleFromTime": "2013-02-20T23:00:00Z", - "resultsVisibleFromTime": "2026-04-29T23:00:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 5, - "sentOpeningSoonEmail": true, - "sentOpenedEmail": true, - "sentClosingSoonEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpenedEmailEnabled": true, - "isClosingSoonEmailEnabled": true, - "isPublishedEmailEnabled": true, - "studentDeadlines": {}, - "instructorDeadlines": {} - }, "session1InCourse2": { "feedbackSessionName": "Instructor feedback session", "courseId": "idOfTypicalCourse2", diff --git a/src/test/resources/data/FeedbackResponseCommentCRUDTest.json b/src/test/resources/data/FeedbackResponseCommentCRUDTest.json index 8b79e211df4..8c3fa14f286 100644 --- a/src/test/resources/data/FeedbackResponseCommentCRUDTest.json +++ b/src/test/resources/data/FeedbackResponseCommentCRUDTest.json @@ -115,7 +115,6 @@ "courseId": "idOfCourse1", "name": "Helper Course1", "email": "helper@course1.tmt", - "isArchived": false, "role": "Custom", "isDisplayedToStudents": false, "displayedName": "Helper", diff --git a/src/test/resources/data/FeedbackResponseVisibilityTest.json b/src/test/resources/data/FeedbackResponseVisibilityTest.json index f4f4b43cab2..8e630062d3c 100644 --- a/src/test/resources/data/FeedbackResponseVisibilityTest.json +++ b/src/test/resources/data/FeedbackResponseVisibilityTest.json @@ -15,7 +15,6 @@ "courseId": "FRV.idOfTypicalCourse1", "name": "Instructor1 Course1", "email": "FRV.instructor1@course1.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -39,7 +38,6 @@ "courseId": "FRV.idOfTypicalCourse1", "name": "Instructor2 Course1", "email": "FRV.instructor2@course1.tmt", - "isArchived": false, "role": "Manager", "isDisplayedToStudents": true, "displayedName": "Manager", @@ -63,7 +61,6 @@ "courseId": "FRV.idOfTypicalCourse1", "name": "Instructor3 Course1", "email": "FRV.instructor3@course1.tmt", - "isArchived": false, "role": "Custom", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -87,7 +84,6 @@ "courseId": "FRV.idOfTypicalCourse1", "name": "Instructor4 Course1", "email": "FRV.instructor4@course1.tmt", - "isArchived": false, "role": "Custom", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -124,7 +120,6 @@ "courseId": "FRV.idOfTypicalCourse1", "name": "Instructor5 Course1", "email": "FRV.instructor5@course1.tmt", - "isArchived": false, "role": "Custom", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -155,7 +150,6 @@ "courseId": "FRV.idOfTypicalCourse1", "name": "Instructor6 Course1", "email": "FRV.instructor6@course1.tmt", - "isArchived": false, "role": "Custom", "isDisplayedToStudents": true, "displayedName": "Instructor", diff --git a/src/test/resources/data/FeedbackSessionResultsBundleTest.json b/src/test/resources/data/FeedbackSessionResultsBundleTest.json index 47382c68c3c..2cc3fa93c6d 100644 --- a/src/test/resources/data/FeedbackSessionResultsBundleTest.json +++ b/src/test/resources/data/FeedbackSessionResultsBundleTest.json @@ -40,7 +40,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor1 Course1", "email": "instructor1@course1.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", diff --git a/src/test/resources/data/FeedbackSessionResultsTest.json b/src/test/resources/data/FeedbackSessionResultsTest.json index 8480587a8a7..dc7169a49a3 100644 --- a/src/test/resources/data/FeedbackSessionResultsTest.json +++ b/src/test/resources/data/FeedbackSessionResultsTest.json @@ -75,7 +75,6 @@ "courseId": "FSRTest.idOfTypicalCourse1", "name": "Instructor1 Course1", "email": "FSRTest.instr1@course1.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": false, "displayedName": "Co-owner", @@ -99,7 +98,6 @@ "courseId": "FSRTest.idOfTypicalCourse1", "name": "Instructor2 Course1", "email": "FSRTest.instr2@course1.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": false, "displayedName": "Co-owner", @@ -123,7 +121,6 @@ "courseId": "FSRTest.idOfTypicalCourse1", "name": "Instructor3 Course1", "email": "FSRTest.instr3@course1n2.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": false, "displayedName": "Co-owner", @@ -147,7 +144,6 @@ "courseId": "FSRTest.idOfNoSessionsCourse", "name": "Instructor3 No Sessions", "email": "FSRTest.instr3@course1n2.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": false, "displayedName": "Co-owner", diff --git a/src/test/resources/data/FeedbackSessionsLogicTest.json b/src/test/resources/data/FeedbackSessionsLogicTest.json index 23d85f28c49..513f424a9d4 100644 --- a/src/test/resources/data/FeedbackSessionsLogicTest.json +++ b/src/test/resources/data/FeedbackSessionsLogicTest.json @@ -66,12 +66,6 @@ "email": "iwosc@yahoo.tmt", "readNotifications": {} }, - "instructorOfArchivedCourse": { - "googleId": "idOfInstructorOfArchivedCourse", - "name": "InstructorOfArchiveCourse name", - "email": "instructorOfArchiveCourse@archiveCourse.tmt", - "readNotifications": {} - }, "student1InCourse1": { "googleId": "student1InCourse1", "name": "Student 1 in course 1", @@ -84,10 +78,10 @@ "email": "student2InCourse1@gmail.tmt", "readNotifications": {} }, - "student1InArchivedCourse": { - "googleId": "student1InArchivedCourse", - "name": "Student in Archived Course", - "email": "student1InCourse1@gmail.tmt", + "student1InNoQuestionsCourse": { + "googleId": "student1InNoQuestionsCourse", + "name": "Student 1 in No Questions Course", + "email": "student1InNoQuestionsCourse@gmail.tmt", "readNotifications": {} } }, @@ -125,17 +119,17 @@ "institute": "TEAMMATES Test Institute 7", "timeZone": "UTC" }, - "archivedCourse": { - "id": "idOfArchivedCourse", - "name": "Archived Course", - "institute": "TEAMMATES Test Institute 5", - "timeZone": "UTC" - }, "unregisteredCourse": { "id": "idOfUnregisteredCourse", "name": "Unregistered Course", "institute": "TEAMMATES Test Institute 1", "timeZone": "UTC" + }, + "noQuestionsCourse": { + "id": "idOfNoQuestionsCourse", + "name": "Course with no questions", + "institute": "TEAMMATES Test Institute 1", + "timeZone": "UTC" } }, "instructors": { @@ -190,7 +184,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor3 Course1", "email": "instructor3@course1.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -351,7 +344,6 @@ "courseId": "idOfCourseNoEvals", "name": "Instructor4 name", "email": "instructor4@courseNoEvals.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -416,30 +408,6 @@ "sessionLevel": {} } }, - "instructorOfArchivedCourse": { - "googleId": "idOfInstructorOfArchivedCourse", - "courseId": "idOfArchivedCourse", - "name": "InstructorOfArchiveCourse name", - "email": "instructorOfArchiveCourse@archiveCourse.tmt", - "isArchived": true, - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canViewStudentInSections": true, - "canSubmitSessionInSections": true, - "canModifySessionCommentsInSections": true, - "canModifyCourse": true, - "canViewSessionInSections": true, - "canModifySession": true, - "canModifyStudent": true, - "canModifyInstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, "instructorNotYetJoinCourse": { "courseId": "idOfSampleCourse-demo", "name": "Instructor Not Yet Joined Course", @@ -563,14 +531,14 @@ "team": "Team 2", "section": "Section 2" }, - "student1InArchivedCourse": { - "googleId": "student1InArchivedCourse", - "email": "student1InArchivedCourse@gmail.tmt", - "course": "idOfArchivedCourse", - "name": "student1 In Course1", + "student1InNoQuestionsCourse": { + "googleId": "student1InNoQuestionsCourse", + "email": "student1InNoQuestionsCourse@gmail.tmt", + "course": "idOfNoQuestionsCourse", + "name": "student1 In No Questions Course", "comments": "", - "team": "Team 2.1", - "section": "None" + "team": "Team 1", + "section": "Section 1" } }, "feedbackSessions": { @@ -720,9 +688,9 @@ "studentDeadlines": {}, "instructorDeadlines": {} }, - "archiveCourse.session1": { + "noStudentQuestionsSessionInNoQuestionsCourse": { "feedbackSessionName": "session without student questions", - "courseId": "idOfArchivedCourse", + "courseId": "idOfNoQuestionsCourse", "creatorEmail": "instructor1@course1.tmt", "instructions": "Please please fill in the following questions.", "createdTime": "2013-01-20T23:00:00Z", @@ -1090,9 +1058,9 @@ "RECEIVER" ] }, - "qn1InSessionInArchivedCourse": { + "qn1InNoStudentQuestionsSessionInNoQuestionsCourse": { "feedbackSessionName": "session without student questions", - "courseId": "idOfArchivedCourse", + "courseId": "idOfNoQuestionsCourse", "questionDetails": { "questionType": "TEXT", "questionText": "Give feedback to students" @@ -1368,15 +1336,15 @@ }, "response1ForNVSQ1": { "feedbackSessionName": "session without student questions", - "courseId": "idOfArchivedCourse", + "courseId": "idOfNoQuestionsCourse", "feedbackQuestionId": "1", - "giver": "instructorOfArchiveCourse@archiveCourse.tmt", - "recipient": "student1InArchivedCourse@gmail.tmt", + "giver": "instructor1@course1.tmt", + "recipient": "student1InNoQuestionsCourse@gmail.tmt", "giverSection": "None", "recipientSection": "Section 1", "responseDetails": { "questionType": "TEXT", - "answer": "Response from instructor to student" + "answer": "Response from instr to student in no questions course" } } }, diff --git a/src/test/resources/data/GetCoursesActionTest.json b/src/test/resources/data/GetCoursesActionTest.json index feac1ef60ed..738c5531104 100644 --- a/src/test/resources/data/GetCoursesActionTest.json +++ b/src/test/resources/data/GetCoursesActionTest.json @@ -58,7 +58,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor 1", "email": "instr1@course1.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -82,7 +81,6 @@ "courseId": "idOfTypicalCourse2", "name": "Instructor 1", "email": "instr1@course1.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -106,7 +104,6 @@ "courseId": "idOfTypicalCourse3", "name": "Instructor 1", "email": "instr1@course1.tmt", - "isArchived": true, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -130,7 +127,6 @@ "courseId": "idOfTypicalCourse4", "name": "Instructor 1", "email": "instr1@course1.tmt", - "isArchived": true, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -154,7 +150,6 @@ "courseId": "idOfTypicalCourse5", "name": "Instructor 1", "email": "instr1@course1.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -201,15 +196,6 @@ "comments": "comment for student1InCourse3", "team": "Team 1.1", "section": "Section 1" - }, - "student1InArchivedCourse": { - "googleId": "idOfStudent1", - "email": "student1@gmail.tmt", - "course": "idOfTypicalCourse4", - "name": "student 1", - "comments": "", - "team": "Team 2.1", - "section": "None" } } } diff --git a/src/test/resources/data/GetFeedbackQuestionRecipientsActionTest.json b/src/test/resources/data/GetFeedbackQuestionRecipientsActionTest.json index 376404f7eca..84d52726feb 100644 --- a/src/test/resources/data/GetFeedbackQuestionRecipientsActionTest.json +++ b/src/test/resources/data/GetFeedbackQuestionRecipientsActionTest.json @@ -72,12 +72,6 @@ "email": "iwosc@yahoo.tmt", "readNotifications": {} }, - "instructorOfArchivedCourse": { - "googleId": "idOfInstructorOfArchivedCourse", - "name": "InstructorOfArchiveCourse name", - "email": "instructorOfArchiveCourse@archiveCourse.tmt", - "readNotifications": {} - }, "instructor1OfTestingSanitizationCourse": { "googleId": "idOfInstructor1OfTestingSanitizationCourse", "name": "Instructor", @@ -96,12 +90,6 @@ "email": "student2InCourse1@gmail.tmt", "readNotifications": {} }, - "student1InArchivedCourse": { - "googleId": "student1InArchivedCourse", - "name": "Student in Archived Course", - "email": "student1InCourse1@gmail.tmt", - "readNotifications": {} - }, "student1InTestingSanitizationCourse": { "googleId": "student1InTestingSanitizationCourse", "name": "Stud1", @@ -151,12 +139,6 @@ "institute": "TEAMMATES Test Institute 7", "timeZone": "Africa/Johannesburg" }, - "archivedCourse": { - "id": "idOfArchivedCourse", - "name": "Archived Course", - "institute": "TEAMMATES Test Institute 5", - "timeZone": "Africa/Johannesburg" - }, "unregisteredCourse": { "id": "idOfUnregisteredCourse", "name": "Unregistered Course", @@ -177,7 +159,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor1 Course1", "email": "instructor1@course1.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -201,7 +182,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor2 Course1", "email": "instructor2@course1.tmt", - "isArchived": false, "role": "Manager", "isDisplayedToStudents": true, "displayedName": "Manager", @@ -225,7 +205,6 @@ "courseId": "idOfTypicalCourse1", "name": "Helper Course1", "email": "helper@course1.tmt", - "isArchived": false, "role": "Custom", "isDisplayedToStudents": false, "displayedName": "Helper", @@ -248,7 +227,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor Not Yet Joined Course 1", "email": "instructorNotYetJoinedCourse1@email.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -272,7 +250,6 @@ "courseId": "idOfTypicalCourse2", "name": "Instructor1 Course2", "email": "instructor1@course2.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -296,7 +273,6 @@ "courseId": "idOfTypicalCourse2", "name": "Instructor2 Course2", "email": "instructor2@course2.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -320,7 +296,6 @@ "courseId": "idOfTypicalCourse3", "name": "Instructor1 Course3", "email": "instructor1@course3.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -344,7 +319,6 @@ "courseId": "idOfTypicalCourse3", "name": "Instructor2 Course3", "email": "instructor2@course3.tmt", - "isArchived": false, "role": "Custom", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -368,7 +342,6 @@ "courseId": "idOfTypicalCourse4", "name": "Instructor1 Course4", "email": "instructor1@course3.tmt", - "isArchived": false, "role": "Custom", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -392,7 +365,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor3 Course1", "email": "instructor3@course1.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -416,7 +388,6 @@ "courseId": "idOfTypicalCourse2", "name": "Instructor3 Course2", "email": "instructor3@course2.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -440,7 +411,6 @@ "courseId": "idOfCourseNoEvals", "name": "Instructor4 name", "email": "instructor4@courseNoEvals.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -464,7 +434,6 @@ "courseId": "idOfUnregisteredCourse", "name": "Instructor 5 of CourseNoRegister", "email": "instructor5@courseNoRegister.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -488,31 +457,6 @@ "courseId": "idOfSampleCourse-demo", "name": "Instructor With Only One Sample Course", "email": "iwosc@yahoo.tmt", - "isArchived": false, - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canViewStudentInSections": true, - "canSubmitSessionInSections": true, - "canModifySessionCommentsInSections": true, - "canModifyCourse": true, - "canViewSessionInSections": true, - "canModifySession": true, - "canModifyStudent": true, - "canModifyInstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructorOfArchivedCourse": { - "googleId": "idOfInstructorOfArchivedCourse", - "courseId": "idOfArchivedCourse", - "name": "InstructorOfArchiveCourse name", - "email": "instructorOfArchiveCourse@archiveCourse.tmt", - "isArchived": true, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -535,7 +479,6 @@ "courseId": "idOfSampleCourse-demo", "name": "Instructor Not Yet Joined Course", "email": "instructorNotYetJoined@email.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -559,7 +502,6 @@ "courseId": "idOfTestingSanitizationCourse", "name": "Instructor", "email": "instructor1@sanitization.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "inst'\"/>", @@ -670,15 +612,6 @@ "team": "Team 2", "section": "Section 2" }, - "student1InArchivedCourse": { - "googleId": "student1InArchivedCourse", - "email": "student1InArchivedCourse@gmail.tmt", - "course": "idOfArchivedCourse", - "name": "student1 In Course1", - "comments": "", - "team": "Team 2.1", - "section": "None" - }, "student1InTestingSanitizationCourse": { "googleId": "student1InTestingSanitizationCourse", "email": "normal@sanitization.tmt", @@ -828,29 +761,6 @@ "studentDeadlines": {}, "instructorDeadlines": {} }, - "archiveCourse.session1": { - "feedbackSessionName": "session without student questions", - "courseId": "idOfArchivedCourse", - "creatorEmail": "instructor1@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2013-01-20T23:00:00Z", - "startTime": "2013-02-20T23:00:00Z", - "endTime": "2026-04-28T23:00:00Z", - "sessionVisibleFromTime": "2013-02-20T23:00:00Z", - "resultsVisibleFromTime": "2026-04-29T23:00:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 5, - "sentOpeningSoonEmail": true, - "sentOpenedEmail": true, - "sentClosingSoonEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpenedEmailEnabled": true, - "isClosingSoonEmailEnabled": true, - "isPublishedEmailEnabled": true, - "studentDeadlines": {}, - "instructorDeadlines": {} - }, "session1InCourse2": { "feedbackSessionName": "Instructor feedback session", "courseId": "idOfTypicalCourse2", @@ -1316,27 +1226,6 @@ "RECEIVER" ] }, - "qn1InSessionInArchivedCourse": { - "feedbackSessionName": "session without student questions", - "courseId": "idOfArchivedCourse", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to students" - }, - "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 4, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, "qn1InSession1InCourse2": { "feedbackSessionName": "Instructor feedback session", "courseId": "idOfTypicalCourse2", diff --git a/src/test/resources/data/SqlFeedbackSessionResultsBundleTest.json b/src/test/resources/data/SqlFeedbackSessionResultsBundleTest.json index 473de92ad9f..dfb6c97719b 100644 --- a/src/test/resources/data/SqlFeedbackSessionResultsBundleTest.json +++ b/src/test/resources/data/SqlFeedbackSessionResultsBundleTest.json @@ -12,12 +12,6 @@ "name": "Instructor 2", "email": "instr2@teammates.tmt" }, - "instructorOfArchivedCourse": { - "id": "00000000-0000-4000-8000-000000000003", - "googleId": "instructorOfArchivedCourse", - "name": "Instructor Of Archived Course", - "email": "instructorOfArchivedCourse@archiveCourse.tmt" - }, "instructorOfUnregisteredCourse": { "id": "00000000-0000-4000-8000-000000000004", "googleId": "InstructorOfUnregisteredCourse", @@ -167,12 +161,6 @@ "institute": "TEAMMATES Test Institute 1", "timeZone": "Asia/Singapore" }, - "archivedCourse": { - "id": "archived-course", - "name": "Archived Course", - "institute": "TEAMMATES Test Institute 2", - "timeZone": "UTC" - }, "unregisteredCourse": { "id": "unregistered-course", "name": "Unregistered Course", @@ -323,35 +311,6 @@ "sessionLevel": {} } }, - "instructorOfArchivedCourse": { - "id": "00000000-0000-4000-8000-000000000503", - "account": { - "id": "00000000-0000-4000-8000-000000000003" - }, - "course": { - "id": "archived-course" - }, - "name": "Instructor Of Archived Course", - "email": "instructorOfArchivedCourse@archiveCourse.tmt", - "isArchived": true, - "role": "INSTRUCTOR_PERMISSION_ROLE_COOWNER", - "isDisplayedToStudents": true, - "displayName": "Instructor", - "privileges": { - "courseLevel": { - "canModifyCourse": true, - "canModifyInstructor": true, - "canModifySession": true, - "canModifyStudent": true, - "canViewStudentInSections": true, - "canViewSessionInSections": true, - "canSubmitSessionInSections": true, - "canModifySessionCommentsInSections": false - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, "instructorOfUnregisteredCourse": { "id": "00000000-0000-4000-8000-000000000504", "account": { @@ -362,7 +321,6 @@ }, "name": "Instructor Of Unregistered Course", "email": "instructorOfUnregisteredCourse@UnregisteredCourse.tmt", - "isArchived": false, "role": "INSTRUCTOR_PERMISSION_ROLE_COOWNER", "isDisplayedToStudents": true, "displayName": "Instructor", @@ -661,18 +619,6 @@ "email": "student3YetToJoinCourse4@teammates.tmt", "name": "student3YetToJoinCourse In Course4", "comments": "" - }, - "studentOfArchivedCourse": { - "id": "00000000-0000-4000-8000-000000000610", - "course": { - "id": "archived-course" - }, - "team": { - "id": "00000000-0000-4000-8000-000000000302" - }, - "email": "studentOfArchivedCourse@teammates.tmt", - "name": "Student In Archived Course", - "comments": "" } }, "feedbackSessions": { diff --git a/src/test/resources/data/typicalDataBundle.json b/src/test/resources/data/typicalDataBundle.json index f2bd623ece3..a33da9d7d84 100644 --- a/src/test/resources/data/typicalDataBundle.json +++ b/src/test/resources/data/typicalDataBundle.json @@ -77,10 +77,10 @@ "email": "iwosc@yahoo.tmt", "readNotifications": {} }, - "instructorOfArchivedCourse": { - "googleId": "idOfInstructorOfArchivedCourse", - "name": "InstructorOfArchiveCourse name", - "email": "instructorOfArchiveCourse@archiveCourse.tmt", + "instructorOfSingleInstructorCourse": { + "googleId": "idOfInstructorOfSingleInstructorCourse", + "name": "Instructor of Single Instructor Course", + "email": "instructorOfSingleInstructorCourse@singleInstructorCourse.tmt", "readNotifications": {} }, "instructor1OfTestingSanitizationCourse": { @@ -101,12 +101,6 @@ "email": "student2InCourse1@gmail.tmt", "readNotifications": {} }, - "student1InArchivedCourse": { - "googleId": "student1InArchivedCourse", - "name": "Student in Archived Course", - "email": "student1InCourse1@gmail.tmt", - "readNotifications": {} - }, "student1InTestingSanitizationCourse": { "googleId": "student1InTestingSanitizationCourse", "name": "Stud1", @@ -156,10 +150,10 @@ "institute": "TEAMMATES Test Institute 7", "timeZone": "UTC" }, - "archivedCourse": { - "id": "idOfArchivedCourse", - "name": "Archived Course", - "institute": "TEAMMATES Test Institute 5", + "singleInstructorCourse": { + "id": "idOfSingleInstructorCourse", + "name": "Single Instructor Course", + "institute": "TEAMMATES Test Institute 1", "timeZone": "UTC" }, "unregisteredCourse": { @@ -189,7 +183,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor1 Course1", "email": "instructor1@course1.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -213,7 +206,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor2 Course1", "email": "instructor2@course1.tmt", - "isArchived": false, "role": "Manager", "isDisplayedToStudents": true, "displayedName": "Manager", @@ -237,7 +229,6 @@ "courseId": "idOfTypicalCourse1", "name": "Helper Course1", "email": "helper@course1.tmt", - "isArchived": false, "role": "Custom", "isDisplayedToStudents": false, "displayedName": "Helper", @@ -260,7 +251,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor Not Yet Joined Course 1", "email": "instructorNotYetJoinedCourse1@email.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -284,7 +274,6 @@ "courseId": "idOfTypicalCourse2", "name": "Instructor1 Course2", "email": "instructor1@course2.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -308,7 +297,6 @@ "courseId": "idOfTypicalCourse2", "name": "Instructor2 Course2", "email": "instructor2@course2.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -332,7 +320,6 @@ "courseId": "idOfTypicalCourse3", "name": "Instructor1 Course3", "email": "instructor1@course3.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -356,7 +343,6 @@ "courseId": "idOfTypicalCourse3", "name": "Instructor2 Course3", "email": "instructor2@course3.tmt", - "isArchived": false, "role": "Custom", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -380,7 +366,6 @@ "courseId": "idOfTypicalCourse4", "name": "Instructor1 Course4", "email": "instructor1@course3.tmt", - "isArchived": false, "role": "Custom", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -404,7 +389,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor3 Course1", "email": "instructor3@course1.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -428,7 +412,6 @@ "courseId": "idOfTypicalCourse2", "name": "Instructor3 Course2", "email": "instructor3@course2.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -452,7 +435,6 @@ "courseId": "idOfCourseNoEvals", "name": "Instructor4 name", "email": "instructor4@courseNoEvals.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -476,7 +458,6 @@ "courseId": "idOfUnregisteredCourse", "name": "Instructor 5 of CourseNoRegister", "email": "instructor5@courseNoRegister.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -500,7 +481,6 @@ "courseId": "idOfSampleCourse-demo", "name": "Instructor With Only One Sample Course", "email": "iwosc@yahoo.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -519,12 +499,11 @@ "sessionLevel": {} } }, - "instructorOfArchivedCourse": { - "googleId": "idOfInstructorOfArchivedCourse", - "courseId": "idOfArchivedCourse", - "name": "InstructorOfArchiveCourse name", - "email": "instructorOfArchiveCourse@archiveCourse.tmt", - "isArchived": true, + "instructorOfSingleInstructorCourse": { + "googleId": "idOfInstructorOfSingleInstructorCourse", + "courseId": "idOfSingleInstructorCourse", + "name": "Instructor of Single Instructor Course", + "email": "instructorOfSingleInstructorCourse@singleInstructorCourse.tmt", "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -548,7 +527,6 @@ "courseId": "idOfTestingInstructorsDisplayedCourse", "name": "name1", "email": "instructorNotDisplayed@NotDisplayed.tmt", - "isArchived": true, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -572,7 +550,6 @@ "courseId": "idOfTestingInstructorsDisplayedCourse", "name": "name2", "email": "secondInstructorNotDisplayed@NotDisplayed.tmt", - "isArchived": true, "role": "Co-owner", "isDisplayedToStudents": false, "displayedName": "Instructor", @@ -595,7 +572,6 @@ "courseId": "idOfSampleCourse-demo", "name": "Instructor Not Yet Joined Course", "email": "instructorNotYetJoined@email.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -619,7 +595,6 @@ "courseId": "idOfTestingSanitizationCourse", "name": "Instructor", "email": "instructor1@sanitization.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "inst'\"/>", @@ -696,7 +671,7 @@ }, "student2InCourse2": { "googleId": "student2InCourse1", - "email": "student2InCourse1@gmail.tmt", + "email": "student2InCourse2@gmail.tmt", "course": "idOfTypicalCourse2", "name": "student2 In Course2", "comments": "#####This is the same student as student2InCourse1 but using different name and email #####", @@ -730,15 +705,6 @@ "team": "Team 2", "section": "Section 2" }, - "student1InArchivedCourse": { - "googleId": "student1InArchivedCourse", - "email": "student1InArchivedCourse@gmail.tmt", - "course": "idOfArchivedCourse", - "name": "student1 In Course1", - "comments": "", - "team": "Team 2.1", - "section": "None" - }, "student1InTestingSanitizationCourse": { "googleId": "student1InTestingSanitizationCourse", "email": "normal@sanitization.tmt", @@ -903,10 +869,10 @@ "studentDeadlines": {}, "instructorDeadlines": {} }, - "archiveCourse.session1": { - "feedbackSessionName": "session without student questions", - "courseId": "idOfArchivedCourse", - "creatorEmail": "instructor1@course1.tmt", + "noStudentQuestionsSessionInCourse2": { + "feedbackSessionName": "No Student Questions Session", + "courseId": "idOfTypicalCourse2", + "creatorEmail": "instructor2@course2.tmt", "instructions": "Please please fill in the following questions.", "createdTime": "2013-01-20T23:00:00Z", "startTime": "2013-02-20T23:00:00Z", @@ -917,25 +883,25 @@ "gracePeriod": 5, "sentOpeningSoonEmail": true, "sentOpenedEmail": true, - "sentClosingSoonEmail": true, - "sentClosedEmail": true, - "sentPublishedEmail": true, + "sentClosingSoonEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, "isOpenedEmailEnabled": true, "isClosingSoonEmailEnabled": true, "isPublishedEmailEnabled": true, "studentDeadlines": {}, "instructorDeadlines": {} }, - "archiveCourse.session2": { - "feedbackSessionName": "session without instructor questions", - "courseId": "idOfArchivedCourse", - "creatorEmail": "instructor1@course1.tmt", + "noInstructorQuestionsSessionInCourse2": { + "feedbackSessionName": "No Instructor Questions Session", + "courseId": "idOfTypicalCourse2", + "creatorEmail": "instructor2@course2.tmt", "instructions": "Please please fill in the following questions.", - "createdTime": "2013-01-20T23:00:00Z", - "startTime": "2013-02-20T23:00:00Z", - "endTime": "2026-04-28T23:00:00Z", - "sessionVisibleFromTime": "2013-02-20T23:00:00Z", - "resultsVisibleFromTime": "2026-04-29T23:00:00Z", + "createdTime": "2013-01-20T23:57:00Z", + "startTime": "2013-02-02T00:00:00Z", + "endTime": "2013-04-29T00:00:00Z", + "sessionVisibleFromTime": "2013-01-21T00:00:00Z", + "resultsVisibleFromTime": "2013-04-30T00:00:00Z", "timeZone": "Africa/Johannesburg", "gracePeriod": 5, "sentOpeningSoonEmail": true, @@ -1218,6 +1184,48 @@ "INSTRUCTORS" ] }, + "qn1InNoStudentQuestionSessionInCourse2": { + "feedbackSessionName": "No Student Questions Session", + "courseId": "idOfTypicalCourse2", + "questionDetails": { + "questionType": "TEXT", + "questionText": "Instructor only question" + }, + "questionNumber": 1, + "giverType": "INSTRUCTORS", + "recipientType": "STUDENTS_EXCLUDING_SELF", + "numberOfEntitiesToGiveFeedbackTo": 4, + "showResponsesTo": [ + "RECEIVER" + ], + "showGiverNameTo": [ + "RECEIVER" + ], + "showRecipientNameTo": [ + "RECEIVER" + ] + }, + "qn1InNoInstructorQuestionSessionInCourse2": { + "feedbackSessionName": "No Instructor Questions Session", + "courseId": "idOfTypicalCourse2", + "questionDetails": { + "questionType": "TEXT", + "questionText": "Student only question" + }, + "questionNumber": 2, + "giverType": "STUDENTS", + "recipientType": "STUDENTS_EXCLUDING_SELF", + "numberOfEntitiesToGiveFeedbackTo": 4, + "showResponsesTo": [ + "RECEIVER" + ], + "showGiverNameTo": [ + "RECEIVER" + ], + "showRecipientNameTo": [ + "RECEIVER" + ] + }, "team.feedback": { "feedbackSessionName": "Second feedback session", "courseId": "idOfTypicalCourse1", @@ -1386,48 +1394,6 @@ "RECEIVER" ] }, - "qn1InSessionInArchivedCourse": { - "feedbackSessionName": "session without student questions", - "courseId": "idOfArchivedCourse", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to students" - }, - "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "STUDENTS_EXCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": 4, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn1InSession2InArchivedCourse": { - "feedbackSessionName": "session without instructor questions", - "courseId": "idOfArchivedCourse", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to each other" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "STUDENTS_EXCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": 4, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, "qn1InSession1InCourse2": { "feedbackSessionName": "Instructor feedback session", "courseId": "idOfTypicalCourse2", @@ -1685,19 +1651,6 @@ "questionType": "TEXT", "answer": "Response from instr1InC2 to student1InC2." } - }, - "response1ForNVSQ1": { - "feedbackSessionName": "session without student questions", - "courseId": "idOfArchivedCourse", - "feedbackQuestionId": "1", - "giver": "instructorOfArchiveCourse@archiveCourse.tmt", - "recipient": "student1InArchivedCourse@gmail.tmt", - "giverSection": "None", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response from instructor to student" - } } }, "feedbackResponseComments": { @@ -1937,7 +1890,7 @@ "instructor5": { "name": "Instructor 5 of CourseNoRegister", "email": "instructor5@courseNoRegister.tmt", - "institute": "TEAMMATES Test Institute 1", + "institute": "TEAMMATES Test Institute 5", "createdAt": "2011-01-01T00:00:00Z", "registeredAt": "1970-02-14T00:00:00Z" }, @@ -1955,13 +1908,6 @@ "createdAt": "2011-01-01T00:00:00Z", "registeredAt": "1970-02-14T00:00:00Z" }, - "instructorOfArchivedCourse": { - "name": "InstructorOfArchiveCourse name", - "email": "instructorOfArchiveCourse@archiveCourse.tmt", - "institute": "TEAMMATES Test Institute 5", - "createdAt": "2011-01-01T00:00:00Z", - "registeredAt": "1970-02-14T00:00:00Z" - }, "instructor1OfTestingSanitizationCourse": { "name": "Instructor", "email": "instructor1@sanitization.tmt", From 877ec11450e025c431bca4b59fd85ed7d88e666e Mon Sep 17 00:00:00 2001 From: YongJunXi Date: Sun, 8 Feb 2026 14:16:35 +0800 Subject: [PATCH 02/23] Remove course archive from instructor-home-page --- .../instructor-home-page.component.html | 5 --- .../instructor-home-page.component.spec.ts | 33 +--------------- .../instructor-home-page.component.ts | 38 ------------------- 3 files changed, 1 insertion(+), 75 deletions(-) diff --git a/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.html b/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.html index a673dcb19a8..2cd8e251950 100644 --- a/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.html +++ b/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.html @@ -76,11 +76,6 @@

Home

- Archive - View / Edit diff --git a/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.spec.ts b/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.spec.ts index 3b2f6bfb949..f1f34edeaf8 100644 --- a/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.spec.ts +++ b/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.spec.ts @@ -10,7 +10,7 @@ import { FeedbackSessionsService } from '../../../services/feedback-sessions.ser import { SimpleModalService } from '../../../services/simple-modal.service'; import { createMockNgbModalRef } from '../../../test-helpers/mock-ngb-modal-ref'; import { - Course, CourseArchive, Courses, + Course, Courses, FeedbackSession, FeedbackSessionPublishStatus, FeedbackSessions, @@ -182,37 +182,6 @@ describe('InstructorHomePageComponent', () => { expect(component.courseTabModels[0].isTabExpanded).toBeTruthy(); }); - it('should archive the entire course from the instructor', () => { - const courseArchive: CourseArchive = { - courseId: 'CS1231', - isArchived: true, - }; - - component.courseTabModels = activeCourseTabModels; - component.hasCoursesLoaded = true; - fixture.detectChanges(); - - expect(component.courseTabModels.length).toEqual(2); - expect(component.courseTabModels[0].course.courseId).toEqual('CS1231'); - expect(component.courseTabModels[0].course.courseName).toEqual('Discrete Structures'); - - jest.spyOn(simpleModalService, 'openConfirmationModal').mockImplementation( - () => createMockNgbModalRef({ - header: 'mock header', content: 'mock content', type: SimpleModalType.INFO, - }), - ); - jest.spyOn(courseService, 'changeArchiveStatus').mockReturnValue(of(courseArchive)); - - const courseButton: any = fixture.debugElement.nativeElement.querySelector('.btn-course'); - courseButton.click(); - const archiveButton: any = document.querySelector('body > div > div > .btn-archive-course'); - archiveButton.click(); - - expect(component.courseTabModels.length).toEqual(1); - expect(component.courseTabModels[0].course.courseId).toEqual('CS3281'); - expect(component.courseTabModels[0].course.courseName).toEqual('Thematic Systems I'); - }); - it('should delete the entire course from the instructor', () => { const courseToDelete: Course = testCourse1; diff --git a/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.ts b/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.ts index 06b979547b7..3564a960713 100644 --- a/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.ts +++ b/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.ts @@ -24,7 +24,6 @@ import { TableComparatorService } from '../../../services/table-comparator.servi import { TimezoneService } from '../../../services/timezone.service'; import { Course, - CourseArchive, Courses, FeedbackSession, FeedbackSessions, @@ -279,34 +278,6 @@ export class InstructorHomePageComponent extends InstructorSessionModalPageCompo }); } - /** - * Archives the entire course from the instructor - */ - archiveCourse(courseId: string): void { - const modalContent: string = - 'This action can be reverted by going to the "Courses" tab and unarchiving the desired course(s).'; - - const modalRef: NgbModalRef = - this.simpleModalService.openConfirmationModal( - `Archive course ${courseId}?`, SimpleModalType.INFO, modalContent); - modalRef.result.then(() => { - this.courseService.changeArchiveStatus(courseId, { - archiveStatus: true, - }).subscribe({ - next: (courseArchive: CourseArchive) => { - this.courseTabModels = this.courseTabModels.filter((model: CourseTabModel) => { - return model.course.courseId !== courseId; - }); - this.statusMessageService.showSuccessToast(`The course ${courseArchive.courseId} has been archived. ` - + 'You can retrieve it from the Courses page.'); - }, - error: (resp: ErrorMessageOutput) => { - this.statusMessageService.showErrorToast(resp.error.message); - }, - }); - }, () => {}); - } - /** * Deletes the entire course from the instructor */ @@ -357,15 +328,6 @@ export class InstructorHomePageComponent extends InstructorSessionModalPageCompo this.statusMessageService.showErrorToast(resp.error.message); }, }); - this.courseService.getAllCoursesAsInstructor('archived').subscribe({ - next: (resp: Courses) => { - this.allCoursesList.push(...resp.courses); - }, - error: (resp: ErrorMessageOutput) => { - this.hasCoursesLoadingFailed = true; - this.statusMessageService.showErrorToast(resp.error.message); - }, - }); this.courseService.getAllCoursesAsInstructor('softDeleted').subscribe({ next: (resp: Courses) => { this.allCoursesList.push(...resp.courses); From d587be89a7224a0fac86806ed36ae6bf1d48a69f Mon Sep 17 00:00:00 2001 From: YongJunXi Date: Sun, 8 Feb 2026 14:29:24 +0800 Subject: [PATCH 03/23] Remove from course service --- src/web/services/course.service.spec.ts | 19 +------------------ src/web/services/course.service.ts | 18 ++---------------- 2 files changed, 3 insertions(+), 34 deletions(-) diff --git a/src/web/services/course.service.spec.ts b/src/web/services/course.service.spec.ts index 89c55fccb7a..4460da5d6ed 100644 --- a/src/web/services/course.service.spec.ts +++ b/src/web/services/course.service.spec.ts @@ -5,7 +5,7 @@ import { CourseService } from './course.service'; import { HttpRequestService } from './http-request.service'; import createSpyFromClass from '../test-helpers/create-spy-from-class'; import { ResourceEndpoints } from '../types/api-const'; -import { CourseArchiveRequest, CourseCreateRequest, CourseUpdateRequest } from '../types/api-request'; +import { CourseCreateRequest, CourseUpdateRequest } from '../types/api-request'; describe('CourseService', () => { let spyHttpRequestService: any; @@ -82,14 +82,8 @@ describe('CourseService', () => { entitytype: 'instructor', user: googleId, }; - const archivedCoursesParamMap: { [key: string]: string } = { - coursestatus: 'archived', - entitytype: 'instructor', - user: googleId, - }; service.getInstructorCoursesInMasqueradeMode(googleId); expect(spyHttpRequestService.get).toHaveBeenCalledWith(ResourceEndpoints.COURSES, activeCoursesParamMap); - expect(spyHttpRequestService.get).toHaveBeenCalledWith(ResourceEndpoints.COURSES, archivedCoursesParamMap); }); it('should execute GET when getting all active instructor courses', () => { @@ -132,17 +126,6 @@ describe('CourseService', () => { expect(spyHttpRequestService.delete).toHaveBeenCalledWith(ResourceEndpoints.COURSE, paramMap); }); - it('should execute PUT to archive course', () => { - const courseid: string = 'test-id'; - const request: CourseArchiveRequest = { - archiveStatus: true, - }; - const paramMap: { [key: string]: string } = { courseid }; - service.changeArchiveStatus(courseid, request); - expect(spyHttpRequestService.put) - .toHaveBeenCalledWith(ResourceEndpoints.COURSE_ARCHIVE, paramMap, request); - }); - it('should execute PUT to bin course', () => { const courseid: string = 'test-id'; const paramMap: { [key: string]: string } = { courseid }; diff --git a/src/web/services/course.service.ts b/src/web/services/course.service.ts index 676a112f557..d91879fe789 100644 --- a/src/web/services/course.service.ts +++ b/src/web/services/course.service.ts @@ -3,8 +3,8 @@ import { forkJoin, Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { HttpRequestService } from './http-request.service'; import { ResourceEndpoints } from '../types/api-const'; -import { Course, CourseArchive, Courses, HasResponses, JoinStatus, MessageOutput, Student } from '../types/api-output'; -import { CourseArchiveRequest, CourseCreateRequest, CourseUpdateRequest } from '../types/api-request'; +import { Course, Courses, HasResponses, JoinStatus, MessageOutput, Student } from '../types/api-output'; +import { CourseCreateRequest, CourseUpdateRequest } from '../types/api-request'; /** * The statistics of a course @@ -95,15 +95,9 @@ export class CourseService { entitytype: 'instructor', user: googleId, }; - const archivedCoursesParamMap: Record = { - coursestatus: 'archived', - entitytype: 'instructor', - user: googleId, - }; return forkJoin([ this.httpRequestService.get(ResourceEndpoints.COURSES, activeCoursesParamMap), - this.httpRequestService.get(ResourceEndpoints.COURSES, archivedCoursesParamMap), ]).pipe( map((vals: Courses[]) => { return { @@ -149,14 +143,6 @@ export class CourseService { return this.httpRequestService.delete(ResourceEndpoints.COURSE, paramMap); } - /** - * Changes the archive status of a course by calling API. - */ - changeArchiveStatus(courseid: string, request: CourseArchiveRequest): Observable { - const paramMap: Record = { courseid }; - return this.httpRequestService.put(ResourceEndpoints.COURSE_ARCHIVE, paramMap, request); - } - /** * Bin (soft-delete) a course by calling API. */ From 53f862d8e32b71b86ee262e2715177bfa67f4f96 Mon Sep 17 00:00:00 2001 From: YongJunXi Date: Sun, 8 Feb 2026 14:29:39 +0800 Subject: [PATCH 04/23] Remove from instructor-courses-page --- .../instructor-courses-page.component.html | 102 -------------- .../instructor-courses-page.component.scss | 16 --- .../instructor-courses-page.component.spec.ts | 109 ++------------- .../instructor-courses-page.component.ts | 130 +----------------- 4 files changed, 14 insertions(+), 343 deletions(-) diff --git a/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.html b/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.html index 30d21974689..25a48d49e39 100644 --- a/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.html +++ b/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.html @@ -160,12 +160,6 @@

Active courses

[disabled]="isCopyingCourse"> Copy - View Logs @@ -203,102 +197,6 @@

Active courses

-
-

- Archived courses -

-
- - - -
-
- Archive -
- -
-
-
- - - - - - - - - - - - - - - - - -
- - - - - - Action(s)
{{course.course.courseId}}{{course.course.courseName}} - {{course.course.creationTimestamp - | date:'d MMM yyyy'}} - - - - -
-
-
-
-
-

diff --git a/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.scss b/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.scss index c7dd2110045..3d7bd786971 100644 --- a/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.scss +++ b/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.scss @@ -6,14 +6,6 @@ } } -// applies only to mobile screens -@media (width <= 768px) { - .custom-button-archived { - width: 95px; - margin-bottom: 5px; - } -} - .sortable-header { cursor: pointer; @@ -79,14 +71,6 @@ margin-bottom: 0; } -.archive-body { - padding: 0; -} - -.archive-table { - margin-bottom: 0; -} - .margin-top-30px { margin-top: 30px; } diff --git a/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.spec.ts b/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.spec.ts index 50b2b986586..67d0396e197 100644 --- a/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.spec.ts +++ b/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.spec.ts @@ -11,7 +11,7 @@ import { SimpleModalService } from '../../../services/simple-modal.service'; import { StudentService } from '../../../services/student.service'; import { TimezoneService } from '../../../services/timezone.service'; import { createMockNgbModalRef } from '../../../test-helpers/mock-ngb-modal-ref'; -import { Course, CourseArchive, Courses, JoinState, Students } from '../../../types/api-output'; +import { Course, Courses, JoinState, Students } from '../../../types/api-output'; describe('InstructorCoursesPageComponent', () => { let component: InstructorCoursesPageComponent; @@ -53,29 +53,6 @@ describe('InstructorCoursesPageComponent', () => { }, ]; - const archivedCoursesSnap: any[] = [ - { - course: { - courseId: 'CS2104', - courseName: 'Can modify archived', - timeZone: 'UTC', - creationTimestamp: date3.getTime(), - deletionTimestamp: 0, - }, - canModifyCourse: true, - }, - { - course: { - courseId: 'CS2106', - courseName: 'Cannot modify archived', - timeZone: 'UTC', - creationTimestamp: date3.getTime(), - deletionTimestamp: 0, - }, - canModifyCourse: false, - }, - ]; - const deletedCoursesSnap: any[] = [ { course: { @@ -287,31 +264,26 @@ describe('InstructorCoursesPageComponent', () => { const courseSpy: SpyInstance = jest.spyOn(courseService, 'getAllCoursesAsInstructor').mockImplementation( (courseStatus: string): Observable => { if (courseStatus === 'active') { - return of({ courses: [courseCS1231] }); - } - if (courseStatus === 'archived') { - return of({ courses: [courseCS3281, courseCS3282] }); + return of({ courses: [courseCS1231, courseCS3281, courseCS3282] }); } + // softDeleted return of({ courses: [courseST4234] }); }); component.loadInstructorCourses(); - expect(courseSpy).toHaveBeenCalledTimes(3); + expect(courseSpy).toHaveBeenCalledTimes(2); expect(courseSpy).toHaveBeenNthCalledWith(1, 'active'); - expect(courseSpy).toHaveBeenNthCalledWith(2, 'archived'); - expect(courseSpy).toHaveBeenNthCalledWith(3, 'softDeleted'); + expect(courseSpy).toHaveBeenNthCalledWith(2, 'softDeleted'); - expect(component.activeCourses.length).toEqual(1); + expect(component.activeCourses.length).toEqual(3); expect(component.activeCourses[0].course.courseId).toEqual('CS1231'); expect(component.activeCourses[0].course.courseName).toEqual('Discrete Structures'); - - expect(component.archivedCourses.length).toEqual(2); - expect(component.archivedCourses[0].course.courseId).toEqual('CS3282'); - expect(component.archivedCourses[0].course.courseName).toEqual('Thematic Systems Project II'); - expect(component.archivedCourses[1].course.courseId).toEqual('CS3281'); - expect(component.archivedCourses[1].course.courseName).toEqual('Thematic Systems Project I'); + expect(component.activeCourses[1].course.courseId).toEqual('CS3281'); + expect(component.activeCourses[1].course.courseName).toEqual('Thematic Systems Project I'); + expect(component.activeCourses[2].course.courseId).toEqual('CS3282'); + expect(component.activeCourses[2].course.courseName).toEqual('Thematic Systems Project II'); expect(component.softDeletedCourses.length).toEqual(1); expect(component.softDeletedCourses[0].course.courseId).toEqual('ST4234'); @@ -332,42 +304,6 @@ describe('InstructorCoursesPageComponent', () => { expect(component.courseStats['CS1231']['unregistered']).toEqual(1); }); - it('should archive an active course', () => { - const courseArchiveCS1231: CourseArchive = { - courseId: 'CS1231', - isArchived: true, - }; - component.activeCourses = [courseModelCS1231]; - const courseSpy: SpyInstance = jest.spyOn(courseService, 'changeArchiveStatus') - .mockReturnValue(of(courseArchiveCS1231)); - component.changeArchiveStatus('CS1231', true); - - expect(courseSpy).toHaveBeenCalledTimes(1); - expect(courseSpy).toHaveBeenLastCalledWith('CS1231', { archiveStatus: true }); - - expect(component.activeCourses.length).toEqual(0); - expect(component.archivedCourses.length).toEqual(1); - expect(component.archivedCourses[0].course.courseId).toEqual('CS1231'); - }); - - it('should unarchive an archived course', () => { - const courseArchiveCS1231: CourseArchive = { - courseId: 'CS1231', - isArchived: false, - }; - component.archivedCourses = [courseModelCS1231]; - const courseSpy: SpyInstance = jest.spyOn(courseService, 'changeArchiveStatus') - .mockReturnValue(of(courseArchiveCS1231)); - component.changeArchiveStatus('CS1231', false); - - expect(courseSpy).toHaveBeenCalledTimes(1); - expect(courseSpy).toHaveBeenNthCalledWith(1, 'CS1231', { archiveStatus: false }); - - expect(component.archivedCourses.length).toEqual(0); - expect(component.activeCourses.length).toEqual(1); - expect(component.activeCourses[0].course.courseId).toEqual('CS1231'); - }); - it('should restore a soft deleted course', () => { component.softDeletedCourses = [courseModelCS1231]; expect(component.softDeletedCourses.length).toEqual(1); @@ -382,7 +318,6 @@ describe('InstructorCoursesPageComponent', () => { expect(courseSpy).toHaveBeenCalledTimes(1); expect(courseSpy).toHaveBeenNthCalledWith(1, 'CS1231'); - expect(component.archivedCourses.length).toEqual(0); expect(component.softDeletedCourses.length).toEqual(0); }); @@ -402,7 +337,7 @@ describe('InstructorCoursesPageComponent', () => { }); it('should permanently delete a course', async () => { - component.archivedCourses = [courseModelCS1231]; + component.softDeletedCourses = [courseModelCS1231]; const courseSpy: SpyInstance = jest.spyOn(courseService, 'deleteCourse') .mockReturnValue(of({ message: 'Message' })); jest.spyOn(simpleModalService, 'openConfirmationModal').mockReturnValue( @@ -420,7 +355,6 @@ describe('InstructorCoursesPageComponent', () => { it('should show add course form and disable button when clicking on add new course', () => { component.activeCourses = [courseModelCS3282]; component.isLoadingActiveCourses = false; - component.isLoadingArchivedCourses = false; component.isLoadingSoftDeletedCourses = false; fixture.detectChanges(); @@ -453,17 +387,6 @@ describe('InstructorCoursesPageComponent', () => { expect(button.className).toContain('disabled'); }); - it('should disable delete button when instructor cannot modify archived course', () => { - component.archivedCourses = [courseModelST4234]; - component.isLoadingArchivedCourses = false; - component.isArchivedCourseExpanded = true; - fixture.detectChanges(); - - const button: any = fixture.debugElement.nativeElement.querySelector('#btn-soft-delete-archived-disabled-0'); - expect(button.textContent).toEqual(' Delete '); - expect(button.className).toContain('disabled'); - }); - it('should disable restore and permanently delete buttons when instructor cannot modify deleted course', () => { component.softDeletedCourses = [courseModelST4234]; component.isLoadingSoftDeletedCourses = false; @@ -524,7 +447,6 @@ describe('InstructorCoursesPageComponent', () => { it('should snap with all courses in course stats', () => { component.activeCourses = activeCoursesSnap; - component.archivedCourses = archivedCoursesSnap; component.softDeletedCourses = deletedCoursesSnap; component.courseStats = courseStatsSnap; component.isLoadingActiveCourses = false; @@ -534,7 +456,6 @@ describe('InstructorCoursesPageComponent', () => { it('should snap when it is undeletable and unrestorable', () => { component.activeCourses = activeCoursesSnap; - component.archivedCourses = archivedCoursesSnap; component.softDeletedCourses = deletedCoursesSnap; component.courseStats = courseStatsSnap; component.canDeleteAll = false; @@ -560,7 +481,6 @@ describe('InstructorCoursesPageComponent', () => { it('should snap when new course form is expanded', () => { component.isAddNewCourseFormExpanded = true; component.isLoadingActiveCourses = false; - component.isLoadingArchivedCourses = false; component.isLoadingSoftDeletedCourses = false; // Mock the timezone service to prevent unexpected changes in time zones over time, such as daylight savings time const timezones: Record = { @@ -573,11 +493,4 @@ describe('InstructorCoursesPageComponent', () => { fixture.detectChanges(); expect(fixture).toMatchSnapshot(); }); - - it('should snap when archived courses are expanded', () => { - component.archivedCourses = archivedCoursesSnap; - component.isArchivedCourseExpanded = true; - fixture.detectChanges(); - expect(fixture).toMatchSnapshot(); - }); }); diff --git a/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.ts b/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.ts index 120b8f79f7d..fc4d035e056 100644 --- a/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.ts +++ b/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.ts @@ -22,7 +22,6 @@ import { TableComparatorService } from '../../../services/table-comparator.servi import { TimezoneService } from '../../../services/timezone.service'; import { Course, - CourseArchive, Courses, FeedbackSession, FeedbackSessions, @@ -92,7 +91,6 @@ interface CourseModel { export class InstructorCoursesPageComponent implements OnInit { activeCourses: CourseModel[] = []; - archivedCourses: CourseModel[] = []; softDeletedCourses: CourseModel[] = []; allCoursesList: Course[] = []; activeCoursesList: Course[] = []; @@ -102,8 +100,6 @@ export class InstructorCoursesPageComponent implements OnInit { activeTableSortOrder: SortOrder = SortOrder.ASC; activeTableSortBy: SortBy = SortBy.COURSE_CREATION_DATE; - archivedTableSortOrder: SortOrder = SortOrder.ASC; - archivedTableSortBy: SortBy = SortBy.COURSE_NAME; deletedTableSortOrder: SortOrder = SortOrder.ASC; deletedTableSortBy: SortBy = SortBy.COURSE_NAME; @@ -113,14 +109,12 @@ export class InstructorCoursesPageComponent implements OnInit { CourseEditFormMode: typeof CourseEditFormMode = CourseEditFormMode; isLoadingActiveCourses: boolean = false; - isLoadingArchivedCourses: boolean = false; isLoadingSoftDeletedCourses: boolean = false; hasLoadingFailed: boolean = false; isRecycleBinExpanded: boolean = false; canDeleteAll: boolean = true; canRestoreAll: boolean = true; isAddNewCourseFormExpanded: boolean = false; - isArchivedCourseExpanded: boolean = false; isCopyingCourse: boolean = false; copyProgressPercentage: number = 0; @@ -130,7 +124,7 @@ export class InstructorCoursesPageComponent implements OnInit { modifiedSessions: Record = {}; get isLoadingCourses(): boolean { - return this.isLoadingActiveCourses || this.isLoadingArchivedCourses || this.isLoadingSoftDeletedCourses; + return this.isLoadingActiveCourses || this.isLoadingSoftDeletedCourses; } @Output() courseAdded: EventEmitter = new EventEmitter(); @@ -168,10 +162,8 @@ export class InstructorCoursesPageComponent implements OnInit { loadInstructorCourses(): void { this.hasLoadingFailed = false; this.isLoadingActiveCourses = true; - this.isLoadingArchivedCourses = true; this.isLoadingSoftDeletedCourses = true; this.activeCourses = []; - this.archivedCourses = []; this.softDeletedCourses = []; this.activeCoursesList = []; this.allCoursesList = []; @@ -202,32 +194,6 @@ export class InstructorCoursesPageComponent implements OnInit { }, }); - this.courseService.getAllCoursesAsInstructor('archived').subscribe({ - next: (resp: Courses) => { - for (const course of resp.courses) { - this.allCoursesList.push(course); - let canModifyCourse: boolean = false; - let canModifyStudent: boolean = false; - if (course.privileges) { - canModifyCourse = course.privileges.canModifyCourse; - canModifyStudent = course.privileges.canModifyStudent; - } - const isLoadingCourseStats: boolean = false; - const archivedCourse: CourseModel = { - course, canModifyCourse, canModifyStudent, isLoadingCourseStats, - }; - this.archivedCourses.push(archivedCourse); - this.archivedCoursesDefaultSort(); - } - this.isLoadingArchivedCourses = false; - }, - error: (resp: ErrorMessageOutput) => { - this.isLoadingArchivedCourses = false; - this.hasLoadingFailed = true; - this.statusMessageService.showErrorToast(resp.error.message); - }, - }); - this.courseService.getAllCoursesAsInstructor('softDeleted').subscribe({ next: (resp: Courses) => { for (const course of resp.courses) { @@ -293,61 +259,6 @@ export class InstructorCoursesPageComponent implements OnInit { }); } - /** - * Changes the status of an archived course. - */ - changeArchiveStatus(courseId: string, toArchive: boolean): void { - if (!courseId) { - this.statusMessageService.showErrorToast(`Course ${courseId} is not found!`); - return; - } - this.courseService.changeArchiveStatus(courseId, { - archiveStatus: toArchive, - }).subscribe({ - next: (courseArchive: CourseArchive) => { - if (courseArchive.isArchived) { - this.changeModelFromActiveToArchived(courseId); - this.statusMessageService.showSuccessToast(`The course ${courseId} has been archived. ` - + 'It will not appear on the home page anymore.'); - } else { - this.changeModelFromArchivedToActive(courseId); - this.statusMessageService.showSuccessToast('The course has been unarchived.'); - } - }, - error: (resp: ErrorMessageOutput) => { - this.statusMessageService.showErrorToast(resp.error.message); - }, - }); - } - - /** - * Moves a course model from active courses list to archived list. - * This is to reduce the need to refresh the entire list of courses multiple times. - */ - changeModelFromActiveToArchived(courseId: string): void { - const courseToBeRemoved: CourseModel | undefined = this.findCourse(this.activeCourses, courseId); - this.activeCourses = this.removeCourse(this.activeCourses, courseId); - this.activeCoursesList = this.activeCourses.map((courseModel: CourseModel) => courseModel.course); - if (courseToBeRemoved !== undefined) { - this.archivedCourses.push(courseToBeRemoved); - this.archivedCourses.sort(this.sortBy(this.archivedTableSortBy, this.archivedTableSortOrder)); - } - } - - /** - * Moves a course model from archived courses list to active list. - * This is to reduce the need to refresh the entire list of courses multiple times. - */ - changeModelFromArchivedToActive(courseId: string): void { - const courseToBeRemoved: CourseModel | undefined = this.findCourse(this.archivedCourses, courseId); - this.archivedCourses = this.removeCourse(this.archivedCourses, courseId); - if (courseToBeRemoved !== undefined) { - this.activeCourses.push(courseToBeRemoved); - this.activeCoursesList = this.activeCourses.map((courseModel: CourseModel) => courseModel.course); - this.activeCourses.sort(this.sortBy(this.activeTableSortBy, this.activeTableSortOrder)); - } - } - /** * Creates new course */ @@ -651,7 +562,7 @@ export class InstructorCoursesPageComponent implements OnInit { } /** - * Moves an active/archived course to Recycle Bin. + * Moves an active course to Recycle Bin. */ onDelete(courseId: string): Promise { if (!courseId) { @@ -676,7 +587,7 @@ export class InstructorCoursesPageComponent implements OnInit { } /** - * Moves an active/archived course to Recycle Bin. + * Moves an active course to Recycle Bin. * This is to reduce the need to refresh the entire list of courses multiple times. */ moveCourseToRecycleBin(courseId: string, deletionTimeStamp: number): void { @@ -687,14 +598,6 @@ export class InstructorCoursesPageComponent implements OnInit { activeCourseToBeRemoved.course.deletionTimestamp = deletionTimeStamp; this.softDeletedCourses.push(activeCourseToBeRemoved); this.softDeletedCourses.sort(this.sortBy(this.deletedTableSortBy, this.deletedTableSortOrder)); - } else { - const archivedCourseToBeRemoved: CourseModel | undefined = this.findCourse(this.archivedCourses, courseId); - this.archivedCourses = this.removeCourse(this.archivedCourses, courseId); - if (archivedCourseToBeRemoved !== undefined) { - archivedCourseToBeRemoved.course.deletionTimestamp = deletionTimeStamp; - this.softDeletedCourses.push(archivedCourseToBeRemoved); - this.softDeletedCourses.sort(this.sortBy(this.deletedTableSortBy, this.deletedTableSortOrder)); - } } } @@ -809,7 +712,6 @@ export class InstructorCoursesPageComponent implements OnInit { this.softDeletedCourses = []; this.allCoursesList = []; this.allCoursesList.push(...this.activeCourses.map((courseModel: CourseModel) => courseModel.course)); - this.allCoursesList.push(...this.archivedCourses.map((courseModel: CourseModel) => courseModel.course)); this.statusMessageService.showSuccessToast('All courses have been permanently deleted.'); }, error: (resp: ErrorMessageOutput) => { @@ -865,32 +767,6 @@ export class InstructorCoursesPageComponent implements OnInit { this.activeCourses.sort(this.sortBy(this.activeTableSortBy, this.activeTableSortOrder)); } - /** - * Sorts the archived courses table - */ - sortArchivedCoursesEvent(by: SortBy): void { - this.archivedTableSortOrder = this.archivedTableSortBy === by && this.archivedTableSortOrder === SortOrder.ASC - ? SortOrder.DESC : SortOrder.ASC; - this.archivedTableSortBy = by; - this.archivedCourses.sort(this.sortBy(by, this.archivedTableSortOrder)); - } - - getAriaSortArchived(by: SortBy): string { - if (by !== this.archivedTableSortBy) { - return 'none'; - } - return this.archivedTableSortOrder === SortOrder.ASC ? 'ascending' : 'descending'; - } - - /** - * Archived courses default sort on page load - */ - archivedCoursesDefaultSort(): void { - this.archivedTableSortBy = SortBy.COURSE_CREATION_DATE; - this.archivedTableSortOrder = SortOrder.DESC; - this.archivedCourses.sort(this.sortBy(this.archivedTableSortBy, this.archivedTableSortOrder)); - } - /** * Sorts the soft-deleted courses table */ From 10b49052a922e7073d41873651821f71af1b1992 Mon Sep 17 00:00:00 2001 From: YongJunXi Date: Sun, 8 Feb 2026 14:31:11 +0800 Subject: [PATCH 05/23] Remove from instructor-help-course-section component --- .../courses-section-questions.ts | 15 ------ ...ructor-help-courses-section.component.html | 48 ------------------- ...structor-help-courses-section.component.ts | 3 -- 3 files changed, 66 deletions(-) diff --git a/src/web/app/pages-help/instructor-help-page/instructor-help-courses-section/courses-section-questions.ts b/src/web/app/pages-help/instructor-help-page/instructor-help-courses-section/courses-section-questions.ts index 334298bd23c..985d2ba832e 100644 --- a/src/web/app/pages-help/instructor-help-page/instructor-help-courses-section/courses-section-questions.ts +++ b/src/web/app/pages-help/instructor-help-page/instructor-help-courses-section/courses-section-questions.ts @@ -67,21 +67,6 @@ export enum CoursesSectionQuestions { */ DEL_STUDENTS = 'del-students', - /** - * How do I archive a course? - */ - COURSE_ARCHIVE = 'course-archive', - - /** - * How do I view courses I have archived? - */ - COURSE_VIEW_ARCHIVED = 'course-view-archived', - - /** - * How do I unarchive an archived course? - */ - COURSE_UNARCHIVE = 'course-unarchive', - /** * How do I view courses I have deleted? */ diff --git a/src/web/app/pages-help/instructor-help-page/instructor-help-courses-section/instructor-help-courses-section.component.html b/src/web/app/pages-help/instructor-help-page/instructor-help-courses-section/instructor-help-courses-section.component.html index b321cd0d0c2..3b4aff0baa1 100644 --- a/src/web/app/pages-help/instructor-help-page/instructor-help-courses-section/instructor-help-courses-section.component.html +++ b/src/web/app/pages-help/instructor-help-page/instructor-help-courses-section/instructor-help-courses-section.component.html @@ -253,54 +253,6 @@

Managing Courses

-

Archiving Courses

- - -

- When a course has ended, you can archive it so that it doesn't appear in your home page. Course, student and session details of an archived course are still stored on TEAMMATES. However, you cannot edit, create feedback sessions for or enroll students in an archived course. -

-

- In your Home page, you will see panels for each course and a table of feedback sessions inside it.
- Click on the button on the card heading of the course you want to archive.
- Then select Archive in the drop-down menu and click Yes to confirm. -

-

- You can also archive a course from the Courses page.
- Under 'Active Courses', click on the button in the row corresponding to the course you want to archive.
- Then select Archive in the drop-down menu. -

-
- - -

- You can view all your archived courses by navigating to the Courses page.
- Scroll to the Archived courses heading. -

-

- The courses you have previously archived are listed here. - In order to access information in an archived course, unarchive the course. -

- - - -

- To unarchive a course, first view the course that you would like to unarchive in the Courses page.
- Then, click on the button corresponding to the course you want to unarchive. -

-
-

Restoring Deleted Courses

Date: Sun, 8 Feb 2026 14:33:27 +0800 Subject: [PATCH 06/23] Remove from instructor-sessions-page component --- .../instructor-sessions-page.component.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.html b/src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.html index 7c8108b8250..bc3d5a0fa36 100644 --- a/src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.html +++ b/src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.html @@ -1,7 +1,7 @@
@@ -56,9 +56,8 @@

- Note: The table above doesn't contain sessions from archived courses and courses in recycle bin. - To view sessions from an archived course, unarchive the course first; to view sessions from a course in recycle - bin, restore the course first. + Note: The table above doesn't contain sessions from courses in recycle bin. + To view sessions from a course in recycle bin, restore the course first.

From f912b47dfd56705c9b82d2647177aa667abd93e3 Mon Sep 17 00:00:00 2001 From: YongJunXi Date: Sun, 8 Feb 2026 14:36:36 +0800 Subject: [PATCH 07/23] Remove from copy-instructors-from-other-courses-modal --- .../copy-instructors-from-other-courses-modal-model.ts | 1 - ...opy-instructors-from-other-courses-modal.component.html | 7 +++---- ...-instructors-from-other-courses-modal.component.spec.ts | 3 --- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/web/app/pages-instructor/instructor-course-edit-page/copy-instructors-from-other-courses-modal/copy-instructors-from-other-courses-modal-model.ts b/src/web/app/pages-instructor/instructor-course-edit-page/copy-instructors-from-other-courses-modal/copy-instructors-from-other-courses-modal-model.ts index 39fcfe14509..9ab666a854b 100644 --- a/src/web/app/pages-instructor/instructor-course-edit-page/copy-instructors-from-other-courses-modal/copy-instructors-from-other-courses-modal-model.ts +++ b/src/web/app/pages-instructor/instructor-course-edit-page/copy-instructors-from-other-courses-modal/copy-instructors-from-other-courses-modal-model.ts @@ -8,7 +8,6 @@ export interface CourseTabModel { courseId: string; courseName: string; creationTimestamp: number; - isArchived: boolean; instructorCandidates: InstructorToCopyCandidateModel[]; instructorCandidatesSortBy: SortBy; diff --git a/src/web/app/pages-instructor/instructor-course-edit-page/copy-instructors-from-other-courses-modal/copy-instructors-from-other-courses-modal.component.html b/src/web/app/pages-instructor/instructor-course-edit-page/copy-instructors-from-other-courses-modal/copy-instructors-from-other-courses-modal.component.html index 859b119450a..5bbc8193d29 100644 --- a/src/web/app/pages-instructor/instructor-course-edit-page/copy-instructors-from-other-courses-modal/copy-instructors-from-other-courses-modal.component.html +++ b/src/web/app/pages-instructor/instructor-course-edit-page/copy-instructors-from-other-courses-modal/copy-instructors-from-other-courses-modal.component.html @@ -13,9 +13,8 @@
-
- [{{course.courseId}}]: {{course.courseName}} - [{{course.courseId}}] (Archived): {{course.courseName}} +
+ [{{course.courseId}}]: {{course.courseName}}
@@ -27,7 +26,7 @@
- +
# diff --git a/src/web/app/pages-instructor/instructor-course-edit-page/copy-instructors-from-other-courses-modal/copy-instructors-from-other-courses-modal.component.spec.ts b/src/web/app/pages-instructor/instructor-course-edit-page/copy-instructors-from-other-courses-modal/copy-instructors-from-other-courses-modal.component.spec.ts index 1dbeac14733..c39990a7f8c 100644 --- a/src/web/app/pages-instructor/instructor-course-edit-page/copy-instructors-from-other-courses-modal/copy-instructors-from-other-courses-modal.component.spec.ts +++ b/src/web/app/pages-instructor/instructor-course-edit-page/copy-instructors-from-other-courses-modal/copy-instructors-from-other-courses-modal.component.spec.ts @@ -91,7 +91,6 @@ describe('CopyInstructorsFromOtherCoursesModalComponent', () => { courseId: 'FAN0002', courseName: 'Test Course 1', creationTimestamp: new Date('2022-07-26T01:00:15Z').getTime(), - isArchived: true, instructorCandidates: [], instructorCandidatesSortBy: SortBy.NONE, instructorCandidatesSortOrder: SortOrder.ASC, @@ -104,7 +103,6 @@ describe('CopyInstructorsFromOtherCoursesModalComponent', () => { courseId: 'FAN0001', courseName: 'Test Course 2', creationTimestamp: new Date('2022-02-22T22:22:22Z').getTime(), - isArchived: false, instructorCandidates: [], instructorCandidatesSortBy: SortBy.NONE, instructorCandidatesSortOrder: SortOrder.ASC, @@ -117,7 +115,6 @@ describe('CopyInstructorsFromOtherCoursesModalComponent', () => { courseId: 'CS2103T', courseName: 'XXX Software Engineering', creationTimestamp: new Date('2022-06-21T07:51:20Z').getTime(), - isArchived: false, instructorCandidates: [], instructorCandidatesSortBy: SortBy.NONE, instructorCandidatesSortOrder: SortOrder.ASC, From 0ef5734c51b7f45b05e25e1e1a0703261ac40219 Mon Sep 17 00:00:00 2001 From: YongJunXi Date: Sun, 8 Feb 2026 14:38:01 +0800 Subject: [PATCH 08/23] Remove from instructor-course-edit-page component --- .../instructor-course-edit-page.component.ts | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/src/web/app/pages-instructor/instructor-course-edit-page/instructor-course-edit-page.component.ts b/src/web/app/pages-instructor/instructor-course-edit-page/instructor-course-edit-page.component.ts index ee3e54d5722..6c1f7070949 100644 --- a/src/web/app/pages-instructor/instructor-course-edit-page/instructor-course-edit-page.component.ts +++ b/src/web/app/pages-instructor/instructor-course-edit-page/instructor-course-edit-page.component.ts @@ -693,11 +693,9 @@ export class InstructorCourseEditPageComponent implements OnInit { forkJoin([ this.courseService.getAllCoursesAsInstructor('active'), - this.courseService.getAllCoursesAsInstructor('archived'), ]).subscribe({ next: (values: Courses[]) => { const activeCourses: Courses = values[0]; - const archivedCourses: Courses = values[1]; activeCourses.courses.forEach((course: Course) => { if (course.courseId !== this.courseId && course.institute === this.courseFormModel.course.institute) { @@ -705,24 +703,6 @@ export class InstructorCourseEditPageComponent implements OnInit { courseId: course.courseId, courseName: course.courseName, creationTimestamp: course.creationTimestamp, - isArchived: false, - instructorCandidates: [], - instructorCandidatesSortBy: SortBy.NONE, - instructorCandidatesSortOrder: SortOrder.ASC, - hasInstructorsLoaded: false, - isTabExpanded: false, - hasLoadingFailed: false, - }; - courseTabModels.push(model); - } - }); - archivedCourses.courses.forEach((course: Course) => { - if (course.courseId !== this.courseId && course.institute === this.courseFormModel.course.institute) { - const model: CourseTabModel = { - courseId: course.courseId, - courseName: course.courseName, - creationTimestamp: course.creationTimestamp, - isArchived: true, instructorCandidates: [], instructorCandidatesSortBy: SortBy.NONE, instructorCandidatesSortOrder: SortOrder.ASC, From 340f26c2a4f391891477d7cc84b96c7d724c7c0c Mon Sep 17 00:00:00 2001 From: YongJunXi Date: Sun, 8 Feb 2026 14:39:24 +0800 Subject: [PATCH 09/23] Remove from session-edit-form component --- .../session-edit-form/session-edit-form.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/web/app/components/session-edit-form/session-edit-form.component.html b/src/web/app/components/session-edit-form/session-edit-form.component.html index 5b6ed920747..aa5b517ca53 100644 --- a/src/web/app/components/session-edit-form/session-edit-form.component.html +++ b/src/web/app/components/session-edit-form/session-edit-form.component.html @@ -55,7 +55,7 @@
Or
- There is no un-archived course. + There is no course.
{{ model.courseId }}
@@ -346,7 +346,7 @@
Or
-

You need to have an active(unarchived) course to create a session!

+

You need to have an active course to create a session!

From eec093c08fab79ef398b4b0c1ce521eb5dd9a91a Mon Sep 17 00:00:00 2001 From: YongJunXi Date: Sun, 8 Feb 2026 15:33:39 +0800 Subject: [PATCH 11/23] Update snapshots and pass tests --- .../client/scripts/sql/typicalDataBundle.json | 177 ------------ src/main/appengine/index.yaml | 2 - ...other-courses-modal.component.spec.ts.snap | 18 +- ...ructor-courses-page.component.spec.ts.snap | 273 +----------------- .../instructor-courses-page.component.spec.ts | 8 +- ...nstructor-home-page.component.spec.ts.snap | 40 --- ...uctor-sessions-page.component.spec.ts.snap | 18 +- 7 files changed, 23 insertions(+), 513 deletions(-) diff --git a/src/client/java/teammates/client/scripts/sql/typicalDataBundle.json b/src/client/java/teammates/client/scripts/sql/typicalDataBundle.json index 36b86ad1774..025e508ea7e 100644 --- a/src/client/java/teammates/client/scripts/sql/typicalDataBundle.json +++ b/src/client/java/teammates/client/scripts/sql/typicalDataBundle.json @@ -77,12 +77,6 @@ "email": "iwosc@yahoo.tmt", "readNotifications": {} }, - "instructorOfArchivedCourse": { - "googleId": "idOfInstructorOfArchivedCourse", - "name": "InstructorOfArchiveCourse name", - "email": "instructorOfArchiveCourse@archiveCourse.tmt", - "readNotifications": {} - }, "instructor1OfTestingSanitizationCourse": { "googleId": "idOfInstructor1OfTestingSanitizationCourse", "name": "Instructor", @@ -101,12 +95,6 @@ "email": "student2InCourse1@gmail.tmt", "readNotifications": {} }, - "student1InArchivedCourse": { - "googleId": "student1InArchivedCourse", - "name": "Student in Archived Course", - "email": "student1InCourse1@gmail.tmt", - "readNotifications": {} - }, "student1InTestingSanitizationCourse": { "googleId": "student1InTestingSanitizationCourse", "name": "Stud1", @@ -156,12 +144,6 @@ "institute": "TEAMMATES Test Institute 7", "timeZone": "UTC" }, - "archivedCourse": { - "id": "idOfArchivedCourse", - "name": "Archived Course", - "institute": "TEAMMATES Test Institute 5", - "timeZone": "UTC" - }, "unregisteredCourse": { "id": "idOfUnregisteredCourse", "name": "Unregistered Course", @@ -189,7 +171,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor1 Course1", "email": "instructor1@course1.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -213,7 +194,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor2 Course1", "email": "instructor2@course1.tmt", - "isArchived": false, "role": "Manager", "isDisplayedToStudents": true, "displayedName": "Manager", @@ -237,7 +217,6 @@ "courseId": "idOfTypicalCourse1", "name": "Helper Course1", "email": "helper@course1.tmt", - "isArchived": false, "role": "Custom", "isDisplayedToStudents": false, "displayedName": "Helper", @@ -260,7 +239,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor Not Yet Joined Course 1", "email": "instructorNotYetJoinedCourse1@email.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -284,7 +262,6 @@ "courseId": "idOfTypicalCourse2", "name": "Instructor1 Course2", "email": "instructor1@course2.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -308,7 +285,6 @@ "courseId": "idOfTypicalCourse2", "name": "Instructor2 Course2", "email": "instructor2@course2.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -332,7 +308,6 @@ "courseId": "idOfTypicalCourse3", "name": "Instructor1 Course3", "email": "instructor1@course3.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -356,7 +331,6 @@ "courseId": "idOfTypicalCourse3", "name": "Instructor2 Course3", "email": "instructor2@course3.tmt", - "isArchived": false, "role": "Custom", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -380,7 +354,6 @@ "courseId": "idOfTypicalCourse4", "name": "Instructor1 Course4", "email": "instructor1@course3.tmt", - "isArchived": false, "role": "Custom", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -404,7 +377,6 @@ "courseId": "idOfTypicalCourse1", "name": "Instructor3 Course1", "email": "instructor3@course1.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -428,7 +400,6 @@ "courseId": "idOfTypicalCourse2", "name": "Instructor3 Course2", "email": "instructor3@course2.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -452,7 +423,6 @@ "courseId": "idOfCourseNoEvals", "name": "Instructor4 name", "email": "instructor4@courseNoEvals.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -476,7 +446,6 @@ "courseId": "idOfUnregisteredCourse", "name": "Instructor 5 of CourseNoRegister", "email": "instructor5@courseNoRegister.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -500,31 +469,6 @@ "courseId": "idOfSampleCourse-demo", "name": "Instructor With Only One Sample Course", "email": "iwosc@yahoo.tmt", - "isArchived": false, - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canViewStudentInSections": true, - "canSubmitSessionInSections": true, - "canModifySessionCommentsInSections": true, - "canModifyCourse": true, - "canViewSessionInSections": true, - "canModifySession": true, - "canModifyStudent": true, - "canModifyInstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructorOfArchivedCourse": { - "googleId": "idOfInstructorOfArchivedCourse", - "courseId": "idOfArchivedCourse", - "name": "InstructorOfArchiveCourse name", - "email": "instructorOfArchiveCourse@archiveCourse.tmt", - "isArchived": true, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -548,7 +492,6 @@ "courseId": "idOfTestingInstructorsDisplayedCourse", "name": "name1", "email": "instructorNotDisplayed@NotDisplayed.tmt", - "isArchived": true, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -572,7 +515,6 @@ "courseId": "idOfTestingInstructorsDisplayedCourse", "name": "name2", "email": "secondInstructorNotDisplayed@NotDisplayed.tmt", - "isArchived": true, "role": "Co-owner", "isDisplayedToStudents": false, "displayedName": "Instructor", @@ -595,7 +537,6 @@ "courseId": "idOfSampleCourse-demo", "name": "Instructor Not Yet Joined Course", "email": "instructorNotYetJoined@email.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -619,7 +560,6 @@ "courseId": "idOfTestingSanitizationCourse", "name": "Instructor", "email": "instructor1@sanitization.tmt", - "isArchived": false, "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "inst'\"/>", @@ -730,15 +670,6 @@ "team": "Team 2", "section": "Section 2" }, - "student1InArchivedCourse": { - "googleId": "student1InArchivedCourse", - "email": "student1InArchivedCourse@gmail.tmt", - "course": "idOfArchivedCourse", - "name": "student1 In Course1", - "comments": "", - "team": "Team 2.1", - "section": "None" - }, "student1InTestingSanitizationCourse": { "googleId": "student1InTestingSanitizationCourse", "email": "normal@sanitization.tmt", @@ -903,52 +834,6 @@ "studentDeadlines": {}, "instructorDeadlines": {} }, - "archiveCourse.session1": { - "feedbackSessionName": "session without student questions", - "courseId": "idOfArchivedCourse", - "creatorEmail": "instructor1@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2013-01-20T23:00:00Z", - "startTime": "2013-02-20T23:00:00Z", - "endTime": "2026-04-28T23:00:00Z", - "sessionVisibleFromTime": "2013-02-20T23:00:00Z", - "resultsVisibleFromTime": "2026-04-29T23:00:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 5, - "sentOpeningSoonEmail": true, - "sentOpenedEmail": true, - "sentClosingSoonEmail": true, - "sentClosedEmail": true, - "sentPublishedEmail": true, - "isOpenedEmailEnabled": true, - "isClosingSoonEmailEnabled": true, - "isPublishedEmailEnabled": true, - "studentDeadlines": {}, - "instructorDeadlines": {} - }, - "archiveCourse.session2": { - "feedbackSessionName": "session without instructor questions", - "courseId": "idOfArchivedCourse", - "creatorEmail": "instructor1@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2013-01-20T23:00:00Z", - "startTime": "2013-02-20T23:00:00Z", - "endTime": "2026-04-28T23:00:00Z", - "sessionVisibleFromTime": "2013-02-20T23:00:00Z", - "resultsVisibleFromTime": "2026-04-29T23:00:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 5, - "sentOpeningSoonEmail": true, - "sentOpenedEmail": true, - "sentClosingSoonEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpenedEmailEnabled": true, - "isClosingSoonEmailEnabled": true, - "isPublishedEmailEnabled": true, - "studentDeadlines": {}, - "instructorDeadlines": {} - }, "session1InCourse2": { "feedbackSessionName": "Instructor feedback session", "courseId": "idOfTypicalCourse2", @@ -1386,48 +1271,6 @@ "RECEIVER" ] }, - "qn1InSessionInArchivedCourse": { - "feedbackSessionName": "session without student questions", - "courseId": "idOfArchivedCourse", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to students" - }, - "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "STUDENTS_EXCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": 4, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn1InSession2InArchivedCourse": { - "feedbackSessionName": "session without instructor questions", - "courseId": "idOfArchivedCourse", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to each other" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "STUDENTS_EXCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": 4, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, "qn1InSession1InCourse2": { "feedbackSessionName": "Instructor feedback session", "courseId": "idOfTypicalCourse2", @@ -1685,19 +1528,6 @@ "questionType": "TEXT", "answer": "Response from instr1InC2 to student1InC2." } - }, - "response1ForNVSQ1": { - "feedbackSessionName": "session without student questions", - "courseId": "idOfArchivedCourse", - "feedbackQuestionId": "1", - "giver": "instructorOfArchiveCourse@archiveCourse.tmt", - "recipient": "student1InArchivedCourse@gmail.tmt", - "giverSection": "None", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response from instructor to student" - } } }, "feedbackResponseComments": { @@ -1955,13 +1785,6 @@ "createdAt": "2011-01-01T00:00:00Z", "registeredAt": "1970-02-14T00:00:00Z" }, - "instructorOfArchivedCourse": { - "name": "InstructorOfArchiveCourse name", - "email": "instructorOfArchiveCourse@archiveCourse.tmt", - "institute": "TEAMMATES Test Institute 5", - "createdAt": "2011-01-01T00:00:00Z", - "registeredAt": "1970-02-14T00:00:00Z" - }, "instructor1OfTestingSanitizationCourse": { "name": "Instructor", "email": "instructor1@sanitization.tmt", diff --git a/src/main/appengine/index.yaml b/src/main/appengine/index.yaml index b0be0e13275..c1b804ba461 100644 --- a/src/main/appengine/index.yaml +++ b/src/main/appengine/index.yaml @@ -17,8 +17,6 @@ indexes: properties: - direction: asc name: googleId - - direction: asc - name: isArchived - kind: FeedbackSession properties: - direction: asc diff --git a/src/web/app/pages-instructor/instructor-course-edit-page/copy-instructors-from-other-courses-modal/__snapshots__/copy-instructors-from-other-courses-modal.component.spec.ts.snap b/src/web/app/pages-instructor/instructor-course-edit-page/copy-instructors-from-other-courses-modal/__snapshots__/copy-instructors-from-other-courses-modal.component.spec.ts.snap index 30435916202..089badd9bf8 100644 --- a/src/web/app/pages-instructor/instructor-course-edit-page/copy-instructors-from-other-courses-modal/__snapshots__/copy-instructors-from-other-courses-modal.component.spec.ts.snap +++ b/src/web/app/pages-instructor/instructor-course-edit-page/copy-instructors-from-other-courses-modal/__snapshots__/copy-instructors-from-other-courses-modal.component.spec.ts.snap @@ -70,12 +70,12 @@ exports[`CopyInstructorsFromOtherCoursesModalComponent should snap when feedback class="card" >

- [FAN0002] (Archived): Test Course 1 + [FAN0002]: Test Course 1
- [FAN0002] (Archived): Test Course 1 + [FAN0002]: Test Course 1
@@ -475,12 +475,12 @@ exports[`CopyInstructorsFromOtherCoursesModalComponent should snap when instruct class="card" >
- [FAN0002] (Archived): Test Course 1 + [FAN0002]: Test Course 1
- [FAN0002] (Archived): Test Course 1 + [FAN0002]: Test Course 1
-

-

- -
-
-
- Loading... -
-
- -
-

-

- -
-
-
- Loading... -
-
- -
Copy -
-

-

- -
-
-
- Loading... -
-
- -
-

-

-
- -
-
Copy -
-

-

- -
-
-
- Loading... -
-
- -
-

-

- -
-
-
- Loading... -
-
- -
Copy -
-

-

- -
-
-
- Loading... -
-
- -
{ expect(component.activeCourses.length).toEqual(3); expect(component.activeCourses[0].course.courseId).toEqual('CS1231'); expect(component.activeCourses[0].course.courseName).toEqual('Discrete Structures'); - expect(component.activeCourses[1].course.courseId).toEqual('CS3281'); - expect(component.activeCourses[1].course.courseName).toEqual('Thematic Systems Project I'); - expect(component.activeCourses[2].course.courseId).toEqual('CS3282'); - expect(component.activeCourses[2].course.courseName).toEqual('Thematic Systems Project II'); + expect(component.activeCourses[1].course.courseId).toEqual('CS3282'); + expect(component.activeCourses[1].course.courseName).toEqual('Thematic Systems Project II'); + expect(component.activeCourses[2].course.courseId).toEqual('CS3281'); + expect(component.activeCourses[2].course.courseName).toEqual('Thematic Systems Project I'); expect(component.softDeletedCourses.length).toEqual(1); expect(component.softDeletedCourses[0].course.courseId).toEqual('ST4234'); diff --git a/src/web/app/pages-instructor/instructor-home-page/__snapshots__/instructor-home-page.component.spec.ts.snap b/src/web/app/pages-instructor/instructor-home-page/__snapshots__/instructor-home-page.component.spec.ts.snap index a5ec0a38c2b..1c4781fcbea 100644 --- a/src/web/app/pages-instructor/instructor-home-page/__snapshots__/instructor-home-page.component.spec.ts.snap +++ b/src/web/app/pages-instructor/instructor-home-page/__snapshots__/instructor-home-page.component.spec.ts.snap @@ -514,14 +514,6 @@ exports[`InstructorHomePageComponent should snap with one course with one feedba class="dropdown-menu" ngbdropdownmenu="" > - - Archive - - - Archive - - - Archive - - - Archive - - - Archive -

- Note: The table above doesn't contain sessions from archived courses and courses in recycle bin. To view sessions from an archived course, unarchive the course first; to view sessions from a course in recycle bin, restore the course first. + Note: The table above doesn't contain sessions from courses in recycle bin. To view sessions from a course in recycle bin, restore the course first.

@@ -205,7 +205,7 @@ exports[`InstructorSessionsPageComponent should snap when feedback sessions are class="col-12 text-muted" >

- Note: The table above doesn't contain sessions from archived courses and courses in recycle bin. To view sessions from an archived course, unarchive the course first; to view sessions from a course in recycle bin, restore the course first. + Note: The table above doesn't contain sessions from courses in recycle bin. To view sessions from a course in recycle bin, restore the course first.

@@ -377,7 +377,7 @@ exports[`InstructorSessionsPageComponent should snap when new session form is ex > here - to create or unarchive a course. + to create a course.
@@ -1201,7 +1201,7 @@ exports[`InstructorSessionsPageComponent should snap when new session form is ex class="text-danger margin-top-20px" > - You need to have an active(unarchived) course to create a session! + You need to have an active course to create a session!

@@ -1243,7 +1243,7 @@ exports[`InstructorSessionsPageComponent should snap when new session form is ex class="col-12 text-muted" >

- Note: The table above doesn't contain sessions from archived courses and courses in recycle bin. To view sessions from an archived course, unarchive the course first; to view sessions from a course in recycle bin, restore the course first. + Note: The table above doesn't contain sessions from courses in recycle bin. To view sessions from a course in recycle bin, restore the course first.

@@ -1359,7 +1359,7 @@ exports[`InstructorSessionsPageComponent should snap when recycle bin section is class="col-12 text-muted" >

- Note: The table above doesn't contain sessions from archived courses and courses in recycle bin. To view sessions from an archived course, unarchive the course first; to view sessions from a course in recycle bin, restore the course first. + Note: The table above doesn't contain sessions from courses in recycle bin. To view sessions from a course in recycle bin, restore the course first.

@@ -1475,7 +1475,7 @@ exports[`InstructorSessionsPageComponent should snap with active sessions 1`] = class="col-12 text-muted" >

- Note: The table above doesn't contain sessions from archived courses and courses in recycle bin. To view sessions from an archived course, unarchive the course first; to view sessions from a course in recycle bin, restore the course first. + Note: The table above doesn't contain sessions from courses in recycle bin. To view sessions from a course in recycle bin, restore the course first.

@@ -1591,7 +1591,7 @@ exports[`InstructorSessionsPageComponent should snap with default fields 1`] = ` class="col-12 text-muted" >

- Note: The table above doesn't contain sessions from archived courses and courses in recycle bin. To view sessions from an archived course, unarchive the course first; to view sessions from a course in recycle bin, restore the course first. + Note: The table above doesn't contain sessions from courses in recycle bin. To view sessions from a course in recycle bin, restore the course first.

From 81f299fe79d98c8d711c2b062744277a0083f788 Mon Sep 17 00:00:00 2001 From: YongJunXi Date: Sun, 8 Feb 2026 15:53:12 +0800 Subject: [PATCH 12/23] Remove obsolete snapshot --- ...ructor-courses-page.component.spec.ts.snap | 112 ------------------ 1 file changed, 112 deletions(-) diff --git a/src/web/app/pages-instructor/instructor-courses-page/__snapshots__/instructor-courses-page.component.spec.ts.snap b/src/web/app/pages-instructor/instructor-courses-page/__snapshots__/instructor-courses-page.component.spec.ts.snap index 362a7c99932..6461615651c 100644 --- a/src/web/app/pages-instructor/instructor-courses-page/__snapshots__/instructor-courses-page.component.spec.ts.snap +++ b/src/web/app/pages-instructor/instructor-courses-page/__snapshots__/instructor-courses-page.component.spec.ts.snap @@ -1,117 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`InstructorCoursesPageComponent should snap when courses are expanded 1`] = ` - -
- -
-
-

- Active courses -

- -
-
-
- Loading... -
-
- -
-
-
-

-

- -
-
-
- Loading... -
-
- -
-
- -`; - exports[`InstructorCoursesPageComponent should snap when courses are still loading 1`] = ` Date: Sun, 8 Feb 2026 16:40:14 +0800 Subject: [PATCH 13/23] Wait for table visibility --- src/e2e/java/teammates/e2e/pageobjects/AdminAccountsPage.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/e2e/java/teammates/e2e/pageobjects/AdminAccountsPage.java b/src/e2e/java/teammates/e2e/pageobjects/AdminAccountsPage.java index c9788057fd8..26fff16c8f8 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/AdminAccountsPage.java +++ b/src/e2e/java/teammates/e2e/pageobjects/AdminAccountsPage.java @@ -50,6 +50,7 @@ public void verifyAccountDetails(AccountData account) { } public void clickRemoveInstructorFromCourse(String courseId) { + waitForElementVisibility(instructorTable); List instructorRows = instructorTable.findElement(By.tagName("tbody")).findElements(By.tagName("tr")); @@ -69,6 +70,7 @@ public void clickRemoveInstructorFromCourse(String courseId) { } public void clickRemoveStudentFromCourse(String courseId) { + waitForElementVisibility(studentTable); List studentRows = studentTable.findElement(By.tagName("tbody")).findElements(By.tagName("tr")); From a14a0cb819319db0d929ddcc3a5f92a01f47acb8 Mon Sep 17 00:00:00 2001 From: YongJunXi Date: Mon, 9 Feb 2026 12:56:32 +0800 Subject: [PATCH 14/23] Wait for page to load --- src/e2e/java/teammates/e2e/pageobjects/AdminAccountsPage.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/e2e/java/teammates/e2e/pageobjects/AdminAccountsPage.java b/src/e2e/java/teammates/e2e/pageobjects/AdminAccountsPage.java index 26fff16c8f8..1e146812b92 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/AdminAccountsPage.java +++ b/src/e2e/java/teammates/e2e/pageobjects/AdminAccountsPage.java @@ -50,6 +50,7 @@ public void verifyAccountDetails(AccountData account) { } public void clickRemoveInstructorFromCourse(String courseId) { + waitForPageToLoad(); waitForElementVisibility(instructorTable); List instructorRows = instructorTable.findElement(By.tagName("tbody")).findElements(By.tagName("tr")); @@ -70,6 +71,7 @@ public void clickRemoveInstructorFromCourse(String courseId) { } public void clickRemoveStudentFromCourse(String courseId) { + waitForPageToLoad(); waitForElementVisibility(studentTable); List studentRows = studentTable.findElement(By.tagName("tbody")).findElements(By.tagName("tr")); From 6f1a4d8629293115b7a0c532396bb82ef6d1b6ad Mon Sep 17 00:00:00 2001 From: YongJunXi Date: Mon, 9 Feb 2026 13:06:30 +0800 Subject: [PATCH 15/23] Wait for table and contents to load --- src/e2e/java/teammates/e2e/pageobjects/AdminAccountsPage.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/e2e/java/teammates/e2e/pageobjects/AdminAccountsPage.java b/src/e2e/java/teammates/e2e/pageobjects/AdminAccountsPage.java index 1e146812b92..660caea66e1 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/AdminAccountsPage.java +++ b/src/e2e/java/teammates/e2e/pageobjects/AdminAccountsPage.java @@ -52,6 +52,8 @@ public void verifyAccountDetails(AccountData account) { public void clickRemoveInstructorFromCourse(String courseId) { waitForPageToLoad(); waitForElementVisibility(instructorTable); + // Wait for table to be populated with data + waitForElementVisibility(By.cssSelector("#instructor-table tbody tr")); List instructorRows = instructorTable.findElement(By.tagName("tbody")).findElements(By.tagName("tr")); @@ -73,6 +75,8 @@ public void clickRemoveInstructorFromCourse(String courseId) { public void clickRemoveStudentFromCourse(String courseId) { waitForPageToLoad(); waitForElementVisibility(studentTable); + // Wait for table to be populated with data + waitForElementVisibility(By.cssSelector("#student-table tbody tr")); List studentRows = studentTable.findElement(By.tagName("tbody")).findElements(By.tagName("tr")); From 4882b3d025be6512e03b6e1f72586b01994309db Mon Sep 17 00:00:00 2001 From: YongJunXi Date: Mon, 9 Feb 2026 13:31:26 +0800 Subject: [PATCH 16/23] Revert wait and fix bug in course service --- .../e2e/cases/sql/AdminAccountsPageE2ETest.java | 7 +++++++ .../e2e/pageobjects/AdminAccountsPage.java | 8 -------- src/web/services/course.service.ts | 13 ++----------- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/e2e/java/teammates/e2e/cases/sql/AdminAccountsPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/sql/AdminAccountsPageE2ETest.java index 12c37afe75f..23dae806f8d 100644 --- a/src/e2e/java/teammates/e2e/cases/sql/AdminAccountsPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/sql/AdminAccountsPageE2ETest.java @@ -1,5 +1,6 @@ package teammates.e2e.cases.sql; +import org.testng.annotations.AfterClass; import org.testng.annotations.Test; import teammates.common.util.AppUrl; @@ -65,4 +66,10 @@ public void testAll() { verifyAbsentInDatabase(student2); verifyAbsentInDatabase(student3); } + + @AfterClass + public void classTeardown() { + // Restore test data that was deleted during the test to avoid affecting other tests + removeAndRestoreDataBundle(loadSqlDataBundle("/AdminAccountsPageE2ETestSql.json")); + } } diff --git a/src/e2e/java/teammates/e2e/pageobjects/AdminAccountsPage.java b/src/e2e/java/teammates/e2e/pageobjects/AdminAccountsPage.java index 660caea66e1..c9788057fd8 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/AdminAccountsPage.java +++ b/src/e2e/java/teammates/e2e/pageobjects/AdminAccountsPage.java @@ -50,10 +50,6 @@ public void verifyAccountDetails(AccountData account) { } public void clickRemoveInstructorFromCourse(String courseId) { - waitForPageToLoad(); - waitForElementVisibility(instructorTable); - // Wait for table to be populated with data - waitForElementVisibility(By.cssSelector("#instructor-table tbody tr")); List instructorRows = instructorTable.findElement(By.tagName("tbody")).findElements(By.tagName("tr")); @@ -73,10 +69,6 @@ public void clickRemoveInstructorFromCourse(String courseId) { } public void clickRemoveStudentFromCourse(String courseId) { - waitForPageToLoad(); - waitForElementVisibility(studentTable); - // Wait for table to be populated with data - waitForElementVisibility(By.cssSelector("#student-table tbody tr")); List studentRows = studentTable.findElement(By.tagName("tbody")).findElements(By.tagName("tr")); diff --git a/src/web/services/course.service.ts b/src/web/services/course.service.ts index d91879fe789..bde8496dc9d 100644 --- a/src/web/services/course.service.ts +++ b/src/web/services/course.service.ts @@ -1,6 +1,5 @@ import { Injectable } from '@angular/core'; -import { forkJoin, Observable } from 'rxjs'; -import { map } from 'rxjs/operators'; +import { Observable } from 'rxjs'; import { HttpRequestService } from './http-request.service'; import { ResourceEndpoints } from '../types/api-const'; import { Course, Courses, HasResponses, JoinStatus, MessageOutput, Student } from '../types/api-output'; @@ -96,15 +95,7 @@ export class CourseService { user: googleId, }; - return forkJoin([ - this.httpRequestService.get(ResourceEndpoints.COURSES, activeCoursesParamMap), - ]).pipe( - map((vals: Courses[]) => { - return { - courses: vals[0].courses.concat(vals[1].courses), - }; - }), - ); + return this.httpRequestService.get(ResourceEndpoints.COURSES, activeCoursesParamMap); } /** From e8e00f784abb53003ca29b7e2689df62918ffb6a Mon Sep 17 00:00:00 2001 From: YongJunXi Date: Mon, 9 Feb 2026 17:45:45 +0800 Subject: [PATCH 17/23] Revert class teardown --- .../e2e/cases/sql/AdminAccountsPageE2ETest.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/e2e/java/teammates/e2e/cases/sql/AdminAccountsPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/sql/AdminAccountsPageE2ETest.java index 23dae806f8d..dd4bdae7d5a 100644 --- a/src/e2e/java/teammates/e2e/cases/sql/AdminAccountsPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/sql/AdminAccountsPageE2ETest.java @@ -1,6 +1,5 @@ package teammates.e2e.cases.sql; -import org.testng.annotations.AfterClass; import org.testng.annotations.Test; import teammates.common.util.AppUrl; @@ -65,11 +64,4 @@ public void testAll() { // student entities should be deleted verifyAbsentInDatabase(student2); verifyAbsentInDatabase(student3); - } - - @AfterClass - public void classTeardown() { - // Restore test data that was deleted during the test to avoid affecting other tests - removeAndRestoreDataBundle(loadSqlDataBundle("/AdminAccountsPageE2ETestSql.json")); - } -} + }} From d12cb9070df03c43efbb52af62d93894a37bf557 Mon Sep 17 00:00:00 2001 From: YongJunXi Date: Mon, 9 Feb 2026 17:52:20 +0800 Subject: [PATCH 18/23] Fix checkstyle --- .../java/teammates/e2e/cases/sql/AdminAccountsPageE2ETest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/e2e/java/teammates/e2e/cases/sql/AdminAccountsPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/sql/AdminAccountsPageE2ETest.java index dd4bdae7d5a..12c37afe75f 100644 --- a/src/e2e/java/teammates/e2e/cases/sql/AdminAccountsPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/sql/AdminAccountsPageE2ETest.java @@ -64,4 +64,5 @@ public void testAll() { // student entities should be deleted verifyAbsentInDatabase(student2); verifyAbsentInDatabase(student3); - }} + } +} From 5f70b2225d44ac6ca08ed40a83ff6a99f1d1f9fd Mon Sep 17 00:00:00 2001 From: YongJunXi Date: Wed, 11 Feb 2026 19:35:14 +0800 Subject: [PATCH 19/23] Remove archival from Instructor, attributes and delete migration file --- ...ationForInstructorNullIsArchivedField.java | 46 ------------------- .../attributes/InstructorAttributes.java | 23 +--------- .../teammates/storage/entity/Instructor.java | 17 +------ 3 files changed, 3 insertions(+), 83 deletions(-) delete mode 100644 src/client/java/teammates/client/scripts/DataMigrationForInstructorNullIsArchivedField.java diff --git a/src/client/java/teammates/client/scripts/DataMigrationForInstructorNullIsArchivedField.java b/src/client/java/teammates/client/scripts/DataMigrationForInstructorNullIsArchivedField.java deleted file mode 100644 index 877a0ed4e41..00000000000 --- a/src/client/java/teammates/client/scripts/DataMigrationForInstructorNullIsArchivedField.java +++ /dev/null @@ -1,46 +0,0 @@ -package teammates.client.scripts; - -import java.lang.reflect.Field; - -import com.googlecode.objectify.cmd.Query; - -import teammates.storage.entity.Instructor; - -/** - * Script to change all null value to false in the isArchived field for Instructor entity. - */ -public class DataMigrationForInstructorNullIsArchivedField extends DataMigrationEntitiesBaseScript { - - public static void main(String[] args) { - new DataMigrationForInstructorNullIsArchivedField().doOperationRemotely(); - } - - @Override - protected Query getFilterQuery() { - return ofy().load().type(Instructor.class); - } - - @Override - protected boolean isPreview() { - return true; - } - - @Override - protected boolean isMigrationNeeded(Instructor instructor) { - try { - Field isArchivedField = instructor.getClass().getDeclaredField("isArchived"); - isArchivedField.setAccessible(true); - return isArchivedField.get(instructor) == null; - } catch (ReflectiveOperationException e) { - return true; - } - } - - @Override - protected void migrateEntity(Instructor instructor) { - instructor.setIsArchived(instructor.getIsArchived()); - - saveEntityDeferred(instructor); - } - -} diff --git a/src/main/java/teammates/common/datatransfer/attributes/InstructorAttributes.java b/src/main/java/teammates/common/datatransfer/attributes/InstructorAttributes.java index 5bd9707fd98..5c6c8974bd5 100644 --- a/src/main/java/teammates/common/datatransfer/attributes/InstructorAttributes.java +++ b/src/main/java/teammates/common/datatransfer/attributes/InstructorAttributes.java @@ -28,7 +28,6 @@ public final class InstructorAttributes extends EntityAttributes { private String googleId; private String role; private String displayedName; - private boolean isArchived; private boolean isDisplayedToStudents; private InstructorPrivileges privileges; private transient String key; @@ -41,7 +40,6 @@ private InstructorAttributes(String courseId, String email) { this.role = Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_COOWNER; this.displayedName = Const.DEFAULT_DISPLAY_NAME_FOR_INSTRUCTOR; - this.isArchived = false; this.isDisplayedToStudents = true; this.privileges = new InstructorPrivileges(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_COOWNER); @@ -72,7 +70,7 @@ public static InstructorAttributes valueOf(Instructor instructor) { if (instructor.getDisplayedName() != null) { instructorAttributes.displayedName = instructor.getDisplayedName(); } - instructorAttributes.isArchived = instructor.getIsArchived(); + instructorAttributes.isDisplayedToStudents = instructor.isDisplayedToStudents(); if (instructor.getInstructorPrivilegesAsText() == null) { @@ -103,7 +101,6 @@ public InstructorAttributes getCopy() { instructorAttributes.key = key; instructorAttributes.role = role; instructorAttributes.displayedName = displayedName; - instructorAttributes.isArchived = isArchived; instructorAttributes.isDisplayedToStudents = isDisplayedToStudents; instructorAttributes.privileges = privileges; instructorAttributes.createdAt = createdAt; @@ -132,14 +129,6 @@ public void setKey(String key) { this.key = key; } - public boolean isArchived() { - return isArchived; - } - - public void setArchived(boolean archived) { - isArchived = archived; - } - public InstructorPrivileges getPrivileges() { return privileges; } @@ -185,7 +174,7 @@ public String getRegistrationUrl() { @Override public Instructor toEntity() { - return new Instructor(googleId, courseId, isArchived, name, email, role, + return new Instructor(googleId, courseId, name, email, role, isDisplayedToStudents, displayedName, getInstructorPrivilegesAsText()); } @@ -385,7 +374,6 @@ public void update(UpdateOptionsWithGoogleId updateOptions) { private void updateBasic(UpdateOptions updateOptions) { updateOptions.nameOption.ifPresent(s -> name = s); - updateOptions.isArchivedOption.ifPresent(s -> isArchived = s); updateOptions.roleOption.ifPresent(s -> role = s); updateOptions.isDisplayedToStudentsOption.ifPresent(s -> isDisplayedToStudents = s); updateOptions.instructorPrivilegesOption.ifPresent(s -> privileges = s); @@ -570,7 +558,6 @@ public UpdateOptionsWithGoogleId build() { private static class UpdateOptions { UpdateOption nameOption = UpdateOption.empty(); - UpdateOption isArchivedOption = UpdateOption.empty(); UpdateOption roleOption = UpdateOption.empty(); UpdateOption isDisplayedToStudentsOption = UpdateOption.empty(); UpdateOption displayedNameOption = UpdateOption.empty(); @@ -580,7 +567,6 @@ private static class UpdateOptions { public String toString() { return "InstructorAttributes.UpdateOptions [" + "name = " + nameOption - + ", isAchieved = " + isArchivedOption + ", roleOption = " + roleOption + ", isDisplayedToStudents = " + isDisplayedToStudentsOption + ", displayedName = " + displayedNameOption @@ -637,11 +623,6 @@ public B withIsDisplayedToStudents(boolean isDisplayedToStudents) { return thisBuilder; } - public B withIsArchived(boolean isAchieved) { - updateOptions.isArchivedOption = UpdateOption.of(isAchieved); - return thisBuilder; - } - public abstract T build(); } diff --git a/src/main/java/teammates/storage/entity/Instructor.java b/src/main/java/teammates/storage/entity/Instructor.java index 282716d629c..5d75a9dc98d 100644 --- a/src/main/java/teammates/storage/entity/Instructor.java +++ b/src/main/java/teammates/storage/entity/Instructor.java @@ -36,9 +36,6 @@ public class Instructor extends BaseEntity { /** The foreign key to locate the Course object. */ private String courseId; - /** Whether the associated course is archived. */ - private boolean isArchived; - /** The instructor's name used for this course. */ private String name; @@ -70,12 +67,11 @@ private Instructor() { // required by Objectify } - public Instructor(String instructorGoogleId, String courseId, boolean isArchived, String instructorName, + public Instructor(String instructorGoogleId, String courseId, String instructorName, String instructorEmail, String role, boolean isDisplayedToStudents, String displayedName, String instructorPrivilegesAsText) { this.setGoogleId(instructorGoogleId); this.setCourseId(courseId); - this.setIsArchived(isArchived); this.setName(instructorName); this.setEmail(instructorEmail); this.setRole(role); @@ -129,17 +125,6 @@ public void setCourseId(String courseId) { this.courseId = courseId; } - /** - * Gets the archived status of the instructor. - */ - public boolean getIsArchived() { - return isArchived; - } - - public void setIsArchived(boolean isArchived) { - this.isArchived = isArchived; - } - public String getName() { return name; } From fe5cf228655cc18297d924925129758ef7ffb06e Mon Sep 17 00:00:00 2001 From: YongJunXi Date: Wed, 11 Feb 2026 19:46:47 +0800 Subject: [PATCH 20/23] Remove archive action and logic and update tests --- .../java/teammates/common/util/Const.java | 2 - src/main/java/teammates/logic/api/Logic.java | 27 +--------- .../teammates/logic/core/AccountsLogic.java | 2 +- .../logic/core/FeedbackSessionsLogic.java | 2 +- .../logic/core/InstructorsLogic.java | 28 ++-------- .../java/teammates/sqllogic/api/Logic.java | 2 +- .../sqllogic/core/FeedbackSessionsLogic.java | 2 +- .../teammates/storage/api/InstructorsDb.java | 23 +------- .../ui/constants/ResourceEndpoints.java | 1 - .../teammates/ui/webapi/ActionFactory.java | 1 - .../ui/webapi/ArchiveCourseAction.java | 52 ------------------- .../teammates/ui/webapi/GetCoursesAction.java | 12 +---- .../ui/webapi/GetFeedbackSessionsAction.java | 2 +- .../attributes/InstructorAttributesTest.java | 4 +- .../webapi/GetActionClassesActionTest.java | 2 - .../storage/api/InstructorsDbTest.java | 6 +-- .../ui/webapi/BinCourseActionTest.java | 2 +- .../ui/webapi/GetActionClassesActionTest.java | 1 - 18 files changed, 19 insertions(+), 152 deletions(-) delete mode 100644 src/main/java/teammates/ui/webapi/ArchiveCourseAction.java diff --git a/src/main/java/teammates/common/util/Const.java b/src/main/java/teammates/common/util/Const.java index 79fb5d816bc..3165c6f15f2 100644 --- a/src/main/java/teammates/common/util/Const.java +++ b/src/main/java/teammates/common/util/Const.java @@ -222,7 +222,6 @@ public static class HeaderNames { */ public static class CourseStatus { public static final String ACTIVE = "active"; - public static final String ARCHIVED = "archived"; public static final String SOFT_DELETED = "softDeleted"; } @@ -348,7 +347,6 @@ public static class ResourceURIs { public static final String ACCOUNTS = URI_PREFIX + "/accounts"; public static final String RESPONSE_COMMENT = URI_PREFIX + "/responsecomment"; public static final String COURSE = URI_PREFIX + "/course"; - public static final String COURSE_ARCHIVE = URI_PREFIX + "/course/archive"; public static final String BIN_COURSE = URI_PREFIX + "/bin/course"; public static final String COURSE_SECTIONS = URI_PREFIX + "/course/sections"; public static final String COURSES = URI_PREFIX + "/courses"; diff --git a/src/main/java/teammates/logic/api/Logic.java b/src/main/java/teammates/logic/api/Logic.java index 648abf4d969..0f290d7882d 100644 --- a/src/main/java/teammates/logic/api/Logic.java +++ b/src/main/java/teammates/logic/api/Logic.java @@ -334,13 +334,6 @@ public List getInstructorsForGoogleId(String googleId) { return instructorsLogic.getInstructorsForGoogleId(googleId); } - public List getInstructorsForGoogleId(String googleId, boolean omitArchived) { - - assert googleId != null; - - return instructorsLogic.getInstructorsForGoogleId(googleId, omitArchived); - } - /** * Preconditions:
* * All parameters are non-null. @@ -504,24 +497,6 @@ public CourseAttributes updateCourseCascade(CourseAttributes.UpdateOptions updat return coursesLogic.updateCourseCascade(updateOptions); } - /** - * Changes the archive status of a course for an instructor. - * - *
Preconditions:
- * * All parameters are non-null. - * - * @param courseId The course of which the archive status is to be changed - * @param archiveStatus The archive status to be set - */ - public void setArchiveStatusOfInstructor(String googleId, String courseId, boolean archiveStatus) - throws InvalidParametersException, EntityDoesNotExistException { - - assert googleId != null; - assert courseId != null; - - instructorsLogic.setArchiveStatusOfInstructor(googleId, courseId, archiveStatus); - } - /** * Deletes a course cascade its students, instructors, sessions, responses, deadline extensions and comments. * @@ -989,7 +964,7 @@ public List getFeedbackSessionsListForInstructor( /** * Returns a {@code List} of feedback sessions in the Recycle Bin for the instructors. *
- * Omits sessions if the corresponding courses are archived or in Recycle Bin + * Omits sessions if the corresponding courses are in Recycle Bin */ public List getSoftDeletedFeedbackSessionsListForInstructors( List instructorList) { diff --git a/src/main/java/teammates/logic/core/AccountsLogic.java b/src/main/java/teammates/logic/core/AccountsLogic.java index d31dac91d04..2b6395eb8e8 100644 --- a/src/main/java/teammates/logic/core/AccountsLogic.java +++ b/src/main/java/teammates/logic/core/AccountsLogic.java @@ -255,7 +255,7 @@ public void deleteAccountCascade(String googleId) { // to prevent orphan course List instructorsToDelete = - instructorsLogic.getInstructorsForGoogleId(googleId, false); + instructorsLogic.getInstructorsForGoogleId(googleId); for (InstructorAttributes instructorToDelete : instructorsToDelete) { if (instructorsLogic.getInstructorsForCourse(instructorToDelete.getCourseId()).size() <= 1) { // the instructor is the last instructor in the course diff --git a/src/main/java/teammates/logic/core/FeedbackSessionsLogic.java b/src/main/java/teammates/logic/core/FeedbackSessionsLogic.java index 6df8784010e..aad35100125 100644 --- a/src/main/java/teammates/logic/core/FeedbackSessionsLogic.java +++ b/src/main/java/teammates/logic/core/FeedbackSessionsLogic.java @@ -144,7 +144,7 @@ public List getFeedbackSessionsListForInstructor( /** * Returns a {@code List} of feedback sessions in the Recycle Bin for the instructors. *
- * Omits sessions if the corresponding courses are archived or in Recycle Bin + * Omits sessions if the corresponding courses are in Recycle Bin */ public List getSoftDeletedFeedbackSessionsListForInstructors( List instructorList) { diff --git a/src/main/java/teammates/logic/core/InstructorsLogic.java b/src/main/java/teammates/logic/core/InstructorsLogic.java index 0af7387f933..5dd05817052 100644 --- a/src/main/java/teammates/logic/core/InstructorsLogic.java +++ b/src/main/java/teammates/logic/core/InstructorsLogic.java @@ -88,19 +88,6 @@ public InstructorAttributes createInstructor(InstructorAttributes instructorToAd return instructorsDb.createEntity(instructorToAdd); } - /** - * Sets the archive status of an instructor (i.e. whether the instructor - * decides to archive the associated course or not). - */ - public void setArchiveStatusOfInstructor(String googleId, String courseId, boolean archiveStatus) - throws InvalidParametersException, EntityDoesNotExistException { - instructorsDb.updateInstructorByGoogleId( - InstructorAttributes.updateOptionsWithGoogleIdBuilder(courseId, googleId) - .withIsArchived(archiveStatus) - .build() - ); - } - /** * Checks if all the given instructors exist in the given course. * @@ -163,20 +150,11 @@ public List getInstructorsForCourse(String courseId) { return instructorReturnList; } - /** - * Gets all non-archived instructors associated with a googleId. - */ - public List getInstructorsForGoogleId(String googleId) { - return getInstructorsForGoogleId(googleId, false); - } - /** * Gets all instructors associated with a googleId. - * - * @param omitArchived whether archived instructors should be omitted or not */ - public List getInstructorsForGoogleId(String googleId, boolean omitArchived) { - return instructorsDb.getInstructorsForGoogleId(googleId, omitArchived); + public List getInstructorsForGoogleId(String googleId) { + return instructorsDb.getInstructorsForGoogleId(googleId); } /** @@ -332,7 +310,7 @@ public void deleteInstructorCascade(String courseId, String email) { * deadline extensions and comments. */ public void deleteInstructorsForGoogleIdCascade(String googleId) { - List instructors = instructorsDb.getInstructorsForGoogleId(googleId, false); + List instructors = instructorsDb.getInstructorsForGoogleId(googleId); // cascade delete instructors for (InstructorAttributes instructor : instructors) { diff --git a/src/main/java/teammates/sqllogic/api/Logic.java b/src/main/java/teammates/sqllogic/api/Logic.java index e9083503f91..1ce212cffd2 100644 --- a/src/main/java/teammates/sqllogic/api/Logic.java +++ b/src/main/java/teammates/sqllogic/api/Logic.java @@ -570,7 +570,7 @@ public FeedbackSession getFeedbackSessionFromRecycleBin(String feedbackSessionNa /** * Returns a {@code List} of feedback sessions in the Recycle Bin for the instructors. *
- * Omits sessions if the corresponding courses are archived or in Recycle Bin + * Omits sessions if the corresponding courses are in Recycle Bin */ public List getSoftDeletedFeedbackSessionsForInstructors( List instructorList) { diff --git a/src/main/java/teammates/sqllogic/core/FeedbackSessionsLogic.java b/src/main/java/teammates/sqllogic/core/FeedbackSessionsLogic.java index 01a85cff91e..212b65cea75 100644 --- a/src/main/java/teammates/sqllogic/core/FeedbackSessionsLogic.java +++ b/src/main/java/teammates/sqllogic/core/FeedbackSessionsLogic.java @@ -153,7 +153,7 @@ public List getFeedbackSessionsForInstructors( /** * Returns a {@code List} of feedback sessions in the Recycle Bin for the instructors. *
- * Omits sessions if the corresponding courses are archived or in Recycle Bin + * Omits sessions if the corresponding courses are in Recycle Bin */ public List getSoftDeletedFeedbackSessionsForInstructors( List instructorList) { diff --git a/src/main/java/teammates/storage/api/InstructorsDb.java b/src/main/java/teammates/storage/api/InstructorsDb.java index ce021f52d4e..fc7c6e9b9e1 100644 --- a/src/main/java/teammates/storage/api/InstructorsDb.java +++ b/src/main/java/teammates/storage/api/InstructorsDb.java @@ -157,13 +157,11 @@ public InstructorAttributes getInstructorForRegistrationKey(String registrationK /** * Gets all instructors associated with a googleId. - * - * @param omitArchived whether archived instructors should be omitted or not */ - public List getInstructorsForGoogleId(String googleId, boolean omitArchived) { + public List getInstructorsForGoogleId(String googleId) { assert googleId != null; - return makeAttributes(getInstructorEntitiesForGoogleId(googleId, omitArchived)); + return makeAttributes(getInstructorEntitiesForGoogleId(googleId)); } /** @@ -226,7 +224,6 @@ public InstructorAttributes updateInstructorByGoogleId(InstructorAttributes.Upda boolean hasSameAttributes = this.hasSameValue(instructor.getName(), newAttributes.getName()) && this.hasSameValue(instructor.getEmail(), newAttributes.getEmail()) - && this.hasSameValue(instructor.getIsArchived(), newAttributes.isArchived()) && this.hasSameValue(instructor.getRole(), newAttributes.getRole()) && this.hasSameValue(instructor.isDisplayedToStudents(), newAttributes.isDisplayedToStudents()) && this.hasSameValue(instructor.getDisplayedName(), newAttributes.getDisplayedName()) @@ -240,7 +237,6 @@ public InstructorAttributes updateInstructorByGoogleId(InstructorAttributes.Upda instructor.setName(newAttributes.getName()); instructor.setEmail(newAttributes.getEmail()); - instructor.setIsArchived(newAttributes.isArchived()); instructor.setRole(newAttributes.getRole()); instructor.setIsDisplayedToStudents(newAttributes.isDisplayedToStudents()); instructor.setDisplayedName(newAttributes.getDisplayedName()); @@ -281,7 +277,6 @@ public InstructorAttributes updateInstructorByEmail(InstructorAttributes.UpdateO boolean hasSameAttributes = this.hasSameValue(instructor.getName(), newAttributes.getName()) && this.hasSameValue(instructor.getGoogleId(), newAttributes.getGoogleId()) - && this.hasSameValue(instructor.getIsArchived(), newAttributes.isArchived()) && this.hasSameValue(instructor.getRole(), newAttributes.getRole()) && this.hasSameValue(instructor.isDisplayedToStudents(), newAttributes.isDisplayedToStudents()) && this.hasSameValue(instructor.getDisplayedName(), newAttributes.getDisplayedName()) @@ -294,7 +289,6 @@ public InstructorAttributes updateInstructorByEmail(InstructorAttributes.UpdateO instructor.setGoogleId(newAttributes.getGoogleId()); instructor.setName(newAttributes.getName()); - instructor.setIsArchived(newAttributes.isArchived()); instructor.setRole(newAttributes.getRole()); instructor.setIsDisplayedToStudents(newAttributes.isDisplayedToStudents()); instructor.setDisplayedName(newAttributes.getDisplayedName()); @@ -401,19 +395,6 @@ private List getInstructorEntitiesForGoogleId(String googleId) { return getInstructorsForGoogleIdQuery(googleId).list(); } - /** - * Omits instructors with isArchived == omitArchived. - * This means that the corresponding course is archived by the instructor. - */ - private List getInstructorEntitiesForGoogleId(String googleId, boolean omitArchived) { - if (omitArchived) { - return getInstructorsForGoogleIdQuery(googleId) - .filter("isArchived =", false) - .list(); - } - return getInstructorEntitiesForGoogleId(googleId); - } - private List getInstructorEntitiesForCourse(String courseId) { return load().filter("courseId =", courseId).list(); } diff --git a/src/main/java/teammates/ui/constants/ResourceEndpoints.java b/src/main/java/teammates/ui/constants/ResourceEndpoints.java index 3a7a3abe88c..189dd969232 100644 --- a/src/main/java/teammates/ui/constants/ResourceEndpoints.java +++ b/src/main/java/teammates/ui/constants/ResourceEndpoints.java @@ -21,7 +21,6 @@ public enum ResourceEndpoints { ACCOUNTS(ResourceURIs.ACCOUNTS), RESPONSE_COMMENT(ResourceURIs.RESPONSE_COMMENT), COURSE(ResourceURIs.COURSE), - COURSE_ARCHIVE(ResourceURIs.COURSE_ARCHIVE), BIN_COURSE(ResourceURIs.BIN_COURSE), COURSE_SECTIONS(ResourceURIs.COURSE_SECTIONS), COURSES(ResourceURIs.COURSES), diff --git a/src/main/java/teammates/ui/webapi/ActionFactory.java b/src/main/java/teammates/ui/webapi/ActionFactory.java index 83984fb532d..9f64daf900a 100644 --- a/src/main/java/teammates/ui/webapi/ActionFactory.java +++ b/src/main/java/teammates/ui/webapi/ActionFactory.java @@ -59,7 +59,6 @@ public final class ActionFactory { map(ResourceURIs.COURSE, DELETE, DeleteCourseAction.class); map(ResourceURIs.COURSE, POST, CreateCourseAction.class); map(ResourceURIs.COURSE, PUT, UpdateCourseAction.class); - map(ResourceURIs.COURSE_ARCHIVE, PUT, ArchiveCourseAction.class); map(ResourceURIs.DEADLINE_EXTENSION, GET, GetDeadlineExtensionAction.class); map(ResourceURIs.BIN_COURSE, PUT, BinCourseAction.class); map(ResourceURIs.BIN_COURSE, DELETE, RestoreCourseAction.class); diff --git a/src/main/java/teammates/ui/webapi/ArchiveCourseAction.java b/src/main/java/teammates/ui/webapi/ArchiveCourseAction.java deleted file mode 100644 index 919593beaa7..00000000000 --- a/src/main/java/teammates/ui/webapi/ArchiveCourseAction.java +++ /dev/null @@ -1,52 +0,0 @@ -package teammates.ui.webapi; - -import org.apache.http.HttpStatus; - -import teammates.common.exception.EntityDoesNotExistException; -import teammates.common.exception.InvalidParametersException; -import teammates.common.util.Const; -import teammates.common.util.Logger; -import teammates.ui.output.CourseArchiveData; -import teammates.ui.request.CourseArchiveRequest; -import teammates.ui.request.InvalidHttpRequestBodyException; - -/** - * Changes the archive status of a course. - */ -public class ArchiveCourseAction extends Action { - - private static final Logger log = Logger.getLogger(); - - @Override - AuthType getMinAuthLevel() { - return AuthType.LOGGED_IN; - } - - @Override - void checkSpecificAccessControl() throws UnauthorizedAccessException { - String idOfCourseToArchive = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); - gateKeeper.verifyAccessible(logic.getInstructorForGoogleId(idOfCourseToArchive, userInfo.id), - logic.getCourse(idOfCourseToArchive)); - } - - @Override - public JsonResult execute() throws InvalidHttpRequestBodyException { - String idOfCourseToArchive = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); - - CourseArchiveRequest courseArchiveRequest = getAndValidateRequestBody(CourseArchiveRequest.class); - - boolean isArchive = courseArchiveRequest.getArchiveStatus(); - try { - // Set the archive status and status shown to user and admin - logic.setArchiveStatusOfInstructor(userInfo.id, idOfCourseToArchive, isArchive); - } catch (InvalidParametersException e) { - // There should not be any invalid parameter here - log.severe("Unexpected error", e); - return new JsonResult(e.getMessage(), HttpStatus.SC_INTERNAL_SERVER_ERROR); - } catch (EntityDoesNotExistException e) { - throw new EntityNotFoundException(e); - } - - return new JsonResult(new CourseArchiveData(idOfCourseToArchive, isArchive)); - } -} diff --git a/src/main/java/teammates/ui/webapi/GetCoursesAction.java b/src/main/java/teammates/ui/webapi/GetCoursesAction.java index 76e8963e3c1..855a5906cd2 100644 --- a/src/main/java/teammates/ui/webapi/GetCoursesAction.java +++ b/src/main/java/teammates/ui/webapi/GetCoursesAction.java @@ -20,7 +20,7 @@ import teammates.ui.output.CoursesData; /** - * Gets all courses for the instructor, and filtered by active, archived and soft-deleted. + * Gets all courses for the instructor, and filtered by active and soft-deleted. * Or gets all courses for the student he belongs to. */ public class GetCoursesAction extends Action { @@ -93,20 +93,12 @@ private JsonResult getInstructorCourses() { switch (courseStatus) { case Const.CourseStatus.ACTIVE: - instructors = logic.getInstructorsForGoogleId(userInfo.id, true); + instructors = logic.getInstructorsForGoogleId(userInfo.id); courses = getCourse(instructors); sqlInstructors = sqlLogic.getInstructorsForGoogleId(userInfo.id); sqlCourses = sqlLogic.getCoursesForInstructors(sqlInstructors); - break; - case Const.CourseStatus.ARCHIVED: - instructors = logic.getInstructorsForGoogleId(userInfo.id) - .stream() - .filter(InstructorAttributes::isArchived) - .collect(Collectors.toList()); - courses = getCourse(instructors); - break; case Const.CourseStatus.SOFT_DELETED: instructors = logic.getInstructorsForGoogleId(userInfo.id); diff --git a/src/main/java/teammates/ui/webapi/GetFeedbackSessionsAction.java b/src/main/java/teammates/ui/webapi/GetFeedbackSessionsAction.java index d4c1c1ae954..e9115d4a2be 100644 --- a/src/main/java/teammates/ui/webapi/GetFeedbackSessionsAction.java +++ b/src/main/java/teammates/ui/webapi/GetFeedbackSessionsAction.java @@ -124,7 +124,7 @@ public JsonResult execute() { feedbackSessions = sqlLogic.getFeedbackSessionsForInstructors(instructors); } - dataStoreInstructors = logic.getInstructorsForGoogleId(userInfo.getId(), true); + dataStoreInstructors = logic.getInstructorsForGoogleId(userInfo.getId()); if (isInRecycleBin) { feedbackSessionAttributes = logic.getSoftDeletedFeedbackSessionsListForInstructors(dataStoreInstructors); diff --git a/src/test/java/teammates/common/datatransfer/attributes/InstructorAttributesTest.java b/src/test/java/teammates/common/datatransfer/attributes/InstructorAttributesTest.java index 46fc8a43de8..41c41a3d753 100644 --- a/src/test/java/teammates/common/datatransfer/attributes/InstructorAttributesTest.java +++ b/src/test/java/teammates/common/datatransfer/attributes/InstructorAttributesTest.java @@ -117,7 +117,7 @@ public void testBuilder_withTypicalData_shouldBuildCorrectAttribute() { public void testValueOf_withAllFieldPopulatedInstructor_shouldGenerateAttributesCorrectly() { InstructorPrivileges privileges = new InstructorPrivileges(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_COOWNER); - Instructor instructor = new Instructor("valid.google.id", "valid-course-id", false, + Instructor instructor = new Instructor("valid.google.id", "valid-course-id", "valid name", "valid@email.com", Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_COOWNER, true, "Tutor", JsonUtils.toJson(privileges.toLegacyFormat(), InstructorPrivilegesLegacy.class)); InstructorAttributes instructorAttributes = InstructorAttributes.valueOf(instructor); @@ -138,7 +138,7 @@ public void testValueOf_withAllFieldPopulatedInstructor_shouldGenerateAttributes @Test public void testValueOf_withSomeFieldsPopulatedAsNull_shouldUseDefaultValues() { - Instructor instructor = new Instructor("valid.google.id", "valid-course-id", false, + Instructor instructor = new Instructor("valid.google.id", "valid-course-id", "valid name", "valid@email.com", null, true, null, null); InstructorAttributes instructorAttributes = InstructorAttributes.valueOf(instructor); diff --git a/src/test/java/teammates/sqlui/webapi/GetActionClassesActionTest.java b/src/test/java/teammates/sqlui/webapi/GetActionClassesActionTest.java index cc370a97f38..e0e13607ff9 100644 --- a/src/test/java/teammates/sqlui/webapi/GetActionClassesActionTest.java +++ b/src/test/java/teammates/sqlui/webapi/GetActionClassesActionTest.java @@ -12,7 +12,6 @@ import teammates.ui.webapi.AccountRequestSearchIndexingWorkerAction; import teammates.ui.webapi.Action; import teammates.ui.webapi.AdminExceptionTestAction; -import teammates.ui.webapi.ArchiveCourseAction; import teammates.ui.webapi.BinCourseAction; import teammates.ui.webapi.BinFeedbackSessionAction; import teammates.ui.webapi.CalculateUsageStatisticsAction; @@ -171,7 +170,6 @@ void testExecute() { CreateInstructorAction.class, GetInstructorAction.class, UpdateInstructorAction.class, - ArchiveCourseAction.class, InstructorCourseJoinEmailWorkerAction.class, DeleteStudentAction.class, GetStudentAction.class, diff --git a/src/test/java/teammates/storage/api/InstructorsDbTest.java b/src/test/java/teammates/storage/api/InstructorsDbTest.java index a0a7ae20f56..ac71f0d8cf5 100644 --- a/src/test/java/teammates/storage/api/InstructorsDbTest.java +++ b/src/test/java/teammates/storage/api/InstructorsDbTest.java @@ -209,7 +209,7 @@ public void testGetInstructorsForGoogleId() throws Exception { String googleId = "idOfInstructor3"; - List retrieved = instructorsDb.getInstructorsForGoogleId(googleId, false); + List retrieved = instructorsDb.getInstructorsForGoogleId(googleId); assertEquals(2, retrieved.size()); InstructorAttributes instructor1 = retrieved.get(0); @@ -220,13 +220,13 @@ public void testGetInstructorsForGoogleId() throws Exception { ______TS("Failure: instructor does not exist"); - retrieved = instructorsDb.getInstructorsForGoogleId("non-exist-id", false); + retrieved = instructorsDb.getInstructorsForGoogleId("non-exist-id"); assertEquals(0, retrieved.size()); ______TS("Failure: null parameters"); assertThrows(AssertionError.class, - () -> instructorsDb.getInstructorsForGoogleId(null, false)); + () -> instructorsDb.getInstructorsForGoogleId(null)); } diff --git a/src/test/java/teammates/ui/webapi/BinCourseActionTest.java b/src/test/java/teammates/ui/webapi/BinCourseActionTest.java index 3b1edbe5efc..201e62e71c3 100644 --- a/src/test/java/teammates/ui/webapi/BinCourseActionTest.java +++ b/src/test/java/teammates/ui/webapi/BinCourseActionTest.java @@ -60,7 +60,7 @@ protected void testExecute() throws Exception { verifyCourseData(courseData, courseToBeDeleted.getId(), courseToBeDeleted.getName(), courseToBeDeleted.getTimeZone()); - List instructors = logic.getInstructorsForGoogleId(instructorId, false); + List instructors = logic.getInstructorsForGoogleId(instructorId); List courseList = logic.getCoursesForInstructor(instructors); assertEquals(1, courseList.size()); assertEquals("icdct.tpa.id1", courseList.get(0).getId()); diff --git a/src/test/java/teammates/ui/webapi/GetActionClassesActionTest.java b/src/test/java/teammates/ui/webapi/GetActionClassesActionTest.java index b407c2cfb6b..3ea0571a409 100644 --- a/src/test/java/teammates/ui/webapi/GetActionClassesActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetActionClassesActionTest.java @@ -54,7 +54,6 @@ protected void testExecute() { CreateInstructorAction.class, GetInstructorAction.class, UpdateInstructorAction.class, - ArchiveCourseAction.class, InstructorCourseJoinEmailWorkerAction.class, DeleteStudentAction.class, GetStudentAction.class, From 66f6800734024926b28c02f298f4a63dc5f1f8b6 Mon Sep 17 00:00:00 2001 From: YongJunXi Date: Wed, 11 Feb 2026 19:47:33 +0800 Subject: [PATCH 21/23] Delete CourseArchiveData and CourseArchiveRequest --- .../ui/output/CourseArchiveData.java | 23 ------------------- .../ui/request/CourseArchiveRequest.java | 21 ----------------- 2 files changed, 44 deletions(-) delete mode 100644 src/main/java/teammates/ui/output/CourseArchiveData.java delete mode 100644 src/main/java/teammates/ui/request/CourseArchiveRequest.java diff --git a/src/main/java/teammates/ui/output/CourseArchiveData.java b/src/main/java/teammates/ui/output/CourseArchiveData.java deleted file mode 100644 index 2f5021bc79a..00000000000 --- a/src/main/java/teammates/ui/output/CourseArchiveData.java +++ /dev/null @@ -1,23 +0,0 @@ -package teammates.ui.output; - -/** - * The API output format of a archived course status. - */ -public class CourseArchiveData extends ApiOutput { - - private final String courseId; - private final boolean isArchived; - - public CourseArchiveData(String courseId, boolean isArchived) { - this.courseId = courseId; - this.isArchived = isArchived; - } - - public String getCourseId() { - return courseId; - } - - public boolean getIsArchived() { - return isArchived; - } -} diff --git a/src/main/java/teammates/ui/request/CourseArchiveRequest.java b/src/main/java/teammates/ui/request/CourseArchiveRequest.java deleted file mode 100644 index 8e29c81a6da..00000000000 --- a/src/main/java/teammates/ui/request/CourseArchiveRequest.java +++ /dev/null @@ -1,21 +0,0 @@ -package teammates.ui.request; - -/** - * The archive request of a course. - */ -public class CourseArchiveRequest extends BasicRequest { - private boolean archiveStatus; - - @Override - public void validate() { - //nothing to validate - } - - public boolean getArchiveStatus() { - return archiveStatus; - } - - public void setArchiveStatus(boolean archiveStatus) { - this.archiveStatus = archiveStatus; - } -} From 39d1633cb61fc813341e5a896ec22647182d2b24 Mon Sep 17 00:00:00 2001 From: YongJunXi Date: Wed, 11 Feb 2026 20:01:51 +0800 Subject: [PATCH 22/23] Fix spotBugsMain failure --- src/main/java/teammates/ui/webapi/GetCoursesAction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/teammates/ui/webapi/GetCoursesAction.java b/src/main/java/teammates/ui/webapi/GetCoursesAction.java index 855a5906cd2..caba7b4a345 100644 --- a/src/main/java/teammates/ui/webapi/GetCoursesAction.java +++ b/src/main/java/teammates/ui/webapi/GetCoursesAction.java @@ -88,8 +88,8 @@ private JsonResult getInstructorCourses() { List instructors; List courses; - List sqlInstructors = new ArrayList<>(); - List sqlCourses = new ArrayList<>(); + List sqlInstructors; + List sqlCourses; switch (courseStatus) { case Const.CourseStatus.ACTIVE: From bfb34fdb7051fb9bee3aae27f796f79ef327315a Mon Sep 17 00:00:00 2001 From: YongJunXi Date: Wed, 11 Feb 2026 20:07:44 +0800 Subject: [PATCH 23/23] Fix checkstyle --- src/main/java/teammates/ui/webapi/GetCoursesAction.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/teammates/ui/webapi/GetCoursesAction.java b/src/main/java/teammates/ui/webapi/GetCoursesAction.java index caba7b4a345..3e83f2f1ce0 100644 --- a/src/main/java/teammates/ui/webapi/GetCoursesAction.java +++ b/src/main/java/teammates/ui/webapi/GetCoursesAction.java @@ -1,6 +1,5 @@ package teammates.ui.webapi; -import java.util.ArrayList; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet;