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/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/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/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", 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!

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

5. Learn about other actions you can perform
  • Search: search for students, teams or sections.
  • -
  • - Archive old courses: archive old courses that you no longer need actively. -
  • 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
    Copy Instructors
    -
    - [{{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, 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, 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 fec46e764b7..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,149 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`InstructorCoursesPageComponent should snap when archived courses are expanded 1`] = ` - -
    - -
    -
    -

    - Active courses -

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

    -

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

    -

    - -
    -
    -
    - Loading... -
    -
    - -
    -
    - -`; - exports[`InstructorCoursesPageComponent should snap when courses are still loading 1`] = `
    -

    -

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

    -

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

    -

    -
    - -
    -
    Copy -
    -

    -

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

    -

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

    -

    - -
    -
    -
    - Loading... -
    -
    - -
    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..578f9bb0e8b 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('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'); @@ -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 */ 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 - 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); diff --git a/src/web/app/pages-instructor/instructor-sessions-page/__snapshots__/instructor-sessions-page.component.spec.ts.snap b/src/web/app/pages-instructor/instructor-sessions-page/__snapshots__/instructor-sessions-page.component.spec.ts.snap index c37e61bcb7a..9eb512085d3 100644 --- a/src/web/app/pages-instructor/instructor-sessions-page/__snapshots__/instructor-sessions-page.component.spec.ts.snap +++ b/src/web/app/pages-instructor/instructor-sessions-page/__snapshots__/instructor-sessions-page.component.spec.ts.snap @@ -89,7 +89,7 @@ exports[`InstructorSessionsPageComponent should snap when courses are loading 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.

    @@ -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.

    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.

    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..bde8496dc9d 100644 --- a/src/web/services/course.service.ts +++ b/src/web/services/course.service.ts @@ -1,10 +1,9 @@ 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, 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,22 +94,8 @@ 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 { - courses: vals[0].courses.concat(vals[1].courses), - }; - }), - ); + return this.httpRequestService.get(ResourceEndpoints.COURSES, activeCoursesParamMap); } /** @@ -149,14 +134,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. */