Package teammates.jdo

Examples of teammates.jdo.Evaluation


      throws EvaluationExistsException {
    if (getEvaluation(courseID, name) != null) {
      throw new EvaluationExistsException();
    }
 
    Evaluation evaluation = new Evaluation(courseID, name, instructions,
        commentsEnabled, start, deadline, timeZone, gracePeriod);

    try {
      getPM().makePersistent(evaluation);
    } finally {
View Full Code Here


   * @param name
   *            the evaluation name (Pre-condition: The courseID and
   *            evaluationName pair must be valid)
   */
  public void deleteEvaluation(String courseID, String name) {
    Evaluation evaluation = getEvaluation(courseID, name);

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

   *         otherwise
   */
  public boolean editEvaluation(String courseID, String name,
      String newInstructions, boolean newCommentsEnabled, Date newStart,
      Date newDeadline, int newGracePeriod) {
    Evaluation evaluation = getEvaluation(courseID, name);
    Transaction tx = getPM().currentTransaction();
    try {
      tx.begin();

      evaluation.setInstructions(newInstructions);
      evaluation.setStart(newStart);
      evaluation.setDeadline(newDeadline);
      evaluation.setGracePeriod(newGracePeriod);
      evaluation.setCommentsEnabled(newCommentsEnabled);

      getPM().flush();

      tx.commit();
    } finally {
View Full Code Here

   * @param name
   *            the evaluation name (Pre-condition: The courseID and
   *            evaluationName pair must be valid)
   */
  public boolean closeEvaluation(String courseID, String name) {
    Evaluation evaluation = getEvaluation(courseID, name);

    int oneday = 24 * 60 * 60 * 1000;
    Date start = new Date(System.currentTimeMillis() - 2 * oneday);
    Date end = new Date(System.currentTimeMillis() - oneday);

    evaluation.setStart(start);
    evaluation.setDeadline(end);
    // evaluation.setActivated(false);

    return true;
  }
View Full Code Here

    Transaction trans = getPM().currentTransaction();
    try {
      trans.begin();

      Evaluation evaluation = getEvaluation(courseID, name);

      if (evaluation == null)
        return false;

      long oneday = 24 * 60 * 60 * 1000;
      Date start = new Date(System.currentTimeMillis() - oneday);
      Date end = new Date(System.currentTimeMillis() + oneday);
      evaluation.setStart(start);
      evaluation.setDeadline(end);
      evaluation.setActivated(true);

      getPM().flush();
      trans.commit();

    } finally {
View Full Code Here

    Transaction trans = getPM().currentTransaction();
    try {

      trans.begin();

      Evaluation evaluation = getEvaluation(courseID, name);

      int oneday = 24 * 60 * 60 * 1000;
      Date start = new Date(System.currentTimeMillis() + oneday);
      Date end = new Date(System.currentTimeMillis() + oneday * 2);
      evaluation.setActivated(false);
      evaluation.setStart(start);
      evaluation.setDeadline(end);

      getPM().flush();
      trans.commit();

    } finally {
View Full Code Here

    Queue queue = QueueFactory.getQueue("email-queue");
    List<TaskOptions> taskOptionsList = new ArrayList<TaskOptions>();

    DateFormat df = new SimpleDateFormat("dd/MM/yyyy HHmm");

    Evaluation evaluation = getEvaluation(courseID, evaluationName);

    Date start = evaluation.getStart();
    Date deadline = evaluation.getDeadline();
    String instructions = evaluation.getInstructions();

    for (Student s : studentList) {
      // There is a limit of 100 tasks per batch addition to Queue in
      // Google App
      // Engine
View Full Code Here

   *            the evaluation name (Pre-condition: The courseID and name pair
   *            must be valid)
   */
  public boolean publishEvaluation(String courseID, String name,
      List<Student> studentList) {
    Evaluation evaluation = getEvaluation(courseID, name);

    evaluation.setPublished(true);

    informStudentsOfPublishingOfEvaluationResults(studentList, courseID,
        name);

    return true;
View Full Code Here

   * @param name
   *            the evaluation name (Pre-condition: The courseID and name pair
   *            must be valid)
   */
  public boolean unpublishEvaluation(String courseID, String name) {
    Evaluation evaluation = getEvaluation(courseID, name);

    evaluation.setPublished(false);

    return true;
  }
View Full Code Here

    Courses courses = Courses.inst();
    List<Student> studentList = courses.getStudentList(courseID);

    // Filter out students who have submitted the evaluation
    Evaluations evaluations = Evaluations.inst();
    Evaluation evaluation = evaluations.getEvaluation(courseID,
        evaluationName);

    if (evaluation == null) {
      System.err
          .println(String
              .format("Evaluation not found. CourseID = %s. Evaluation Name = %s",
                  courseID, evaluationName));
      return;
    }

    List<Student> studentsToRemindList = new ArrayList<Student>();

    for (Student s : studentList) {
      if (!evaluations.isEvaluationSubmitted(evaluation, s.getEmail())) {
        studentsToRemindList.add(s);
      }
    }

    Date deadline = evaluation.getDeadline();

    evaluations.remindStudents(studentsToRemindList, courseID,
        evaluationName, deadline);

  }
View Full Code Here

TOP

Related Classes of teammates.jdo.Evaluation

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.