Package teammates.jdo

Examples of teammates.jdo.Student


   *
   * @param googleID
   *            the Google ID of the student (Precondition: Must not be null)
   */
  public void archiveStudentCourse(String courseID, String googleID) {
    Student student = getStudentWithID(courseID, googleID);
    student.setCourseArchived(true);
  }
View Full Code Here


   *
   * @param email
   *            the email of the student (Precondition: Must not be null)
   */
  public void deleteStudent(String courseID, String email) {
    Student s = getStudentWithEmail(courseID, email);

    try {
      getPM().deletePersistent(s);
    } finally {
    }
View Full Code Here

   *
   * @param googleID
   *            the Google ID of the student (Precondition: Must not be null)
   */
  public void deleteStudentCourse(String courseID, String googleID) {
    Student student = getStudentWithID(courseID, googleID);
    student.setID("");

  }
View Full Code Here

   *            the new comments of the student (Precondition: Must not be
   *            null)
   */
  public void editStudent(String courseID, String email, String newName,
      String newEmail, String newGoogleID, String newComments) {
    Student student = getStudentWithEmail(courseID, email);

    student.setComments((newComments));
    student.setEmail(newEmail);
    student.setID(newGoogleID);
    student.setName(newName);
  }
View Full Code Here

   *            null)
   */
  public void editStudent(String courseID, String email, String newName,
      String newTeamName, String newEmail, String newGoogleID,
      String newComments) {
    Student student = getStudentWithEmail(courseID, email);

    student.setComments((newComments));
    student.setEmail(newEmail);
    student.setID(newGoogleID);
    student.setName(newName);
    student.setTeamName(newTeamName);
  }
View Full Code Here

    List<Student> studentListToEdit = new ArrayList<Student>();
    List<Student> studentListToCompareWith = new ArrayList<Student>();
    List<EnrollmentReport> enrollmentReportList = new ArrayList<EnrollmentReport>();

    for (Student s1 : studentList) {
      Student s2 = getStudentWithEmail(courseID, s1.getEmail());

      if (s2 != null) {
        studentListToCompareWith.add(s1);
        studentListToEdit.add(s2);
        enrollmentReportList.add(new EnrollmentReport(s2.getName(), s2
            .getEmail(), EnrollmentStatus.REMAINED, false, false,
            false));
      }
    }

    // Edit the acquired Student objects and update the corresponding
    // EnrollmentReport objects
    for (int x = 0; x < studentListToEdit.size(); x++) {
      EnrollmentReport er = enrollmentReportList.get(x);
      Student s = studentListToCompareWith.get(x);
      Student se = studentListToEdit.get(x);

      if (!s.getName().equals(se.getName())) {
        se.setName(s.getName());
        er.setNameEdited(true);
        er.setStatus(EnrollmentStatus.EDITED);
      }

      if (!s.getTeamName().equals(se.getTeamName())) {
        se.setTeamName(s.getTeamName());
        er.setTeamNameEdited(true);
        er.setStatus(EnrollmentStatus.EDITED);
      }

      if (!s.getComments().equals(se.getComments())) {
        se.setComments(studentList.get(x).getComments());
        er.setCommentsEdited(true);
        er.setStatus(EnrollmentStatus.EDITED);
      }
    }
View Full Code Here

   *             if the registration key has been used by another student
   */
  public void joinCourse(String registrationKey, String googleID)
      throws RegistrationKeyInvalidException,
      GoogleIDExistsInCourseException, RegistrationKeyTakenException {
    Student student = null;

    try {
      student = getPM().getObjectById(Student.class,
          KeyFactory.stringToKey(registrationKey));
    }

    catch (Exception e) {
      throw new RegistrationKeyInvalidException();
    }

    List<Student> studentList = getStudentCourseList(googleID);

    for (Student s : studentList) {
      if (s.getCourseID().equals(student.getCourseID())) {
        throw new GoogleIDExistsInCourseException();
      }
    }

    if (!student.getID().equals("")) {
      throw new RegistrationKeyTakenException();
    }

    student.setID(googleID);
  }
View Full Code Here

   * @param email
   *            the email of the student (Precondition: The courseID and email
   *            pair must be valid)
   */
  public void unarchiveStudentCourse(String courseID, String email) {
    Student student = getStudentWithEmail(courseID, email);
    student.setCourseArchived(false);

  }
View Full Code Here

    @SuppressWarnings("unchecked")
    List<Student> datastoreStudents = (List<Student>) query
        .execute(course_id);

    for (Student dsStudent : datastoreStudents) {
      Student jsStudent = mapStudents.get(dsStudent.getEmail());
      if (jsStudent != null) {
        dsStudent.setID(jsStudent.getID());
      }
    }
    // Store back to datastore
    getPM().makePersistentAll(datastoreStudents);
View Full Code Here

   *
   * @param googleID
   *            the Google ID of the student (Precondition: Must not be null)
   */
  public void archiveStudentCourse(String courseID, String googleID) {
    Student student = getStudentWithID(courseID, googleID);
    student.setCourseArchived(true);
  }
View Full Code Here

TOP

Related Classes of teammates.jdo.Student

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.