Search in sources :

Example 1 with InstructorFeedbackResultsSecondaryParticipantPanelBody

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

the class InstructorFeedbackResultsPageData method buildGroupByParticipantPanel.

private InstructorFeedbackResultsGroupByParticipantPanel buildGroupByParticipantPanel(String primaryParticipantIdentifier, Entry<String, Map<String, List<FeedbackResponseAttributes>>> recipientToGiverToResponsesMap, String additionalInfoId, int primaryParticipantIndex) {
    // first build secondary participant panels for the primary participant panel
    Map<String, List<FeedbackResponseAttributes>> giverToResponsesMap = recipientToGiverToResponsesMap.getValue();
    List<InstructorFeedbackResultsSecondaryParticipantPanelBody> secondaryParticipantPanels = buildSecondaryParticipantPanels(additionalInfoId, primaryParticipantIndex, giverToResponsesMap);
    // construct the primary participant panel
    String primaryParticipantNameWithTeamName = bundle.appendTeamNameToName(bundle.getNameForEmail(primaryParticipantIdentifier), bundle.getTeamNameForEmail(primaryParticipantIdentifier));
    InstructorFeedbackResultsModerationButton moderationButton;
    if (viewType.isPrimaryGroupingOfGiverType()) {
        moderationButton = buildModerationButtonForGiver(null, primaryParticipantIdentifier, "btn btn-primary btn-xs", MODERATE_RESPONSES_FOR_GIVER);
    } else {
        moderationButton = null;
    }
    return buildInstructorFeedbackResultsGroupBySecondaryParticipantPanel(primaryParticipantIdentifier, primaryParticipantNameWithTeamName, secondaryParticipantPanels, moderationButton);
}
Also used : ArrayList(java.util.ArrayList) List(java.util.List) InstructorFeedbackResultsModerationButton(teammates.ui.template.InstructorFeedbackResultsModerationButton) InstructorFeedbackResultsSecondaryParticipantPanelBody(teammates.ui.template.InstructorFeedbackResultsSecondaryParticipantPanelBody)

Example 2 with InstructorFeedbackResultsSecondaryParticipantPanelBody

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

the class InstructorFeedbackResultsPageData method buildSecondaryParticipantPanels.

private List<InstructorFeedbackResultsSecondaryParticipantPanelBody> buildSecondaryParticipantPanels(String additionalInfoId, int primaryParticipantIndex, Map<String, List<FeedbackResponseAttributes>> secondaryParticipantToResponsesMap) {
    List<InstructorFeedbackResultsSecondaryParticipantPanelBody> secondaryParticipantPanels = new ArrayList<>();
    int secondaryParticipantIndex = 0;
    for (Map.Entry<String, List<FeedbackResponseAttributes>> secondaryParticipantResponses : secondaryParticipantToResponsesMap.entrySet()) {
        secondaryParticipantIndex += 1;
        String secondaryParticipantIdentifier = secondaryParticipantResponses.getKey();
        boolean isEmail = validator.getInvalidityInfoForEmail(secondaryParticipantIdentifier).isEmpty();
        String secondaryParticipantDisplayableName;
        if (isEmail && !bundle.getTeamNameForEmail(secondaryParticipantIdentifier).isEmpty()) {
            secondaryParticipantDisplayableName = bundle.getNameForEmail(secondaryParticipantIdentifier) + " (" + bundle.getTeamNameForEmail(secondaryParticipantIdentifier) + ")";
        } else {
            secondaryParticipantDisplayableName = bundle.getNameForEmail(secondaryParticipantIdentifier);
        }
        List<InstructorFeedbackResultsResponsePanel> responsePanels = buildResponsePanels(additionalInfoId, primaryParticipantIndex, secondaryParticipantIndex, secondaryParticipantResponses.getValue());
        InstructorFeedbackResultsSecondaryParticipantPanelBody secondaryParticipantPanel = new InstructorFeedbackResultsSecondaryParticipantPanelBody(secondaryParticipantIdentifier, secondaryParticipantDisplayableName, responsePanels);
        secondaryParticipantPanel.setProfilePictureLink(getProfilePictureIfEmailValid(secondaryParticipantIdentifier));
        if (!viewType.isPrimaryGroupingOfGiverType()) {
            String sectionName = bundle.getSectionFromRoster(secondaryParticipantIdentifier);
            boolean isAllowedToModerate = isAllowedToModerate(instructor, sectionName, feedbackSessionName);
            secondaryParticipantPanel.setModerationButton(isAllowedToModerate ? buildModerationButtonForGiver(null, secondaryParticipantIdentifier, "btn btn-default btn-xs", MODERATE_RESPONSES_FOR_GIVER) : null);
        }
        secondaryParticipantPanels.add(secondaryParticipantPanel);
    }
    return secondaryParticipantPanels;
}
Also used : InstructorFeedbackResultsResponsePanel(teammates.ui.template.InstructorFeedbackResultsResponsePanel) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) InstructorFeedbackResultsSecondaryParticipantPanelBody(teammates.ui.template.InstructorFeedbackResultsSecondaryParticipantPanelBody) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map)

Aggregations

ArrayList (java.util.ArrayList)2 List (java.util.List)2 InstructorFeedbackResultsSecondaryParticipantPanelBody (teammates.ui.template.InstructorFeedbackResultsSecondaryParticipantPanelBody)2 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 InstructorFeedbackResultsModerationButton (teammates.ui.template.InstructorFeedbackResultsModerationButton)1 InstructorFeedbackResultsResponsePanel (teammates.ui.template.InstructorFeedbackResultsResponsePanel)1