Search in sources :

Example 11 with CourseRoster

use of teammates.common.datatransfer.CourseRoster in project teammates by TEAMMATES.

the class FeedbackSessionsLogic method getFeedbackSessionResultsForInstructorFromQuestionInSection.

/**
 * Gets results of a feedback session to show to an instructor from an indicated question
 * and in a section.
 * This will not retrieve the list of comments for this question.
 */
public FeedbackSessionResultsBundle getFeedbackSessionResultsForInstructorFromQuestionInSection(String feedbackSessionName, String courseId, String userEmail, String questionId, String selectedSection) throws EntityDoesNotExistException {
    CourseRoster roster = new CourseRoster(studentsLogic.getStudentsForCourse(courseId), instructorsLogic.getInstructorsForCourse(courseId));
    Map<String, String> params = new HashMap<>();
    params.put(PARAM_IS_INCLUDE_RESPONSE_STATUS, "true");
    params.put(PARAM_IN_SECTION, "true");
    params.put(PARAM_FROM_SECTION, "false");
    params.put(PARAM_TO_SECTION, "false");
    params.put(PARAM_QUESTION_ID, questionId);
    params.put(PARAM_SECTION, selectedSection);
    return getFeedbackSessionResultsForUserWithParams(feedbackSessionName, courseId, userEmail, UserRole.INSTRUCTOR, roster, params);
}
Also used : HashMap(java.util.HashMap) CourseRoster(teammates.common.datatransfer.CourseRoster)

Example 12 with CourseRoster

use of teammates.common.datatransfer.CourseRoster in project teammates by TEAMMATES.

the class FeedbackSessionsLogic method getFeedbackSessionResponseStatus.

/**
 * Gets the response rate status for a session.
 */
public FeedbackSessionResponseStatus getFeedbackSessionResponseStatus(String feedbackSessionName, String courseId) throws EntityDoesNotExistException {
    FeedbackSessionAttributes session = fsDb.getFeedbackSession(courseId, feedbackSessionName);
    if (session == null) {
        throw new EntityDoesNotExistException(ERROR_NON_EXISTENT_FS_VIEW + courseId + "/" + feedbackSessionName);
    }
    List<FeedbackQuestionAttributes> allQuestions = fqLogic.getFeedbackQuestionsForSession(feedbackSessionName, courseId);
    CourseRoster roster = new CourseRoster(studentsLogic.getStudentsForCourse(courseId), instructorsLogic.getInstructorsForCourse(courseId));
    return getFeedbackSessionResponseStatus(session, roster, allQuestions);
}
Also used : FeedbackSessionAttributes(teammates.common.datatransfer.attributes.FeedbackSessionAttributes) CourseRoster(teammates.common.datatransfer.CourseRoster) FeedbackQuestionAttributes(teammates.common.datatransfer.attributes.FeedbackQuestionAttributes) EntityDoesNotExistException(teammates.common.exception.EntityDoesNotExistException)

Aggregations

CourseRoster (teammates.common.datatransfer.CourseRoster)12 HashMap (java.util.HashMap)9 FeedbackQuestionAttributes (teammates.common.datatransfer.attributes.FeedbackQuestionAttributes)3 FeedbackResponseAttributes (teammates.common.datatransfer.attributes.FeedbackResponseAttributes)2 FeedbackSessionAttributes (teammates.common.datatransfer.attributes.FeedbackSessionAttributes)2 InstructorAttributes (teammates.common.datatransfer.attributes.InstructorAttributes)2 StudentAttributes (teammates.common.datatransfer.attributes.StudentAttributes)2 EntityDoesNotExistException (teammates.common.exception.EntityDoesNotExistException)2 Instant (java.time.Instant)1 ArrayList (java.util.ArrayList)1 Comparator (java.util.Comparator)1 Date (java.util.Date)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Map (java.util.Map)1 Entry (java.util.Map.Entry)1 Set (java.util.Set)1 Test (org.testng.annotations.Test)1 FeedbackParticipantType (teammates.common.datatransfer.FeedbackParticipantType)1 FeedbackSessionDetailsBundle (teammates.common.datatransfer.FeedbackSessionDetailsBundle)1