use of teammates.ui.template.InstructorFeedbackResultsModerationButton 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.InstructorFeedbackResultsModerationButton in project teammates by TEAMMATES.
the class InstructorFeedbackResultsPageData method buildModerateButtonsForNoResponsePanel.
private Map<String, InstructorFeedbackResultsModerationButton> buildModerateButtonsForNoResponsePanel() {
Map<String, InstructorFeedbackResultsModerationButton> moderationButtons = new HashMap<>();
for (String giverIdentifier : bundle.responseStatus.emailNameTable.keySet()) {
boolean isStudent = bundle.isParticipantIdentifierStudent(giverIdentifier);
if (!isStudent) {
continue;
}
String sectionName = bundle.getSectionFromRoster(giverIdentifier);
boolean isAllowedToModerate = isAllowedToModerate(instructor, sectionName, feedbackSessionName);
String moderateFeedbackLink = addUserIdToUrl(Const.ActionURIs.INSTRUCTOR_EDIT_STUDENT_FEEDBACK_PAGE);
InstructorFeedbackResultsModerationButton moderationButton = new InstructorFeedbackResultsModerationButton(!isAllowedToModerate, "btn btn-default btn-xs", giverIdentifier, bundle.feedbackSession.getCourseId(), bundle.feedbackSession.getFeedbackSessionName(), null, "Submit Responses", moderateFeedbackLink);
moderationButtons.put(giverIdentifier, moderationButton);
}
return moderationButtons;
}
use of teammates.ui.template.InstructorFeedbackResultsModerationButton 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