Search in sources :

Example 1 with InstructorFeedbackSessionActions

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

the class InstructorFeedbackSessionsPageData method convertFeedbackSessionAttributesToSessionRows.

private List<FeedbackSessionsTableRow> convertFeedbackSessionAttributesToSessionRows(List<FeedbackSessionAttributes> sessions, Map<String, InstructorAttributes> instructors, String feedbackSessionNameForSessionList, String courseIdForNewSession) {
    List<FeedbackSessionsTableRow> rows = new ArrayList<>();
    for (FeedbackSessionAttributes session : sessions) {
        String courseId = session.getCourseId();
        String name = sanitizeForHtml(session.getFeedbackSessionName());
        String submissionsTooltip = getInstructorSubmissionsTooltipForFeedbackSession(session);
        String publishedTooltip = getInstructorPublishedTooltipForFeedbackSession(session);
        String submissionStatus = getInstructorSubmissionStatusForFeedbackSession(session);
        String publishedStatus = getInstructorPublishedStatusForFeedbackSession(session);
        String href = getInstructorFeedbackStatsLink(session.getCourseId(), session.getFeedbackSessionName());
        InstructorFeedbackSessionActions actions = getInstructorFeedbackSessionActions(session, Const.ActionURIs.INSTRUCTOR_FEEDBACK_SESSIONS_PAGE, instructors.get(courseId));
        ElementTag elementAttributes;
        if (session.getCourseId().equals(courseIdForNewSession) && session.getFeedbackSessionName().equals(feedbackSessionNameForSessionList)) {
            elementAttributes = new ElementTag("class", "sessionsRow warning");
        } else {
            elementAttributes = new ElementTag("class", "sessionsRow");
        }
        rows.add(new FeedbackSessionsTableRow(courseId, name, submissionsTooltip, publishedTooltip, submissionStatus, publishedStatus, href, actions, elementAttributes));
    }
    return rows;
}
Also used : FeedbackSessionAttributes(teammates.common.datatransfer.attributes.FeedbackSessionAttributes) InstructorFeedbackSessionActions(teammates.ui.template.InstructorFeedbackSessionActions) ArrayList(java.util.ArrayList) FeedbackSessionsTableRow(teammates.ui.template.FeedbackSessionsTableRow) ElementTag(teammates.ui.template.ElementTag)

Aggregations

ArrayList (java.util.ArrayList)1 FeedbackSessionAttributes (teammates.common.datatransfer.attributes.FeedbackSessionAttributes)1 ElementTag (teammates.ui.template.ElementTag)1 FeedbackSessionsTableRow (teammates.ui.template.FeedbackSessionsTableRow)1 InstructorFeedbackSessionActions (teammates.ui.template.InstructorFeedbackSessionActions)1