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;
}
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);
}
Aggregations