Search in sources :

Example 1 with HomeFeedbackSessionRow

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

the class StudentHomePageDataTest method testOldCourseTable.

private void testOldCourseTable(CourseDetailsBundle oldCourse, CourseTable courseTable) {
    // Sessions in old course have multiple messages in tooltip as their end dates have passed.
    assertEquals(oldCourse.feedbackSessions.size(), courseTable.getRows().size());
    List<HomeFeedbackSessionRow> sessions = courseTable.getRows();
    HomeFeedbackSessionRow publishedRow = sessions.get(0);
    HomeFeedbackSessionRow closedRow = sessions.get(1);
    HomeFeedbackSessionRow submittedClosedRow = sessions.get(2);
    int accumlativeOffset = courses.get(0).feedbackSessions.size();
    int index = 0 + accumlativeOffset;
    testFeedbackSession(index++, publishedRow, publishedSession, Const.Tooltips.STUDENT_FEEDBACK_SESSION_STATUS_PENDING + Const.Tooltips.STUDENT_FEEDBACK_SESSION_STATUS_CLOSED, Const.Tooltips.STUDENT_FEEDBACK_SESSION_STATUS_PUBLISHED, "Closed", "Published");
    testFeedbackSession(index++, closedRow, closedSession, Const.Tooltips.STUDENT_FEEDBACK_SESSION_STATUS_PENDING + Const.Tooltips.STUDENT_FEEDBACK_SESSION_STATUS_CLOSED, Const.Tooltips.STUDENT_FEEDBACK_SESSION_STATUS_NOT_PUBLISHED, "Closed", "Not Published");
    testFeedbackSession(index++, submittedClosedRow, submittedClosedSession, Const.Tooltips.STUDENT_FEEDBACK_SESSION_STATUS_SUBMITTED + Const.Tooltips.STUDENT_FEEDBACK_SESSION_STATUS_CLOSED, Const.Tooltips.STUDENT_FEEDBACK_SESSION_STATUS_NOT_PUBLISHED, "Closed", "Not Published");
}
Also used : HomeFeedbackSessionRow(teammates.ui.template.HomeFeedbackSessionRow) StudentHomeFeedbackSessionRow(teammates.ui.template.StudentHomeFeedbackSessionRow)

Example 2 with HomeFeedbackSessionRow

use of teammates.ui.template.HomeFeedbackSessionRow 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 3 with HomeFeedbackSessionRow

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

the class StudentHomePageDataTest method testNewCourseTable.

private void testNewCourseTable(CourseDetailsBundle newCourse, CourseTable courseTable) {
    assertEquals(newCourse.feedbackSessions.size(), courseTable.getRows().size());
    List<HomeFeedbackSessionRow> sessions = courseTable.getRows();
    HomeFeedbackSessionRow submittedRow = sessions.get(0);
    HomeFeedbackSessionRow pendingRow = sessions.get(1);
    HomeFeedbackSessionRow awaitingRow = sessions.get(2);
    int index = 0;
    testFeedbackSession(index++, submittedRow, submittedSession, Const.Tooltips.STUDENT_FEEDBACK_SESSION_STATUS_SUBMITTED, Const.Tooltips.STUDENT_FEEDBACK_SESSION_STATUS_NOT_PUBLISHED, "Submitted", "Not Published");
    testFeedbackSession(index++, pendingRow, pendingSession, Const.Tooltips.STUDENT_FEEDBACK_SESSION_STATUS_PENDING, Const.Tooltips.STUDENT_FEEDBACK_SESSION_STATUS_NOT_PUBLISHED, "Pending", "Not Published");
    testFeedbackSession(index++, awaitingRow, awaitingSession, Const.Tooltips.STUDENT_FEEDBACK_SESSION_STATUS_AWAITING, Const.Tooltips.STUDENT_FEEDBACK_SESSION_STATUS_NOT_PUBLISHED, "Awaiting", "Not Published");
}
Also used : HomeFeedbackSessionRow(teammates.ui.template.HomeFeedbackSessionRow) StudentHomeFeedbackSessionRow(teammates.ui.template.StudentHomeFeedbackSessionRow)

Example 4 with HomeFeedbackSessionRow

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

the class InstructorHomeCourseAjaxPageData method createSessionRows.

private List<HomeFeedbackSessionRow> createSessionRows(List<FeedbackSessionAttributes> sessions, InstructorAttributes instructor) {
    List<HomeFeedbackSessionRow> rows = new ArrayList<>();
    for (FeedbackSessionAttributes session : sessions) {
        InstructorHomeFeedbackSessionRow row = new InstructorHomeFeedbackSessionRow(sanitizeForHtml(session.getFeedbackSessionName()), getInstructorSubmissionsTooltipForFeedbackSession(session), getInstructorPublishedTooltipForFeedbackSession(session), getInstructorSubmissionStatusForFeedbackSession(session), getInstructorPublishedStatusForFeedbackSession(session), TimeHelper.formatDateTimeForInstructorHomePage(session.getStartTimeLocal()), session.getStartTimeInIso8601UtcFormat(), TimeHelper.formatDateTimeForSessions(session.getStartTime(), session.getTimeZone()), TimeHelper.formatDateTimeForInstructorHomePage(session.getEndTimeLocal()), session.getEndTimeInIso8601UtcFormat(), TimeHelper.formatDateTimeForSessions(session.getEndTime(), session.getTimeZone()), getInstructorFeedbackStatsLink(session.getCourseId(), session.getFeedbackSessionName()), getInstructorFeedbackSessionActions(session, Const.ActionURIs.INSTRUCTOR_HOME_PAGE, instructor));
        rows.add(row);
    }
    return rows;
}
Also used : FeedbackSessionAttributes(teammates.common.datatransfer.attributes.FeedbackSessionAttributes) InstructorHomeFeedbackSessionRow(teammates.ui.template.InstructorHomeFeedbackSessionRow) InstructorHomeFeedbackSessionRow(teammates.ui.template.InstructorHomeFeedbackSessionRow) HomeFeedbackSessionRow(teammates.ui.template.HomeFeedbackSessionRow) ArrayList(java.util.ArrayList)

Aggregations

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