Search in sources :

Example 1 with FeedbackResultsQuestionDetails

use of teammates.ui.template.FeedbackResultsQuestionDetails in project teammates by TEAMMATES.

the class StudentFeedbackResultsPageData method createFeedbackResultsQuestionsWithResponses.

/**
 * Parses the contents of the map and keeps only those data which will be displayed on the browser.
 * @param questionsWithResponses Question with all responses
 */
private void createFeedbackResultsQuestionsWithResponses(Map<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>> questionsWithResponses) {
    feedbackResultsQuestionsWithResponses = new ArrayList<>();
    int questionIndex = 1;
    for (Map.Entry<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>> questionWithResponses : questionsWithResponses.entrySet()) {
        FeedbackQuestionAttributes question = questionWithResponses.getKey();
        List<FeedbackResponseAttributes> responsesBundle = questionWithResponses.getValue();
        FeedbackQuestionDetails questionDetailsBundle = question.getQuestionDetails();
        /* Contain only those attributes which will be displayed on the page */
        FeedbackResultsQuestionDetails questionDetails = createQuestionDetails(questionIndex, question, questionDetailsBundle, responsesBundle);
        List<FeedbackResultsResponseTable> responseTables = createResponseTables(question, responsesBundle);
        feedbackResultsQuestionsWithResponses.add(new StudentFeedbackResultsQuestionWithResponses(questionDetails, responseTables));
        questionIndex++;
    }
}
Also used : FeedbackQuestionDetails(teammates.common.datatransfer.questions.FeedbackQuestionDetails) FeedbackResultsQuestionDetails(teammates.ui.template.FeedbackResultsQuestionDetails) StudentFeedbackResultsQuestionWithResponses(teammates.ui.template.StudentFeedbackResultsQuestionWithResponses) FeedbackResponseAttributes(teammates.common.datatransfer.attributes.FeedbackResponseAttributes) FeedbackQuestionAttributes(teammates.common.datatransfer.attributes.FeedbackQuestionAttributes) ArrayList(java.util.ArrayList) List(java.util.List) FeedbackResultsResponseTable(teammates.ui.template.FeedbackResultsResponseTable) Map(java.util.Map)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 Map (java.util.Map)1 FeedbackQuestionAttributes (teammates.common.datatransfer.attributes.FeedbackQuestionAttributes)1 FeedbackResponseAttributes (teammates.common.datatransfer.attributes.FeedbackResponseAttributes)1 FeedbackQuestionDetails (teammates.common.datatransfer.questions.FeedbackQuestionDetails)1 FeedbackResultsQuestionDetails (teammates.ui.template.FeedbackResultsQuestionDetails)1 FeedbackResultsResponseTable (teammates.ui.template.FeedbackResultsResponseTable)1 StudentFeedbackResultsQuestionWithResponses (teammates.ui.template.StudentFeedbackResultsQuestionWithResponses)1