use of teammates.common.datatransfer.attributes.FeedbackSessionAttributes in project teammates by TEAMMATES.
the class InstructorFeedbackEditPageUiTest method testSanitization.
private void testSanitization() throws IOException {
______TS("Test sanitization for edit page");
instructorId = testData.accounts.get("instructor1OfTestingSanitizationCourse").googleId;
FeedbackSessionAttributes session = testData.feedbackSessions.get("session1InTestingSanitizationCourse");
courseId = session.getCourseId();
feedbackSessionName = session.getFeedbackSessionName();
feedbackEditPage = getFeedbackEditPage();
feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackEditPageTestingSanitization.html");
______TS("Test sanitization for copy question modal");
feedbackEditPage.clickCopyButton();
feedbackEditPage.waitForCopyTableToLoad();
feedbackEditPage.verifyHtmlPart(By.id("copyModal"), "/instructorFeedbackCopyQuestionModalTestingSanitization.html");
}
use of teammates.common.datatransfer.attributes.FeedbackSessionAttributes in project teammates by TEAMMATES.
the class InstructorFeedbackSessionsPageUiTest method testEditLink.
private void testEditLink() {
InstructorFeedbackEditPage feedbackResultsPage;
FeedbackSessionAttributes fsa;
______TS("edit link clickable when creator");
fsa = testData.feedbackSessions.get("privateSession");
feedbackResultsPage = feedbackPage.loadEditLink(fsa.getCourseId(), fsa.getFeedbackSessionName());
assertTrue(feedbackResultsPage.isCorrectPage(fsa.getCourseId(), fsa.getFeedbackSessionName()));
feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions);
}
use of teammates.common.datatransfer.attributes.FeedbackSessionAttributes in project teammates by TEAMMATES.
the class InstructorSubmissionAdjustmentUiTest method testAdjustmentOfSubmission.
@Test
public void testAdjustmentOfSubmission() throws MaximumRetriesExceededException {
// load the enrollPage
loadEnrollmentPage();
______TS("typical case: enroll new student to existing course");
StudentAttributes newStudent = StudentAttributes.builder("idOfTypicalCourse1", "someName", "random@g.tmt").withComments("comments").withTeam("Team 1.1</td></div>'\"").withSection("None").build();
String enrollString = "Section | Team | Name | Email | Comment" + System.lineSeparator() + newStudent.toEnrollmentString();
enrollPage.enroll(enrollString);
// Wait briefly to allow task queue to successfully execute tasks
ThreadHelper.waitFor(2000);
______TS("typical case : existing student changes team");
loadEnrollmentPage();
final FeedbackSessionAttributes session = testData.feedbackSessions.get("session2InCourse1");
final StudentAttributes student = testData.students.get("student1InCourse1");
// Verify pre-existing submissions and responses
List<FeedbackResponseAttributes> oldResponsesForSession = getAllResponsesForStudentForSession(student, session.getFeedbackSessionName());
assertFalse(oldResponsesForSession.isEmpty());
String newTeam = "Team 1.2";
student.team = newTeam;
enrollString = "Section | Team | Name | Email | Comment" + System.lineSeparator() + student.toEnrollmentString();
enrollPage.enroll(enrollString);
// It might take a while for the submission adjustment to persist (especially on the live server),
// during which the pre-existing submissions and responses would be counted.
// Hence, this needs to be retried several times until the count becomes zero.
persistenceRetryManager.runUntilSuccessful(new RetryableTaskReturns<Integer>("Assert outdated responses removed") {
@Override
public Integer run() {
return getAllResponsesForStudentForSession(student, session.getFeedbackSessionName()).size();
}
@Override
public boolean isSuccessful(Integer numberOfResponses) {
return numberOfResponses == 0;
}
});
}
use of teammates.common.datatransfer.attributes.FeedbackSessionAttributes in project teammates by TEAMMATES.
the class StudentFeedbackSubmissionEditPageActionTest method testAccessControl.
@Override
@Test
protected void testAccessControl() throws Exception {
FeedbackSessionAttributes session1InCourse1 = dataBundle.feedbackSessions.get("session1InCourse1");
String[] submissionParams = new String[] { Const.ParamsNames.COURSE_ID, session1InCourse1.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, session1InCourse1.getFeedbackSessionName() };
verifyOnlyStudentsOfTheSameCourseCanAccess(submissionParams);
}
use of teammates.common.datatransfer.attributes.FeedbackSessionAttributes in project teammates by TEAMMATES.
the class FeedbackSessionAttributesTest method testBuilderCopy.
@Test
public void testBuilderCopy() {
FeedbackSessionAttributes original = FeedbackSessionAttributes.builder("newFeedbackSessionName", "course", "email").withInstructions(new Text("default instructions")).withCreatedTime(Instant.now()).withStartTime(TimeHelperExtension.getInstantHoursOffsetFromNow(2)).withEndTime(TimeHelperExtension.getInstantHoursOffsetFromNow(5)).withSessionVisibleFromTime(TimeHelperExtension.getInstantHoursOffsetFromNow(1)).withResultsVisibleFromTime(TimeHelperExtension.getInstantHoursOffsetFromNow(6)).withTimeZone(ZoneId.of("Asia/Singapore")).withGracePeriodMinutes(0).withFeedbackSessionType(FeedbackSessionType.PRIVATE).withOpeningEmailEnabled(false).withClosingEmailEnabled(false).withPublishedEmailEnabled(false).build();
FeedbackSessionAttributes copy = original.getCopy();
assertEquals(original.getFeedbackSessionName(), copy.getFeedbackSessionName());
assertEquals(original.getCourseId(), copy.getCourseId());
assertEquals(original.getCreatorEmail(), copy.getCreatorEmail());
assertEquals(original.getInstructions(), copy.getInstructions());
assertEquals(original.getCreatedTime(), copy.getCreatedTime());
assertEquals(original.getStartTime(), copy.getStartTime());
assertEquals(original.getEndTime(), copy.getEndTime());
assertEquals(original.getSessionVisibleFromTime(), copy.getSessionVisibleFromTime());
assertEquals(original.getResultsVisibleFromTime(), copy.getResultsVisibleFromTime());
assertEquals(original.getTimeZone(), copy.getTimeZone());
assertEquals(original.getGracePeriodMinutes(), copy.getGracePeriodMinutes());
assertEquals(original.getFeedbackSessionType(), copy.getFeedbackSessionType());
assertEquals(original.isOpeningEmailEnabled(), copy.isOpeningEmailEnabled());
assertEquals(original.isClosingEmailEnabled(), copy.isClosingEmailEnabled());
assertEquals(original.isPublishedEmailEnabled(), copy.isPublishedEmailEnabled());
assertEquals(original.isSentClosedEmail(), copy.isSentClosedEmail());
assertEquals(original.isSentClosingEmail(), copy.isSentClosingEmail());
assertEquals(original.isSentOpenEmail(), copy.isSentOpenEmail());
assertEquals(original.isSentPublishedEmail(), copy.isSentPublishedEmail());
assertEquals(original.getRespondingInstructorList(), copy.getRespondingInstructorList());
assertEquals(original.getRespondingStudentList(), copy.getRespondingStudentList());
}
Aggregations