use of teammates.ui.template.InstructorFeedbackResultsGroupByQuestionPanel in project teammates by TEAMMATES.
the class InstructorFeedbackResultsPageData method buildGroupByQuestionPanel.
private InstructorFeedbackResultsGroupByQuestionPanel buildGroupByQuestionPanel(String participantIdentifier, Entry<String, Map<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>>> recipientToGiverToResponsesMap, String additionalInfoId, int participantIndex) {
List<InstructorFeedbackResultsQuestionTable> questionTables = new ArrayList<>();
int questionIndex = 0;
for (Entry<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>> responsesForParticipantForQuestion : recipientToGiverToResponsesMap.getValue().entrySet()) {
if (responsesForParticipantForQuestion.getValue().isEmpty()) {
// participant has no responses for the current question
continue;
}
questionIndex += 1;
FeedbackQuestionAttributes currentQuestion = responsesForParticipantForQuestion.getKey();
List<FeedbackResponseAttributes> responsesForQuestion = responsesForParticipantForQuestion.getValue();
InstructorFeedbackResultsQuestionTable questionTable = buildQuestionTableAndResponseRows(currentQuestion, responsesForQuestion, String.format(additionalInfoId, participantIndex, questionIndex), participantIdentifier, true);
questionTable.setBoldQuestionNumber(false);
questionTables.add(questionTable);
}
InstructorFeedbackResultsQuestionTable.sortByQuestionNumber(questionTables);
InstructorFeedbackResultsGroupByQuestionPanel participantPanel;
// Construct InstructorFeedbackResultsGroupByQuestionPanel for the current giver
if (viewType.isPrimaryGroupingOfGiverType() && (bundle.isParticipantIdentifierStudent(participantIdentifier) || bundle.isParticipantIdentifierInstructor(participantIdentifier))) {
// Moderation button on the participant panels are only shown is the panel is a giver panel,
// and if the participant is a student
InstructorFeedbackResultsModerationButton moderationButton = buildModerationButtonForGiver(null, participantIdentifier, "btn btn-primary btn-xs", MODERATE_RESPONSES_FOR_GIVER);
participantPanel = new InstructorFeedbackResultsGroupByQuestionPanel(participantIdentifier, bundle.getNameForEmail(participantIdentifier), questionTables, getStudentProfilePictureLink(participantIdentifier, instructor.courseId), true, moderationButton);
} else {
participantPanel = new InstructorFeedbackResultsGroupByQuestionPanel(questionTables, getStudentProfilePictureLink(participantIdentifier, instructor.courseId), viewType.isPrimaryGroupingOfGiverType(), participantIdentifier, bundle.getNameForEmail(participantIdentifier));
}
return participantPanel;
}
use of teammates.ui.template.InstructorFeedbackResultsGroupByQuestionPanel in project teammates by TEAMMATES.
the class InstructorFeedbackResultsPageData method addMissingParticipantsPanelsWithoutModerationButtonForTeam.
private void addMissingParticipantsPanelsWithoutModerationButtonForTeam(InstructorFeedbackResultsSectionPanel sectionPanel, String teamName, List<String> teamMembers) {
for (String teamMember : teamMembers) {
InstructorFeedbackResultsParticipantPanel giverPanel;
if (viewType.isSecondaryGroupingOfParticipantType()) {
String teamMemberWithTeamNameAppended = bundle.getFullNameFromRoster(teamMember) + " (" + bundle.getTeamNameFromRoster(teamMember) + ")";
giverPanel = buildInstructorFeedbackResultsGroupBySecondaryParticipantPanel(teamMember, teamMemberWithTeamNameAppended, new ArrayList<InstructorFeedbackResultsSecondaryParticipantPanelBody>(), null);
} else {
giverPanel = new InstructorFeedbackResultsGroupByQuestionPanel(new ArrayList<InstructorFeedbackResultsQuestionTable>(), getStudentProfilePictureLink(teamMember, instructor.courseId), viewType.isPrimaryGroupingOfGiverType(), teamMember, bundle.getFullNameFromRoster(teamMember));
}
giverPanel.setHasResponses(false);
sectionPanel.addParticipantPanel(teamName, giverPanel);
}
}
use of teammates.ui.template.InstructorFeedbackResultsGroupByQuestionPanel in project teammates by TEAMMATES.
the class InstructorFeedbackResultsPageData method addMissingParticipantsPanelsWithModerationButtonForTeam.
/**
* Builds participant panels for the specified team, and add to sectionPanel.
*/
private void addMissingParticipantsPanelsWithModerationButtonForTeam(InstructorFeedbackResultsSectionPanel sectionPanel, String teamName, List<String> teamMembers) {
for (String teamMember : teamMembers) {
InstructorFeedbackResultsModerationButton moderationButton = buildModerationButtonForGiver(null, teamMember, "btn btn-default btn-xs", MODERATE_RESPONSES_FOR_GIVER);
InstructorFeedbackResultsParticipantPanel giverPanel;
if (viewType.isSecondaryGroupingOfParticipantType()) {
String teamMemberNameWithTeamNameAppended = bundle.getFullNameFromRoster(teamMember) + " (" + bundle.getTeamNameFromRoster(teamMember) + ")";
giverPanel = buildInstructorFeedbackResultsGroupBySecondaryParticipantPanel(teamMember, teamMemberNameWithTeamNameAppended, new ArrayList<InstructorFeedbackResultsSecondaryParticipantPanelBody>(), moderationButton);
} else {
giverPanel = new InstructorFeedbackResultsGroupByQuestionPanel(teamMember, bundle.getFullNameFromRoster(teamMember), new ArrayList<InstructorFeedbackResultsQuestionTable>(), getStudentProfilePictureLink(teamMember, instructor.courseId), viewType.isPrimaryGroupingOfGiverType(), moderationButton);
}
giverPanel.setHasResponses(false);
sectionPanel.addParticipantPanel(teamName, giverPanel);
}
}
Aggregations