use of teammates.common.datatransfer.CourseRoster in project teammates by TEAMMATES.
the class FeedbackSessionsLogic method getFeedbackSessionResultsForInstructorFromSection.
/**
* Gets results of a feedback session to show to an instructor from a specific section.
*/
public FeedbackSessionResultsBundle getFeedbackSessionResultsForInstructorFromSection(String feedbackSessionName, String courseId, String userEmail, String section) 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, "false");
params.put(PARAM_IN_SECTION, "false");
params.put(PARAM_FROM_SECTION, "true");
params.put(PARAM_TO_SECTION, "false");
params.put(PARAM_SECTION, section);
return getFeedbackSessionResultsForUserWithParams(feedbackSessionName, courseId, userEmail, UserRole.INSTRUCTOR, roster, params);
}
use of teammates.common.datatransfer.CourseRoster in project teammates by TEAMMATES.
the class FeedbackSessionsLogic method getFeedbackSessionResultsForInstructorToSectionWithinRange.
/**
* Gets results of a feedback session to show to an instructor in a section in an indicated range.
*/
public FeedbackSessionResultsBundle getFeedbackSessionResultsForInstructorToSectionWithinRange(String feedbackSessionName, String courseId, String userEmail, String section, int range) 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, "false");
params.put(PARAM_FROM_SECTION, "false");
params.put(PARAM_TO_SECTION, "true");
params.put(PARAM_SECTION, section);
if (range > 0) {
params.put(PARAM_RANGE, String.valueOf(range));
}
return getFeedbackSessionResultsForUserWithParams(feedbackSessionName, courseId, userEmail, UserRole.INSTRUCTOR, roster, params);
}
use of teammates.common.datatransfer.CourseRoster in project teammates by TEAMMATES.
the class FeedbackSessionsLogic method addSectionTeamNamesToTable.
private void addSectionTeamNamesToTable(Map<String, Set<String>> sectionTeamNameTable, CourseRoster roster, String courseId, String userEmail, UserRole role, String feedbackSessionName, String sectionToView) {
InstructorAttributes instructor = getInstructor(courseId, userEmail, role);
if (instructor != null) {
for (StudentAttributes student : roster.getStudents()) {
boolean isVisibleResponse = instructor.isAllowedForPrivilege(student.section, feedbackSessionName, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS);
boolean isStudentInSelectedSection = student.section.equals(sectionToView);
boolean isViewingAllSections = sectionToView == null;
if (isVisibleResponse && (isViewingAllSections || isStudentInSelectedSection)) {
String section = student.section;
sectionTeamNameTable.computeIfAbsent(section, key -> new HashSet<>()).add(student.team);
}
}
}
}
use of teammates.common.datatransfer.CourseRoster in project teammates by TEAMMATES.
the class FeedbackSessionsLogic method getFeedbackSessionResultsForInstructorInSection.
/**
* Gets results of a feedback session to show to an instructor for a specific section.
*/
public FeedbackSessionResultsBundle getFeedbackSessionResultsForInstructorInSection(String feedbackSessionName, String courseId, String userEmail, String section) 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_SECTION, section);
return getFeedbackSessionResultsForUserWithParams(feedbackSessionName, courseId, userEmail, UserRole.INSTRUCTOR, roster, params);
}
use of teammates.common.datatransfer.CourseRoster in project teammates by TEAMMATES.
the class FeedbackSessionsLogic method getFeedbackSessionResultsForInstructorFromQuestion.
/**
* Gets results of a feedback session to show to an instructor from an indicated question.
* This will not retrieve the list of comments for this question.
*/
public FeedbackSessionResultsBundle getFeedbackSessionResultsForInstructorFromQuestion(String feedbackSessionName, String courseId, String userEmail, String questionId) throws EntityDoesNotExistException {
// Load details of students and instructors once and pass it to callee
// methods
// (rather than loading them many times).
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, "false");
params.put(PARAM_FROM_SECTION, "false");
params.put(PARAM_TO_SECTION, "false");
params.put(PARAM_QUESTION_ID, questionId);
return getFeedbackSessionResultsForUserWithParams(feedbackSessionName, courseId, userEmail, UserRole.INSTRUCTOR, roster, params);
}
Aggregations