Search in sources :

Example 1 with StudentFeedbackSubmissionEditQuestionsWithResponses

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

the class FeedbackSubmissionEditPageData method createQuestionsWithResponses.

private void createQuestionsWithResponses() {
    questionsWithResponses = new ArrayList<>();
    int qnIndx = 1;
    for (FeedbackQuestionAttributes questionAttributes : bundle.getSortedQuestions()) {
        int numOfResponseBoxes = questionAttributes.numberOfEntitiesToGiveFeedbackTo;
        int maxResponsesPossible = bundle.recipientList.get(questionAttributes.getId()).size();
        if (numOfResponseBoxes == Const.MAX_POSSIBLE_RECIPIENTS || numOfResponseBoxes > maxResponsesPossible) {
            numOfResponseBoxes = maxResponsesPossible;
        }
        FeedbackSubmissionEditQuestion question = createQuestion(questionAttributes, qnIndx);
        List<FeedbackSubmissionEditResponse> responses = createResponses(questionAttributes, qnIndx, numOfResponseBoxes);
        questionsWithResponses.add(new StudentFeedbackSubmissionEditQuestionsWithResponses(question, responses, numOfResponseBoxes, maxResponsesPossible));
        qnIndx++;
    }
}
Also used : FeedbackQuestionAttributes(teammates.common.datatransfer.attributes.FeedbackQuestionAttributes) FeedbackSubmissionEditQuestion(teammates.ui.template.FeedbackSubmissionEditQuestion) FeedbackSubmissionEditResponse(teammates.ui.template.FeedbackSubmissionEditResponse) StudentFeedbackSubmissionEditQuestionsWithResponses(teammates.ui.template.StudentFeedbackSubmissionEditQuestionsWithResponses)

Example 2 with StudentFeedbackSubmissionEditQuestionsWithResponses

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

the class FeedbackSubmissionEditPageDataTest method testQuestionAttributes.

private void testQuestionAttributes() {
    StudentFeedbackSubmissionEditQuestionsWithResponses questionWithResponses = pageData.getQuestionsWithResponses().get(0);
    assertEquals(question.questionType, questionWithResponses.getQuestion().getQuestionType());
    assertEquals(question.courseId, questionWithResponses.getQuestion().getCourseId());
    assertEquals(question.questionNumber, questionWithResponses.getQuestion().getQuestionNumber());
    assertEquals(question.getQuestionDetails().getQuestionText(), questionWithResponses.getQuestion().getQuestionText());
    assertEquals(question.numberOfEntitiesToGiveFeedbackTo, questionWithResponses.getQuestion().getNumberOfEntitiesToGiveFeedbackTo());
    assertEquals(question.getId(), questionWithResponses.getQuestion().getQuestionId());
}
Also used : StudentFeedbackSubmissionEditQuestionsWithResponses(teammates.ui.template.StudentFeedbackSubmissionEditQuestionsWithResponses)

Aggregations

StudentFeedbackSubmissionEditQuestionsWithResponses (teammates.ui.template.StudentFeedbackSubmissionEditQuestionsWithResponses)2 FeedbackQuestionAttributes (teammates.common.datatransfer.attributes.FeedbackQuestionAttributes)1 FeedbackSubmissionEditQuestion (teammates.ui.template.FeedbackSubmissionEditQuestion)1 FeedbackSubmissionEditResponse (teammates.ui.template.FeedbackSubmissionEditResponse)1