Search in sources :

Example 1 with InstructorFeedbackResultsGroupByQuestionPanel

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;
}
Also used : FeedbackResponseAttributes(teammates.common.datatransfer.attributes.FeedbackResponseAttributes) InstructorFeedbackResultsGroupByQuestionPanel(teammates.ui.template.InstructorFeedbackResultsGroupByQuestionPanel) ArrayList(java.util.ArrayList) FeedbackQuestionAttributes(teammates.common.datatransfer.attributes.FeedbackQuestionAttributes) ArrayList(java.util.ArrayList) List(java.util.List) InstructorFeedbackResultsModerationButton(teammates.ui.template.InstructorFeedbackResultsModerationButton) InstructorFeedbackResultsQuestionTable(teammates.ui.template.InstructorFeedbackResultsQuestionTable)

Example 2 with InstructorFeedbackResultsGroupByQuestionPanel

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);
    }
}
Also used : InstructorFeedbackResultsGroupByQuestionPanel(teammates.ui.template.InstructorFeedbackResultsGroupByQuestionPanel) ArrayList(java.util.ArrayList) InstructorFeedbackResultsParticipantPanel(teammates.ui.template.InstructorFeedbackResultsParticipantPanel)

Example 3 with InstructorFeedbackResultsGroupByQuestionPanel

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);
    }
}
Also used : InstructorFeedbackResultsGroupByQuestionPanel(teammates.ui.template.InstructorFeedbackResultsGroupByQuestionPanel) ArrayList(java.util.ArrayList) InstructorFeedbackResultsParticipantPanel(teammates.ui.template.InstructorFeedbackResultsParticipantPanel) InstructorFeedbackResultsModerationButton(teammates.ui.template.InstructorFeedbackResultsModerationButton)

Aggregations

ArrayList (java.util.ArrayList)3 InstructorFeedbackResultsGroupByQuestionPanel (teammates.ui.template.InstructorFeedbackResultsGroupByQuestionPanel)3 InstructorFeedbackResultsModerationButton (teammates.ui.template.InstructorFeedbackResultsModerationButton)2 InstructorFeedbackResultsParticipantPanel (teammates.ui.template.InstructorFeedbackResultsParticipantPanel)2 List (java.util.List)1 FeedbackQuestionAttributes (teammates.common.datatransfer.attributes.FeedbackQuestionAttributes)1 FeedbackResponseAttributes (teammates.common.datatransfer.attributes.FeedbackResponseAttributes)1 InstructorFeedbackResultsQuestionTable (teammates.ui.template.InstructorFeedbackResultsQuestionTable)1