Esempio n. 1
0
  private Set<String> populateRecipientEmails(
      String courseId,
      List<StudentAttributes> allStudents,
      CourseRoster roster,
      Map<String, List<StudentAttributes>> teamStudentTable,
      Map<String, List<StudentAttributes>> sectionStudentTable)
      throws EntityDoesNotExistException {
    Set<String> recipientEmailsList = new HashSet<String>();

    List<CommentAttributes> sendingCommentsList =
        commentsDb.getCommentsForSendingState(courseId, CommentSendingState.SENDING);
    populateRecipientEmailsFromPendingComments(
        sendingCommentsList,
        allStudents,
        roster,
        teamStudentTable,
        sectionStudentTable,
        recipientEmailsList);

    List<FeedbackResponseCommentAttributes> sendingResponseCommentsList =
        frcLogic.getFeedbackResponseCommentsForSendingState(courseId, CommentSendingState.SENDING);
    populateRecipientEmailsFromPendingResponseComments(
        sendingResponseCommentsList, allStudents, roster, teamStudentTable, recipientEmailsList);

    return recipientEmailsList;
  }
Esempio n. 2
0
  /** ********** CRUD *********** */
  public CommentAttributes createComment(CommentAttributes comment)
      throws InvalidParametersException, EntityAlreadyExistsException, EntityDoesNotExistException {
    verifyIsCoursePresent(comment.courseId, "create");
    verifyIsInstructorOfCourse(comment.courseId, comment.giverEmail);

    return commentsDb.createEntity(comment);
  }
Esempio n. 3
0
 public List<CommentAttributes> getCommentsForReceiver(
     String courseId,
     String giverEmail,
     CommentParticipantType recipientType,
     String receiverEmail)
     throws EntityDoesNotExistException {
   verifyIsCoursePresent(courseId, "get");
   List<CommentAttributes> comments =
       commentsDb.getCommentsForReceiver(courseId, recipientType, receiverEmail);
   Iterator<CommentAttributes> iterator = comments.iterator();
   while (iterator.hasNext()) {
     CommentAttributes c = iterator.next();
     if (!c.giverEmail.equals(giverEmail)) {
       iterator.remove();
     }
   }
   return comments;
 }
Esempio n. 4
0
 public CommentSearchResultBundle searchComment(
     String queryString, List<InstructorAttributes> instructors, String cursorString) {
   return commentsDb.search(queryString, instructors, cursorString);
 }
Esempio n. 5
0
 /**
  * Create or update document for comment
  *
  * @param comment
  */
 public void putDocument(CommentAttributes comment) {
   commentsDb.putDocument(comment);
 }
Esempio n. 6
0
 public List<CommentAttributes> getCommentDrafts(String giverEmail) {
   return commentsDb.getCommentDrafts(giverEmail);
 }
Esempio n. 7
0
 public List<CommentAttributes> getCommentsForSendingState(
     String courseId, CommentSendingState sendingState) throws EntityDoesNotExistException {
   verifyIsCoursePresent(courseId, "get");
   return commentsDb.getCommentsForSendingState(courseId, sendingState);
 }
Esempio n. 8
0
 public CommentAttributes getComment(Long commentId) {
   return commentsDb.getComment(commentId);
 }
Esempio n. 9
0
 public void deleteCommentsForTeam(String courseId, String teamName) {
   commentsDb.deleteCommentsForTeam(courseId, teamName);
 }
Esempio n. 10
0
 public void deleteCommentsForStudent(String courseId, String studentEmail) {
   commentsDb.deleteCommentsByStudentEmail(courseId, studentEmail);
 }
Esempio n. 11
0
 public void deleteCommentsForInstructor(String courseId, String instructorEmail) {
   commentsDb.deleteCommentsByInstructorEmail(courseId, instructorEmail);
 }
Esempio n. 12
0
 /**
  * update comment's recipient email (assume to be a student)
  *
  * @param courseId
  * @param oldStudentEmail
  * @param updatedStudentEmail
  */
 public void updateStudentEmail(
     String courseId, String oldStudentEmail, String updatedStudentEmail) {
   commentsDb.updateStudentEmail(courseId, oldStudentEmail, updatedStudentEmail);
 }
Esempio n. 13
0
 /**
  * update comment's giver email (assume to be an instructor)
  *
  * @param courseId
  * @param oldInstrEmail
  * @param updatedInstrEmail
  */
 public void updateInstructorEmail(
     String courseId, String oldInstrEmail, String updatedInstrEmail) {
   commentsDb.updateInstructorEmail(courseId, oldInstrEmail, updatedInstrEmail);
 }
Esempio n. 14
0
  public CommentAttributes updateComment(CommentAttributes comment)
      throws InvalidParametersException, EntityDoesNotExistException {
    verifyIsCoursePresent(comment.courseId, "update");

    return commentsDb.updateComment(comment);
  }
Esempio n. 15
0
 public void updateCommentsSendingState(
     String courseId, CommentSendingState oldState, CommentSendingState newState)
     throws EntityDoesNotExistException {
   verifyIsCoursePresent(courseId, "clear pending");
   commentsDb.updateComments(courseId, oldState, newState);
 }
Esempio n. 16
0
 private List<CommentAttributes> getCommentsForCommentViewer(
     String courseId, CommentParticipantType commentViewerType)
     throws EntityDoesNotExistException {
   verifyIsCoursePresent(courseId, "get");
   return commentsDb.getCommentsForCommentViewer(courseId, commentViewerType);
 }
Esempio n. 17
0
 private List<CommentAttributes> getCommentsForGiverAndStatus(
     String courseId, String giverEmail, CommentStatus status) throws EntityDoesNotExistException {
   verifyIsCoursePresent(courseId, "get");
   return commentsDb.getCommentsForGiverAndStatus(courseId, giverEmail, status);
 }
Esempio n. 18
0
 public void deleteCommentsForSection(String courseId, String sectionName) {
   commentsDb.deleteCommentsForSection(courseId, sectionName);
 }
Esempio n. 19
0
 public void deleteCommentsForCourse(String courseId) {
   commentsDb.deleteCommentsForCourse(courseId);
 }
Esempio n. 20
0
 public void deleteComment(CommentAttributes comment) {
   commentsDb.deleteEntity(comment);
 }
Esempio n. 21
0
 public List<CommentAttributes> getCommentsForGiver(String courseId, String giverEmail)
     throws EntityDoesNotExistException {
   verifyIsCoursePresent(courseId, "get");
   return commentsDb.getCommentsForGiver(courseId, giverEmail);
 }
Esempio n. 22
0
 public void deleteDocument(CommentAttributes comment) {
   commentsDb.deleteDocument(comment);
 }
Esempio n. 23
0
 public List<CommentAttributes> getCommentsForReceiver(
     String courseId, CommentParticipantType recipientType, String receiverEmail)
     throws EntityDoesNotExistException {
   verifyIsCoursePresent(courseId, "get");
   return commentsDb.getCommentsForReceiver(courseId, recipientType, receiverEmail);
 }
Esempio n. 24
0
 @SuppressWarnings("deprecation")
 public List<CommentAttributes> getAllComments() {
   return commentsDb.getAllComments();
 }