Search in sources :

Example 1 with StudentHomeFeedbackSessionRow

use of teammates.ui.template.StudentHomeFeedbackSessionRow in project teammates by TEAMMATES.

the class StudentHomePageData method createSessionRows.

private List<HomeFeedbackSessionRow> createSessionRows(List<FeedbackSessionDetailsBundle> feedbackSessions, Map<FeedbackSessionAttributes, Boolean> sessionSubmissionStatusMap, int startingSessionIdx) {
    List<HomeFeedbackSessionRow> rows = new ArrayList<>();
    int sessionIdx = startingSessionIdx;
    for (FeedbackSessionDetailsBundle session : feedbackSessions) {
        FeedbackSessionAttributes feedbackSession = session.feedbackSession;
        String sessionName = feedbackSession.getFeedbackSessionName();
        boolean hasSubmitted = sessionSubmissionStatusMap.get(feedbackSession);
        rows.add(new StudentHomeFeedbackSessionRow(PageData.sanitizeForHtml(sessionName), getStudentSubmissionsTooltipForSession(feedbackSession, hasSubmitted), getStudentPublishedTooltipForSession(feedbackSession), getStudentSubmissionStatusForSession(feedbackSession, hasSubmitted), getStudentPublishedStatusForSession(feedbackSession), TimeHelper.formatDateTimeForSessions(feedbackSession.getEndTime(), feedbackSession.getTimeZone()), feedbackSession.getEndTimeInIso8601UtcFormat(), getStudentFeedbackSessionActions(feedbackSession, hasSubmitted), sessionIdx));
        ++sessionIdx;
    }
    return rows;
}
Also used : FeedbackSessionAttributes(teammates.common.datatransfer.attributes.FeedbackSessionAttributes) StudentHomeFeedbackSessionRow(teammates.ui.template.StudentHomeFeedbackSessionRow) HomeFeedbackSessionRow(teammates.ui.template.HomeFeedbackSessionRow) StudentHomeFeedbackSessionRow(teammates.ui.template.StudentHomeFeedbackSessionRow) ArrayList(java.util.ArrayList) FeedbackSessionDetailsBundle(teammates.common.datatransfer.FeedbackSessionDetailsBundle)

Example 2 with StudentHomeFeedbackSessionRow

use of teammates.ui.template.StudentHomeFeedbackSessionRow in project teammates by TEAMMATES.

the class StudentHomePageDataTest method testFeedbackSession.

private void testFeedbackSession(int index, HomeFeedbackSessionRow row, FeedbackSessionAttributes session, String expectedSubmissionsTooltip, String expectedPublishedTooltip, String expectedSubmissionStatus, String expectedPublishedStatus) {
    StudentHomeFeedbackSessionRow studentRow = (StudentHomeFeedbackSessionRow) row;
    assertEquals(session.getFeedbackSessionName(), studentRow.getName());
    assertEquals(TimeHelper.formatDateTimeForSessions(session.getEndTime(), session.getTimeZone()), studentRow.getEndTime());
    assertEquals(session.getEndTimeInIso8601UtcFormat(), studentRow.getEndTimeIso8601Utc());
    assertEquals(expectedSubmissionsTooltip, studentRow.getSubmissionsTooltip());
    assertEquals(expectedPublishedTooltip, studentRow.getPublishedTooltip());
    assertEquals(expectedSubmissionStatus, studentRow.getSubmissionStatus());
    assertEquals(expectedPublishedStatus, studentRow.getPublishedStatus());
    assertEquals(index, studentRow.getIndex());
    testActions(studentRow.getActions(), session);
}
Also used : StudentHomeFeedbackSessionRow(teammates.ui.template.StudentHomeFeedbackSessionRow)

Aggregations

StudentHomeFeedbackSessionRow (teammates.ui.template.StudentHomeFeedbackSessionRow)2 ArrayList (java.util.ArrayList)1 FeedbackSessionDetailsBundle (teammates.common.datatransfer.FeedbackSessionDetailsBundle)1 FeedbackSessionAttributes (teammates.common.datatransfer.attributes.FeedbackSessionAttributes)1 HomeFeedbackSessionRow (teammates.ui.template.HomeFeedbackSessionRow)1