Package teammates.jdo

Examples of teammates.jdo.Student


   *
   * @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

    String courseID = req.getParameter(COURSE_ID);
    String email = req.getParameter(STUDENT_EMAIL);

    Course course = courses.getCourse(courseID);
    Student student = courses.getStudentWithEmail(courseID, email);

    List<Student> studentList = new ArrayList<Student>();
    studentList.add(student);

    String courseName = course.getName();
View Full Code Here

    Course course = courses.getCourse(courseID);
    String courseName = course.getName();
    String coordinatorName = accounts.getCoordinatorName(course
        .getCoordinatorID());

    Student student = courses.getStudentWithID(courseID, googleID);

    String studentEmail = student.getEmail();
    String studentName = student.getName();
    String teamName = courses.getTeamName(courseID, studentEmail);

    ArrayList<String> teammateList = new ArrayList<String>();
    List<Student> studentList = courses.getStudentList(courseID);
View Full Code Here

    // evaluation is published and open evaluations are not
    // returned to student
    List<Evaluation> filteredEvaluationList = new ArrayList<Evaluation>();

    String email = "";
    Student student = null;

    Calendar now = Calendar.getInstance();
    Calendar start = Calendar.getInstance();
    Calendar deadline = Calendar.getInstance();

    for (Evaluation e : evaluationList) {
      // Fix the time zone accordingly
      now.add(Calendar.MILLISECOND,
          (int) (60 * 60 * 1000 * e.getTimeZone()));

      student = courses.getStudentWithID(e.getCourseID(), googleID);

      if (student != null) {
        email = student.getEmail();

        start.setTime(e.getStart());
        deadline.setTime(e.getDeadline());

        if (e.isPublished()) {
          filteredEvaluationList.add(e);
        }

        else if (now.after(deadline) && !student.isCourseArchived()) {
          filteredEvaluationList.add(e);
        }

        else {
          if (evaluations.isEvaluationSubmitted(e, email)
              && (now.after(start))
              && !student.isCourseArchived()) {
            filteredEvaluationList.add(e);
          }
        }
      }

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.