Package org.olat.course

Examples of org.olat.course.ICourse


    }
  }

  @Override
  protected void event(UserRequest ureq, Controller source, Event event) {
    ICourse course = CourseFactory.loadCourse(ores);
    if(manageDatesForm == source) {
      //generate the dates and put them into the table
      editTableDataList = denManager.generateDates(manageDatesForm.getSubject(), manageDatesForm.getComment(), manageDatesForm
          .getLocation(), manageDatesForm.getDuration(), manageDatesForm.getPause(), manageDatesForm.getBeginDate(), manageDatesForm
          .getRetakes(), manageDatesForm.getNumParts(), editTableDataList, denCourseNode.getIdent());
View Full Code Here


    return true;
  }

  public String createTitleInfo(Subscriber subscriber, Locale locale) {
    try {
      ICourse course = CourseFactory.loadCourse(subscriber.getPublisher().getResId());
      final Translator translator = Util.createPackageTranslator(AbstractTaskNotificationHandler.class, locale);
      return translator.translate(getNotificationHeaderKey(), new String[]{course.getCourseTitle()});
    } catch (Exception e) {
      getLogger().error("Error while creating task notifications for subscriber: " + subscriber.getKey(), e);
      checkPublisher(subscriber.getPublisher());
      return "-";
    }
View Full Code Here

    runDENTable = denManager.createRunDatesTable(ureq, wControl, getTranslator(), this, runTableData);

    runVC = new VelocityContainer("dateVC", VELOCITY_ROOT + "/run.html", getTranslator(), this);
   
    //show only the options for managing dates and participants if user is admin or course coach
    ICourse course = CourseFactory.loadCourse(ores);
    CourseGroupManager cgm = course.getCourseEnvironment().getCourseGroupManager();
    if(cgm.isIdentityCourseAdministrator(ureq.getIdentity()) || cgm.isIdentityCourseCoach(ureq.getIdentity())) {
      // subscription
      subsContext = new SubscriptionContext(course, courseNode.getIdent());
      // if sc is null, then no subscription is desired
      if (subsContext != null) {
        String businessPath = wControl.getBusinessControl().getAsString();
        PublisherData pdata = new PublisherData(OresHelper.calculateTypeName(DENCourseNode.class), String.valueOf(course.getResourceableId()), businessPath);
        csc = new ContextualSubscriptionController(ureq, getWindowControl(), subsContext, pdata);
        runVC.put("subscription", csc.getInitialComponent());
      }
     
      authorOptions = new AuthorOptionsForm(ureq, getWindowControl());
View Full Code Here

  public List doAction(List identitiesAndTheirsUserComments) {
    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(identitiesAndTheirsUserComments.size());
    ICourse course = CourseFactory.loadCourse(ores);
    for (Iterator iter = identitiesAndTheirsUserComments.iterator(); iter.hasNext();) {
      Object[] identityAndItsUserComment = (Object[]) iter.next();
      if (identityAndItsUserComment[0] != null){
       
        if (allowedIdKeys.contains(((Identity)identityAndItsUserComment[0]).getKey())){
          IdentityEnvironment ienv = new IdentityEnvironment();
          ienv.setIdentity((Identity)identityAndItsUserComment[0]);
          UserCourseEnvironment uce = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
          String userComment = (String) identityAndItsUserComment[1];
          if(userComment != null && !userComment.equals("")){
            if (hasUserComment){
                // Update userComment in db
                courseNode.updateUserUserComment(userComment, uce, coachIdentity);
View Full Code Here

  /**
   * @see org.olat.course.assessment.AssessmentManager#incrementNodeAttempts(org.olat.course.nodes.CourseNode,
   *      org.olat.core.id.Identity)
   */
  public void incrementNodeAttempts(final CourseNode courseNode, final Identity identity, final UserCourseEnvironment userCourseEnv) {
    ICourse course = CourseFactory.loadCourse(ores);
    final CoursePropertyManager cpm = course.getCourseEnvironment().getCoursePropertyManager();
    long attempts = CoordinatorManager.getCoordinator().getSyncer().doInSync(createOLATResourceableForLocking(identity), new SyncerCallback<Long>(){
      public Long execute() {
        long attempts = incrementNodeAttemptsProperty(courseNode, identity, cpm);
        if(courseNode instanceof AssessableCourseNode) {
          // Update users efficiency statement
View Full Code Here

  }

  // package local for perf. reasons
  void courseLog(ILoggingAction action, CourseNode cn, LoggingResourceable... details) {
    if (Settings.isJUnitTest()) return;
    ICourse course = CourseFactory.loadCourse(ores);
   
    LoggingResourceable[] infos = new LoggingResourceable[2+details.length];
    infos[0] = LoggingResourceable.wrap(course);
    infos[1] = LoggingResourceable.wrap(cn);
    for (int i = 0; i < details.length; i++) {
View Full Code Here

   *
   * @see org.olat.course.assessment.AssessmentManager#saveScoreEvaluation(org.olat.course.nodes.CourseNode, org.olat.core.id.Identity, org.olat.core.id.Identity, org.olat.course.run.scoring.ScoreEvaluation)
   */
  public void saveScoreEvaluation(final CourseNode courseNode, final Identity identity, final Identity assessedIdentity, final ScoreEvaluation scoreEvaluation,
      final UserCourseEnvironment userCourseEnv, final boolean incrementUserAttempts) {
    ICourse course = CourseFactory.loadCourse(ores);
    final CoursePropertyManager cpm = course.getCourseEnvironment().getCoursePropertyManager();
    // o_clusterREVIEW we could sync on a element finer than course, e.g. the composite course+assessIdentity.
    // +: concurrency would be higher
    // -: many entries (num of courses * visitors of given course) in the locktable.
    // we could also sync on the assessedIdentity.
   
    Codepoint.codepoint(NewCachePersistingAssessmentManager.class, "beforeSyncUpdateUserEfficiencyStatement");
    Long attempts = CoordinatorManager.getCoordinator().getSyncer().doInSync(createOLATResourceableForLocking(assessedIdentity), new SyncerCallback<Long>(){
      public Long execute() {
        Long attempts = null;
        Codepoint.codepoint(NewCachePersistingAssessmentManager.class, "doInSyncUpdateUserEfficiencyStatement");
        saveNodeScore(courseNode, identity, assessedIdentity, scoreEvaluation.getScore(), cpm);
        saveNodePassed(courseNode, identity, assessedIdentity, scoreEvaluation.getPassed(), cpm);
        saveAssessmentID(courseNode, assessedIdentity, scoreEvaluation.getAssessmentID(), cpm);       
        if(incrementUserAttempts) {
          attempts = incrementNodeAttemptsProperty(courseNode, assessedIdentity, cpm);
        }
        if(courseNode instanceof AssessableCourseNode) {
          userCourseEnv.getScoreAccounting().scoreInfoChanged((AssessableCourseNode)courseNode, scoreEvaluation);
          // Update users efficiency statement
          EfficiencyStatementManager esm =  EfficiencyStatementManager.getInstance();
          esm.updateUserEfficiencyStatement(userCourseEnv);
        }
        return attempts;
      }});
    // here used to be a codepoint which lead to error (OLAT-3570) in AssessmentWithCodepointsTest.
    // The reason for this error was that the AuditManager appendToUserNodeLog() is not synchronized, so could be called by several threads simultaneously.
    // The end effect of this error is data inconsistency: the score/passed info is stored but the userNodeLog info is not updated and the AssessmentChangedEvent is not fired.
    // This case is very seldom, but could be avoided if the test could be protected by a lock.
   
   
    // node log
    UserNodeAuditManager am = course.getCourseEnvironment().getAuditManager();
    am.appendToUserNodeLog(courseNode, identity, assessedIdentity, SCORE + " set to: " + String.valueOf(scoreEvaluation.getScore()));
    if(scoreEvaluation.getPassed()!=null) {
      am.appendToUserNodeLog(courseNode, identity, assessedIdentity, PASSED + " set to: " + scoreEvaluation.getPassed().toString());
    } else {
       am.appendToUserNodeLog(courseNode, identity, assessedIdentity, PASSED + " set to \"undefined\"");
View Full Code Here

    return  result.booleanValue();
  }

  @Override
  public void sendGroupChangeEvent(Project project, Long courseResourceableId, Identity identity) {
    ICourse course = CourseFactory.loadCourse(courseResourceableId);
    RepositoryEntry ores = RepositoryManager.getInstance().lookupRepositoryEntry(course, true);
    MultiUserEvent modifiedEvent = new BusinessGroupModifiedEvent(BusinessGroupModifiedEvent.IDENTITY_ADDED_EVENT, project.getProjectGroup(), identity);
    CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(modifiedEvent, ores);
  }
View Full Code Here

          LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), null, null, displayController.getInitialComponent(), null);
          listenTo(layoutCtr); // autodispose
 
          //need to wrap a course restart controller again, because IQDisplay
          //runs on top of GUIStack
          ICourse course = CourseFactory.loadCourse(callingResId);
          RepositoryEntry courseRepositoryEntry = RepositoryManager.getInstance().lookupRepositoryEntry(course, true);
          Panel empty = new Panel("empty");//empty panel set as "menu" and "tool"
          Controller courseCloser = CourseFactory.createDisposedCourseRestartController(ureq, getWindowControl(), courseRepositoryEntry.getResourceableId());
          Controller disposedRestartController = new LayoutMain3ColsController(ureq, getWindowControl(), empty, empty, courseCloser.getInitialComponent(), "disposed course whily in iqRun" + callingResId);
          layoutCtr.setDisposedMessageController(disposedRestartController);
View Full Code Here

   * @see org.olat.navigation.SiteInstance#createController(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
   */
  public MainLayoutController createController(UserRequest ureq, WindowControl wControl) {
    RepositoryManager rm = RepositoryManager.getInstance();
    RepositoryEntry entry = rm.lookupRepositoryEntryBySoftkey(repositorySoftKey, true);
    ICourse course = CourseFactory.loadCourse(entry.getOlatResource());
    RunMainController c = new RunMainController(ureq, wControl, course, null, false, true);   
    // needed for css style reasons: a site own the whole content area and needs either to use a MenuAndToolController for the 3-columns layout or,
    // like here, the contentOnlyController
    //ContentOnlyController coc = new ContentOnlyController(ureq, wControl, c);
    return c;
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.