Search in sources :

Example 6 with InstructorFeedbackResultsModerationButton

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;
}
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 7 with InstructorFeedbackResultsModerationButton

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

Example 8 with InstructorFeedbackResultsModerationButton

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

Aggregations

InstructorFeedbackResultsModerationButton (teammates.ui.template.InstructorFeedbackResultsModerationButton)8 ArrayList (java.util.ArrayList)7 InstructorFeedbackResultsResponseRow (teammates.ui.template.InstructorFeedbackResultsResponseRow)4 FeedbackResponseAttributes (teammates.common.datatransfer.attributes.FeedbackResponseAttributes)3 HashMap (java.util.HashMap)2 LinkedHashMap (java.util.LinkedHashMap)2 List (java.util.List)2 FeedbackQuestionDetails (teammates.common.datatransfer.questions.FeedbackQuestionDetails)2 ElementTag (teammates.ui.template.ElementTag)2 InstructorFeedbackResultsGroupByQuestionPanel (teammates.ui.template.InstructorFeedbackResultsGroupByQuestionPanel)2 FeedbackParticipantType (teammates.common.datatransfer.FeedbackParticipantType)1 FeedbackQuestionAttributes (teammates.common.datatransfer.attributes.FeedbackQuestionAttributes)1 FeedbackResponseCommentRow (teammates.ui.template.FeedbackResponseCommentRow)1 InstructorFeedbackResultsParticipantPanel (teammates.ui.template.InstructorFeedbackResultsParticipantPanel)1 InstructorFeedbackResultsQuestionTable (teammates.ui.template.InstructorFeedbackResultsQuestionTable)1 InstructorFeedbackResultsSecondaryParticipantPanelBody (teammates.ui.template.InstructorFeedbackResultsSecondaryParticipantPanelBody)1