Package projectatlast.course

Examples of projectatlast.course.Course


    int randDuration = new Random().nextInt(7*24*60*60);
    cal.add(Calendar.SECOND, randDuration);
    Date e1 = cal.getTime();

    Student student = AuthController.getCurrentStudent();
    Course analyse = Registry.courseFinder().getCourse("H01A0B");
    Activity a1 = new StudyActivity(student, "Exercises", analyse);
    a1.setStart(s1);
    a1.setEnd(e1);
    ActivityController.put(true, a1);
    resp.getWriter().println("Created: "+a1);
View Full Code Here


      Date endDate = cal.getTime();

      /*boolean isStudy = rand.nextBoolean();
      if (isStudy) {*/
        // Random data
        Course randCourse = courses.get(rand.nextInt(courses.size()));
        String randType = studyTypes
            .get(rand.nextInt(studyTypes.size()));
        String randSocial = socials.get(rand.nextInt(socials.size()));
        String randTool = tools.get(rand.nextInt(tools.size()));
        String randLocation = locations.get(rand.nextInt(locations
View Full Code Here

  }

  @Override
  public String getTitle() {
    String title = "";
    Course course = getCourse();
    if (course != null) {
      title += getCourse().getName() + ": ";
    }
    title += getTypeName();
    return title;
View Full Code Here

  @Override
  public JSONObject toJSON() throws JSONException {
    JSONObject json = super.toJSON();

    Course course = getCourse();
    json.put("course", course == null ? null : course.toJSON());
    json.put("mood", mood == null ? null : mood.toJSON());
    json.put("social", getSocial());
    json.put("tools", new JSONArray(getTools()));
    return json;
  }
View Full Code Here

        startDate = filter.from();
        stopDate = filter.to();
      } else if (option instanceof KindFilter) {
        kind = ((KindFilter) option).getKind();
      } else if (option instanceof CourseFilter) {
        Course course = ((CourseFilter) option).course();
        if (course != null)
          courseName = course.getName().toLowerCase();
      } else if (option instanceof TypeFilter) {
        type = ((TypeFilter) option).type();
      }
      parseOption(option);
    }
View Full Code Here

  private class CourseFilterParser implements OptionParser {
    @Override
    public Option parse(Map<String, String> optionMap) {
      CourseFilter filter = null;
      String courseId = optionMap.get("course");
      Course course = Registry.courseFinder().getCourse(courseId);
      if (course != null) {
        filter = new CourseFilter(course);
      }
      return filter;
    }
View Full Code Here

    }

    @Override
    public boolean stringify(Option option, Map<String, String> optionMap) {
      if (option instanceof CourseFilter) {
        Course course = ((CourseFilter) option).course();
        if (course != null) {
          optionMap.put("course", course.getId());
        }
        return true;
      }
      return false;
    }
View Full Code Here

      throws IOException {
    resp.setContentType("text/plain");

    // Bbi-sem1
    List<Course> bbi1Courses = new ArrayList<Course>();
    bbi1Courses.add(new Course("H01A8A", "Algemene en technische scheikunde", 7));
    bbi1Courses.add(new Course("H01B0A", "Toegepaste mechanica, deel 1", 5));
    bbi1Courses.add(new Course("H01A4A", "Toegepaste algebra", 5));
    bbi1Courses.add(new Course("H01A0B", "Analyse, deel 1", 6));
    bbi1Courses.add(new Course("H01C4B", "Wijsbegeerte", 3));
    bbi1Courses.add(new Course("H01B9A", "Probleemoplossen en ontwerpen, deel 1", 4));
    Registry.dao().ofy().put(bbi1Courses).keySet();
    resp.getWriter().printf("Created %d courses for Bbi-sem1", bbi1Courses.size());
    resp.getWriter().println();
    resp.getWriter().println(bbi1Courses);
   
    StudyProgram bbi1 = new StudyProgram("Bbi-sem1", "Burgerlijk ingenieur: eerste semester", bbi1Courses);
    Registry.dao().ofy().put(bbi1);
    resp.getWriter().printf("Created study program Bbi-sem1");
    resp.getWriter().println();
    resp.getWriter().println(bbi1);

    // Bbi-sem3
    List<Course> bbi3Courses = new ArrayList<Course>();
    bbi3Courses.add(new Course("H01C6A", "Organische scheikunde", 3));
    bbi3Courses.add(new Course("H01C8A", "Toegepaste mechanica, deel 2", 5));
    bbi3Courses.add(new Course("H01D8B", "Numerieke wiskunde", 4));
    bbi3Courses.add(new Course("H01A6A", "Kansrekenen en statistiek", 3));
    bbi3Courses.add(new Course("H08W0A", "Analyse, deel 3", 3));
    bbi3Courses.add(new Course("H01D2A", "Informatie-overdracht en -verwerking", 5));
    bbi3Courses.add(new Course("H01D7B", "Economie", 3));
    bbi3Courses.add(new Course("H01D4B", "Probleemoplossen en ontwerpen, deel 3", 4));
    Registry.dao().ofy().put(bbi3Courses).keySet();
    resp.getWriter().printf("Created %d courses for Bbi-sem3", bbi3Courses.size());
    resp.getWriter().println();
    resp.getWriter().println(bbi3Courses);
   
View Full Code Here

TOP

Related Classes of projectatlast.course.Course

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.