Examples of Evaluation


Examples of teammates.jdo.Evaluation

   *         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

Examples of teammates.jdo.Evaluation

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

Examples of teammates.jdo.Evaluation

    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

Examples of teammates.jdo.Evaluation

    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

Examples of teammates.jdo.Evaluation

    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

Examples of teammates.jdo.Evaluation

   *            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

Examples of teammates.jdo.Evaluation

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

Examples of teammates.jdo.Evaluation

    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

Examples of teammates.jdo.Evaluation

    Evaluations evaluations = Evaluations.inst();

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

    Evaluation evaluation = evaluations.getEvaluation(courseID,
        evaluationName);
    deadline.setTime(evaluation.getDeadline());
    deadline.set(Calendar.MINUTE, deadline.get(Calendar.MINUTE)
        + evaluation.getGracePeriod());

    now.add(Calendar.MILLISECOND,
        (int) (60 * 60 * 1000 * evaluation.getTimeZone()));

    if (now.after(deadline)) {
      resp.getWriter().write(
          MSG_STATUS_OPENING + MSG_EVALUATION_DEADLINEPASSED
              + MSG_STATUS_CLOSING);
View Full Code Here

Examples of teammates.jdo.Evaluation

  protected void evaluationAdd() throws IOException {
    String json = req.getParameter("evaluation");

    Gson gson = new Gson();
    Evaluation e = gson.fromJson(json, Evaluation.class);

    boolean edited = Evaluations.inst().addEvaluation(e);

    // TODO take a snapshot of submissions
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.