Package org.olat.course

Examples of org.olat.course.ICourse


          // 3. loop over all node-id e.g. 78933379704296
          for (int nodeIndex = 0; nodeIndex < nodeDirs.length; nodeIndex++) {
            if (log.isDebug())  log.debug("process dir=" + nodeDirs[nodeIndex].getAbsolutePath());
            String currentNodeId =  nodeDirs[nodeIndex].getName();
            if (log.isDebug()) log.debug("currentNodeId=" + currentNodeId);
            ICourse currentCourse = CourseFactory.loadCourse(Long.parseLong(currentCourseId));
            if (isTaskNode(currentCourse, currentNodeId)) {
              if (log.isDebug()) log.debug("found TACourseNode path=" + nodeDirs[nodeIndex].getAbsolutePath());
              deleteUserDirectory(identity, nodeDirs[nodeIndex]);
            } else if (isProjectBrokerNode(currentCourse, currentNodeId)) {
              if (log.isDebug()) log.debug("found ProjectBrokerCourseNode path=" + nodeDirs[nodeIndex].getAbsolutePath());
View Full Code Here


  public List doAction(List identitiesAndTheirsNodePassed) {
    if (this.ores == null || this.courseNode == null || this.coachIdentity == null){
      throw new AssertException("use constructor with course, assessable coursnode and coachidentity");
    }
    List feedbacks = new ArrayList(identitiesAndTheirsNodePassed.size());
    ICourse course = CourseFactory.loadCourse(ores);
    for (Iterator iter = identitiesAndTheirsNodePassed.iterator(); iter.hasNext();) {
      Object[] identityAndItsNodePassed = (Object[]) iter.next();
      if (identityAndItsNodePassed[0] != null){
       
        if (allowedIdKeys.contains(((Identity)identityAndItsNodePassed[0]).getKey())){
          IdentityEnvironment ienv = new IdentityEnvironment();
          ienv.setIdentity((Identity)identityAndItsNodePassed[0]);
          UserCourseEnvironment uce = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
          String nodePassed = (String) identityAndItsNodePassed[1];
          if((nodePassed != null && nodePassed.equals("y")) || (nodePassed != null && nodePassed.equals("n"))){
            if (hasPassed && cut == null){ // Configuration of manual assessment --> Display passed/not passed: yes, Type of display: Manual by tutor
                ScoreEvaluation seOld = courseNode.getUserScoreEvaluation(uce);
                Float score = seOld.getScore();
View Full Code Here

        return trans.translate("tool.actiontext");
      }

      public Controller createController(UserRequest ureq, WindowControl wControl, Object arg) {
        if (arg instanceof ICourse) {
          ICourse course = (ICourse) arg;
          Controller ctr = new CampusManagementController(ureq, wControl, course);
          return ctr;
        } else throw new AssertException("SAPCampusMgntExtension needs a ICourse as the argument parameter: arg = "+arg);
      }
    });
View Full Code Here

  protected void event(UserRequest ureq, Component source, Event event) {
  //
  }

  private void init(UserRequest ureq, CalCourseNode courseNode, UserCourseEnvironment courseEnv) {
    ICourse course = CourseFactory.loadCourse(courseEnv.getCourseEnvironment().getCourseResourceableId());
    CourseCalendars myCal = CourseCalendars.createCourseCalendarsWrapper(ureq, getWindowControl(), course);

    Date refDate;
    ModuleConfiguration config = courseNode.getModuleConfiguration();
    if (CalEditController.getAutoDate(config)) {
View Full Code Here

   *
   * @param courseId the resourceable id of the course to signal news about
   * @param ident the identity to ignore news for
   */
  public void markPublisherNews(Identity ident, Long courseId) {
    ICourse course = loadCourseFromId(courseId);
    if (course == null) throw new AssertException("course with id " + courseId + " not found!");
    markPublisherNews(ident, course);
  }
View Full Code Here

      // do not try to create a subscription info if state is deleted - results in
      // exceptions, course
      // can't be loaded when already deleted
      if (NotificationsManager.getInstance().isPublisherValid(p) && compareDate.before(latestNews)) {
        Long courseId = new Long(p.getData());
        final ICourse course = loadCourseFromId(courseId);
        if (course != null) {
          // course admins or users with the course right to have full access to
          // the assessment tool will have full access to user tests
          CourseGroupManager cgm = course.getCourseEnvironment().getCourseGroupManager();
          final boolean hasFullAccess = (cgm.isIdentityCourseAdministrator(identity) ? true : cgm.hasRight(identity,
              CourseRights.RIGHT_ASSESSMENT));
          final List<Identity> coachedUsers = new ArrayList<Identity>();
          if (!hasFullAccess) {
            // initialize list of users, only when user has not full access
            List<BusinessGroup> coachedGroups = cgm.getOwnedLearningGroupsFromAllContexts(identity);
            Manager securityManager = ManagerFactory.getManager();
            for (Iterator<BusinessGroup> iter = coachedGroups.iterator(); iter.hasNext();) {
              BusinessGroup group = iter.next();
              coachedUsers.addAll(securityManager.getIdentitiesOfSecurityGroup(group.getPartipiciantGroup()));
            }
          }

          List<IQTESTCourseNode> testNodes = getCourseTestNodes(course);
          Translator translator = Util.createPackageTranslator(AssessmentNotificationsHandler.class, locale);

          String title = translator.translate("notifications.header", new String[]{course.getCourseTitle()});
          si = new SubscriptionInfo(new TitleItem(title, CSS_CLASSS_IQTEST_ICON), null);

          for (Iterator<IQTESTCourseNode> i = testNodes.iterator(); i.hasNext();) {
            IQTESTCourseNode test = i.next();

            QTIResultManager qrm = QTIResultManager.getInstance();
            List testResultSets = qrm.getResultSets(course.getResourceableId(), test.getIdent(),
                test.getReferencedRepositoryEntry().getKey(), null);

            for (Iterator j = testResultSets.iterator(); j.hasNext();) {
              QTIResultSet qrs = (QTIResultSet) j.next();
              // - modify date on test set must be newer than last visit of
View Full Code Here

  }

  @Override
  public String createTitleInfo(Subscriber subscriber, Locale locale) {
    try {
      ICourse course = CourseFactory.loadCourse(subscriber.getPublisher().getResId());
      Translator trans = Util.createPackageTranslator(AssessmentNotificationsHandler.class, locale);
      String title = trans.translate("notifications.title", new String[]{ course.getCourseTitle() });
      return title;
    } catch (Exception e) {
      log.error("Error while creating assessment notifications for subscriber: " + subscriber.getKey(), e);
      checkPublisher(subscriber.getPublisher());
      return "-";
View Full Code Here

    super(ureq, wControl);
    this.courseEnv = cenv;
    this.config = calCourseNode.getModuleConfiguration();
    mainVC = createVelocityContainer("run");

    ICourse course = CourseFactory.loadCourse(cenv.getCourseResourceableId());
    CourseCalendars myCal = CourseCalendars.createCourseCalendarsWrapper(ureq, wControl, course);
    CourseCalendarSubscription calSubscription = myCal.createSubscription(ureq);
    if(CalEditController.getAutoSubscribe(config)) {
      if(!calSubscription.isSubscribed()) {
        calSubscription.subscribe(false);
View Full Code Here

  public static CourseCalendars createCourseCalendarsWrapper(UserRequest ureq, WindowControl wControl, OLATResourceable ores) {
    List<KalendarRenderWrapper> calendars = new ArrayList<KalendarRenderWrapper>();
    CalendarManager calendarManager = CalendarManagerFactory.getInstance().getCalendarManager();
    // add course calendar
    ICourse course = CourseFactory.loadCourse(ores);
    KalendarRenderWrapper courseKalendarWrapper = calendarManager.getCourseCalendar(course);
    CourseGroupManager cgm = course.getCourseEnvironment().getCourseGroupManager();
    Identity identity = ureq.getIdentity();
    boolean isPrivileged = cgm.isIdentityCourseAdministrator(identity)
        || cgm.hasRight(identity, CourseRights.RIGHT_COURSEEDITOR)
        || RepositoryManager.getInstance().isInstitutionalRessourceManagerFor(
            RepositoryManager.getInstance().lookupRepositoryEntry(course, false), identity);
View Full Code Here

    // Intro page, static
    index = createVelocityContainer("assessment_index");
   
    Identity focusOnIdentity = null;
    ICourse course = CourseFactory.loadCourse(ores);
    boolean hasAssessableNodes = course.hasAssessableNodes();
    if (hasAssessableNodes) {
      BusinessControl bc = getWindowControl().getBusinessControl();
      ContextEntry ceIdentity = bc.popLauncherContextEntry();
      if (ceIdentity != null) {
        OLATResourceable oresIdentity = ceIdentity.getOLATResourceable();
        if (OresHelper.isOfType(oresIdentity, Identity.class)) {
          Long identityKey = oresIdentity.getResourceableId();
          focusOnIdentity = ManagerFactory.getManager().loadIdentityByKey(identityKey);
        }
      }

      index.contextPut("hasAssessableNodes", Boolean.TRUE);
     
      // --- assessment notification subscription ---
      AssessmentNotificationsHandler anh = AssessmentNotificationsHandler.getInstance();
      SubscriptionContext subsContext = anh.getAssessmentSubscriptionContext(ureq.getIdentity(), course);
      if (subsContext != null) {
        PublisherData pData = anh.getAssessmentPublisherData(course, wControl.getBusinessControl().getAsString());
        csc = new ContextualSubscriptionController(ureq, getWindowControl(), subsContext, pData);
        listenTo(csc); // cleanup on dispose
        index.put("assessmentSubscription", csc.getInitialComponent());
      }
     
      // Wrapper container: adds header
      wrapper = createVelocityContainer("wrapper");
     
      // Init the group and the user chooser view velocity container
      groupChoose = createVelocityContainer("groupchoose");
      allUsersButton = LinkFactory.createButtonSmall("cmd.all.users", groupChoose, this);
      groupChoose.contextPut("isFiltering", Boolean.TRUE);
      backLinkGC = LinkFactory.createLinkBack(groupChoose, this);
 
      userChoose = createVelocityContainer("userchoose");
      showAllCourseNodesButton = LinkFactory.createButtonSmall("cmd.showAllCourseNodes", userChoose, this);
      filterCourseNodesButton  = LinkFactory.createButtonSmall("cmd.filterCourseNodes", userChoose, this);
      userChoose.contextPut("isFiltering", Boolean.TRUE);
      backLinkUC = LinkFactory.createLinkBack(userChoose, this);
     
      nodeChoose = createVelocityContainer("nodechoose");

      // Initialize all groups that the user is allowed to coach
      coachedGroups = getAllowedGroupsFromGroupmanagement(ureq.getIdentity());

      // preload the assessment cache to speed up everything as background thread
      // the thread will terminate when finished
      assessmentCachPreloaderThread = new AssessmentCachePreloadThread("assessmentCachPreloader-" + course.getResourceableId());
      assessmentCachPreloaderThread.setDaemon(true);
      assessmentCachPreloaderThread.start();
     
    } else {
      index.contextPut("hasAssessableNodes", Boolean.FALSE);     
    }
     
    // Navigation menu
    menuTree = new MenuTree("menuTree");
    TreeModel tm = buildTreeModel(hasAssessableNodes);
    menuTree.setTreeModel(tm);
    menuTree.setSelectedNodeId(tm.getRootNode().getIdent());
    menuTree.addListener(this);

    // Tool and action box
    toolC = ToolFactory.createToolController(getWindowControl());
    listenTo(toolC);
    toolC.addHeader(translate("tool.name"));
    toolC.addLink("cmd.close", translate("command.closeassessment"), null, "b_toolbox_close");

    // Start on index page
    main.setContent(index);
    LayoutMain3ColsController columLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), menuTree, toolC.getInitialComponent(), main, "course" + course.getResourceableId());
    listenTo(columLayoutCtr); // cleanup on dispose
    putInitialPanel(columLayoutCtr.getInitialComponent());
   
    if(focusOnIdentity != null) {
      //fill the user list for the
      this.mode = MODE_USERFOCUS;
      this.identitiesList = getAllIdentitisFromGroupmanagement();
      doSimpleUserChoose(ureq, this.identitiesList);
     
      GenericTreeModel menuTreeModel = (GenericTreeModel)menuTree.getTreeModel();
      TreeNode userNode = menuTreeModel.findNodeByUserObject(CMD_USERFOCUS);
      if(userNode != null) {
        menuTree.setSelectedNode(userNode);
      }
     
      // select user
      this.assessedIdentityWrapper = AssessmentHelper.wrapIdentity(focusOnIdentity, this.localUserCourseEnvironmentCache, course, null);
     
      UserCourseEnvironment chooseUserCourseEnv = assessedIdentityWrapper.getUserCourseEnvironment();   
      identityAssessmentController = new IdentityAssessmentEditController(getWindowControl(),ureq, chooseUserCourseEnv, course, true);
      listenTo(identityAssessmentController);
      setContent(identityAssessmentController.getInitialComponent());
    }
   
    // Register for assessment changed events
    course.getCourseEnvironment().getAssessmentManager().registerForAssessmentChangeEvents(this, ureq.getIdentity());
  }
View Full Code Here

TOP

Related Classes of org.olat.course.ICourse

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.