Search in sources :

Example 1 with InstructorFeedbackRemindParticularStudentsPageData

use of teammates.ui.pagedata.InstructorFeedbackRemindParticularStudentsPageData in project teammates by TEAMMATES.

the class InstructorFeedbackRemindParticularStudentsPageActionTest method testExecuteAndPostProcess.

@Override
@Test
public void testExecuteAndPostProcess() {
    InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1");
    String instructorId = instructor1OfCourse1.googleId;
    CourseAttributes course = typicalBundle.courses.get("typicalCourse1");
    FeedbackSessionAttributes fsa = typicalBundle.feedbackSessions.get("session1InCourse1");
    gaeSimulation.loginAsInstructor(instructorId);
    ______TS("Not enough parameters");
    verifyAssumptionFailure();
    ______TS("Typical case");
    String[] submissionParams = new String[] { Const.ParamsNames.COURSE_ID, course.getId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fsa.getFeedbackSessionName() };
    InstructorFeedbackRemindParticularStudentsPageAction a = getAction(submissionParams);
    ShowPageResult r = getShowPageResult(a);
    assertFalse(r.isError);
    assertEquals("", r.getStatusMessage());
    InstructorFeedbackRemindParticularStudentsPageData pageData = (InstructorFeedbackRemindParticularStudentsPageData) r.data;
    assertEquals(6, pageData.getResponseStatus().studentsWhoDidNotRespond.size());
    assertEquals(3, pageData.getResponseStatus().studentsWhoResponded.size());
    assertTrue(pageData.getResponseStatus().studentsWhoResponded.contains("student1InCourse1@gmail.tmt"));
    assertFalse(pageData.getResponseStatus().studentsWhoDidNotRespond.contains("student2InCourse1@gmail.tmt"));
    assertTrue(pageData.getResponseStatus().studentsWhoResponded.contains("student3InCourse1@gmail.tmt"));
    assertTrue(pageData.getResponseStatus().studentsWhoDidNotRespond.contains("student4InCourse1@gmail.tmt"));
    assertFalse(pageData.getResponseStatus().studentsWhoResponded.contains("student5InCourse1@gmail.tmt"));
    assertFalse(pageData.getResponseStatus().studentsWhoDidNotRespond.contains("student6InCourse1@gmail.tmt"));
    assertFalse(pageData.getResponseStatus().studentsWhoDidNotRespond.contains("instructor1@course1.tmt"));
    assertTrue(pageData.getResponseStatus().studentsWhoDidNotRespond.contains("instructor2@course1.tmt"));
    assertTrue(pageData.getResponseStatus().studentsWhoDidNotRespond.contains("instructor3@course1.tmt"));
    assertFalse(pageData.getResponseStatus().studentsWhoDidNotRespond.contains("instructor4@course1.tmt"));
    assertTrue(pageData.getResponseStatus().studentsWhoDidNotRespond.contains("helper@course1.tmt"));
}
Also used : FeedbackSessionAttributes(teammates.common.datatransfer.attributes.FeedbackSessionAttributes) ShowPageResult(teammates.ui.controller.ShowPageResult) InstructorFeedbackRemindParticularStudentsPageData(teammates.ui.pagedata.InstructorFeedbackRemindParticularStudentsPageData) InstructorFeedbackRemindParticularStudentsPageAction(teammates.ui.controller.InstructorFeedbackRemindParticularStudentsPageAction) InstructorAttributes(teammates.common.datatransfer.attributes.InstructorAttributes) CourseAttributes(teammates.common.datatransfer.attributes.CourseAttributes) Test(org.testng.annotations.Test)

Example 2 with InstructorFeedbackRemindParticularStudentsPageData

use of teammates.ui.pagedata.InstructorFeedbackRemindParticularStudentsPageData in project teammates by TEAMMATES.

the class InstructorFeedbackRemindParticularStudentsPageAction method execute.

@Override
protected ActionResult execute() throws EntityDoesNotExistException {
    String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID);
    Assumption.assertPostParamNotNull(Const.ParamsNames.COURSE_ID, courseId);
    String feedbackSessionName = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME);
    Assumption.assertPostParamNotNull(Const.ParamsNames.FEEDBACK_SESSION_NAME, feedbackSessionName);
    FeedbackSessionAttributes fsa = logic.getFeedbackSession(feedbackSessionName, courseId);
    InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, account.googleId);
    gateKeeper.verifyAccessible(instructor, fsa, false);
    FeedbackSessionResponseStatus fsResponseStatus = logic.getFeedbackSessionResponseStatus(feedbackSessionName, courseId);
    InstructorFeedbackRemindParticularStudentsPageData data = new InstructorFeedbackRemindParticularStudentsPageData(account, sessionToken, fsResponseStatus, courseId, feedbackSessionName);
    return createShowPageResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_AJAX_REMIND_PARTICULAR_STUDENTS_MODAL, data);
}
Also used : FeedbackSessionAttributes(teammates.common.datatransfer.attributes.FeedbackSessionAttributes) FeedbackSessionResponseStatus(teammates.common.datatransfer.FeedbackSessionResponseStatus) InstructorFeedbackRemindParticularStudentsPageData(teammates.ui.pagedata.InstructorFeedbackRemindParticularStudentsPageData) InstructorAttributes(teammates.common.datatransfer.attributes.InstructorAttributes)

Aggregations

FeedbackSessionAttributes (teammates.common.datatransfer.attributes.FeedbackSessionAttributes)2 InstructorAttributes (teammates.common.datatransfer.attributes.InstructorAttributes)2 InstructorFeedbackRemindParticularStudentsPageData (teammates.ui.pagedata.InstructorFeedbackRemindParticularStudentsPageData)2 Test (org.testng.annotations.Test)1 FeedbackSessionResponseStatus (teammates.common.datatransfer.FeedbackSessionResponseStatus)1 CourseAttributes (teammates.common.datatransfer.attributes.CourseAttributes)1 InstructorFeedbackRemindParticularStudentsPageAction (teammates.ui.controller.InstructorFeedbackRemindParticularStudentsPageAction)1 ShowPageResult (teammates.ui.controller.ShowPageResult)1