Search in sources :

Example 1 with FeedbackResponseAdjustmentWorkerAction

use of teammates.ui.automated.FeedbackResponseAdjustmentWorkerAction in project teammates by TEAMMATES.

the class FeedbackResponseAdjustmentWorkerActionTest method allTests.

@Test
public void allTests() throws Exception {
    ______TS("typical case : existing student changes team");
    FeedbackSessionAttributes session = dataBundle.feedbackSessions.get("session2InCourse1");
    StudentAttributes student = dataBundle.students.get("student1InCourse1");
    // Verify pre-existing submissions and responses
    List<FeedbackResponseAttributes> oldResponsesForSession = getAllResponsesForStudentForSession(student, session.getFeedbackSessionName());
    assertFalse(oldResponsesForSession.isEmpty());
    String oldTeam = student.team;
    String oldSection = student.section;
    String newTeam = "Team 1.2";
    String newSection = "Section 2";
    student.team = newTeam;
    student.section = newSection;
    StudentEnrollDetails enrollDetails = new StudentEnrollDetails(StudentUpdateStatus.MODIFIED, student.course, student.email, oldTeam, newTeam, oldSection, newSection);
    List<StudentEnrollDetails> enrollList = new ArrayList<>();
    enrollList.add(enrollDetails);
    studentsLogic.updateStudentCascadeWithSubmissionAdjustmentScheduled(student.email, student, false);
    String[] submissionParams = new String[] { ParamsNames.COURSE_ID, student.course, ParamsNames.FEEDBACK_SESSION_NAME, session.getFeedbackSessionName(), ParamsNames.ENROLLMENT_DETAILS, JsonUtils.toJson(enrollList) };
    FeedbackResponseAdjustmentWorkerAction action = getAction(submissionParams);
    action.execute();
    List<FeedbackResponseAttributes> newResponsesForSession = getAllResponsesForStudentForSession(student, session.getFeedbackSessionName());
    assertTrue(newResponsesForSession.isEmpty());
}
Also used : FeedbackSessionAttributes(teammates.common.datatransfer.attributes.FeedbackSessionAttributes) FeedbackResponseAttributes(teammates.common.datatransfer.attributes.FeedbackResponseAttributes) ArrayList(java.util.ArrayList) FeedbackResponseAdjustmentWorkerAction(teammates.ui.automated.FeedbackResponseAdjustmentWorkerAction) StudentEnrollDetails(teammates.common.datatransfer.StudentEnrollDetails) StudentAttributes(teammates.common.datatransfer.attributes.StudentAttributes) Test(org.testng.annotations.Test)

Aggregations

ArrayList (java.util.ArrayList)1 Test (org.testng.annotations.Test)1 StudentEnrollDetails (teammates.common.datatransfer.StudentEnrollDetails)1 FeedbackResponseAttributes (teammates.common.datatransfer.attributes.FeedbackResponseAttributes)1 FeedbackSessionAttributes (teammates.common.datatransfer.attributes.FeedbackSessionAttributes)1 StudentAttributes (teammates.common.datatransfer.attributes.StudentAttributes)1 FeedbackResponseAdjustmentWorkerAction (teammates.ui.automated.FeedbackResponseAdjustmentWorkerAction)1