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