/**
   * Creates a new instructor with basic information. This consists of everything apart from custom
   * privileges.
   *
   * @param courseId Id of the course the instructor is being added to.
   * @param instructorName Name of the instructor.
   * @param instructorEmail Email of the instructor.
   * @param instructorRole Role of the instructor.
   * @param isDisplayedToStudents Whether the instructor should be visible to students.
   * @param displayedName Name to be visible to students. Should not be {@code null} even if {@code
   *     isDisplayedToStudents} is false.
   * @return An instructor with basic info, excluding custom privileges
   */
  private InstructorAttributes createInstructorWithBasicAttributes(
      String courseId,
      String instructorName,
      String instructorEmail,
      String instructorRole,
      boolean isDisplayedToStudents,
      String displayedName) {
    String instrName = Sanitizer.sanitizeName(instructorName);
    String instrEmail = Sanitizer.sanitizeEmail(instructorEmail);
    String instrRole = Sanitizer.sanitizeName(instructorRole);
    String instrDisplayedName = Sanitizer.sanitizeName(displayedName);
    InstructorPrivileges privileges = new InstructorPrivileges(instructorRole);

    InstructorAttributes instructorToAdd =
        new InstructorAttributes(
            null,
            courseId,
            instrName,
            instrEmail,
            instrRole,
            isDisplayedToStudents,
            instrDisplayedName,
            privileges);

    return instructorToAdd;
  }
 @Override
 public void sanitizeForSaving() {
   googleId = Sanitizer.sanitizeGoogleId(googleId);
   email = Sanitizer.sanitizeEmail(email);
   course = Sanitizer.sanitizeTitle(course);
   name = Sanitizer.sanitizeName(name);
   team = Sanitizer.sanitizeTitle(team);
   section = Sanitizer.sanitizeTitle(section);
   comments = Sanitizer.sanitizeTextField(comments);
 }
 public StudentAttributes(
     String section, String team, String name, String email, String comment, String courseId) {
   this();
   this.section = Sanitizer.sanitizeTitle(section);
   this.team = Sanitizer.sanitizeTitle(team);
   this.lastName = Sanitizer.sanitizeName(StringHelper.splitName(name)[1]);
   this.name = Sanitizer.sanitizeName(name);
   this.email = Sanitizer.sanitizeEmail(email);
   this.comments = Sanitizer.sanitizeTextField(comment);
   this.course = Sanitizer.sanitizeTitle(courseId);
 }
 @Override
 public void sanitizeForSaving() {
   this.googleId = Sanitizer.sanitizeGoogleId(this.googleId);
   this.email = Sanitizer.sanitizeEmail(this.email);
   this.course = Sanitizer.sanitizeTitle(this.course);
   this.name = Sanitizer.sanitizeName(this.name);
   this.team = Sanitizer.sanitizeTitle(this.team);
   this.section = Sanitizer.sanitizeTitle(this.section);
   this.comments = Sanitizer.sanitizeTextField(this.comments);
   this.googleId = Sanitizer.sanitizeForHtml(this.googleId);
   this.email = Sanitizer.sanitizeForHtml(this.email);
   this.course = Sanitizer.sanitizeForHtml(this.course);
   this.name = Sanitizer.sanitizeForHtml(this.name);
   this.team = Sanitizer.sanitizeForHtml(this.team);
   this.section = Sanitizer.sanitizeForHtml(this.section);
   this.comments = Sanitizer.sanitizeForHtml(this.comments);
 }
 public StudentProfileAttributes(
     String googleId,
     String shortName,
     String email,
     String institute,
     String nationality,
     String gender,
     String moreInfo,
     String pictureKey) {
   this.googleId = googleId;
   this.shortName = Sanitizer.sanitizeName(shortName);
   this.email = Sanitizer.sanitizeEmail(email);
   this.institute = Sanitizer.sanitizeTitle(institute);
   this.nationality = Sanitizer.sanitizeName(nationality);
   this.gender = gender;
   this.moreInfo = moreInfo;
   this.pictureKey = pictureKey;
 }