Examples of ICourse


Examples of org.olat.course.ICourse

          if (recalc) {
            upcomingWork.remove(resId);
          }
        }
        if (recalc) {
          ICourse pubCourse = CourseFactory.loadCourse(pe.getPublishedCourseResId());
          UpdateEfficiencyStatementsWorker worker = new UpdateEfficiencyStatementsWorker(pubCourse);
          updateESPool.execute(worker);
        }
      }
    }
View Full Code Here

Examples of org.olat.course.ICourse

  /**
   * @param pe
   */
  private void addToUpcomingWork(PublishEvent pe) {
    ICourse course = CourseFactory.loadCourse(pe.getPublishedCourseResId());
    boolean courseEfficiencyEnabled = course.getCourseEnvironment().getCourseConfig().isEfficencyStatementEnabled();
    if (!courseEfficiencyEnabled) {
      // no efficiency enabled, stop here.
      return;
    }
    // deleted + inserted + modified node ids -> changedNodeIds
    Set changedNodeIds = pe.getDeletedCourseNodeIds();
    changedNodeIds.addAll(pe.getInsertedCourseNodeIds());
    changedNodeIds.addAll(pe.getModifiedCourseNodeIds());
    //
    boolean courseAssessmentChanged = false;
    Structure courseRun = course.getRunStructure();
    for (Iterator iter = changedNodeIds.iterator(); iter.hasNext();) {
      String nodeId = (String) iter.next();
      boolean wasNodeAsessable = AssessmentHelper.checkIfNodeIsAssessable(courseRun.getNode(nodeId));
      boolean isNodeAssessable = AssessmentHelper.checkIfNodeIsAssessable(course.getEditorTreeModel().getCourseNode(nodeId));
      //if node was or became assessable
      if (wasNodeAsessable || isNodeAssessable) {       
        courseAssessmentChanged = true;
        break;
      }
    }
    if (!courseAssessmentChanged) {
      // assessment changes detected, stop here
      return;
    }
    synchronized (upcomingWork) { //o_clusterOK by:ld synchronized OK - only one cluster node must update the EfficiencyStatements (the course is locked for editing)
      upcomingWork.add(course.getResourceableId());
    }
    return;
  }
View Full Code Here

Examples of org.olat.course.ICourse

    boolean uLogV = isOLATAdmin;
    boolean sLogV = isOresOwner || isOresInstitutionalManager;
   
    if (AsyncExportManager.getInstance().asyncArchiveCourseLogOngoingFor(ureq.getIdentity())) {
      // then show the ongoing feedback
      ICourse course = CourseFactory.loadCourse(ores);
      final String courseTitle = course.getCourseTitle();
      showExportOngoing(courseTitle);
    } else if (isOLATAdmin || aLogV || uLogV || sLogV){
        myContent.contextPut("hasLogArchiveAccess", new Boolean(true));
      logFileChooserForm = new LogFileChooserForm("logfilechooserform", getTranslator(), ureq.getLocale(), isOLATAdmin, aLogV, uLogV, sLogV);
      logFileChooserForm.addListener(this);
      myContent.put(logFileChooserForm);
      ICourse course = CourseFactory.loadCourse(ores);
      myContent.contextPut("body", translate("course.logs.existingarchiveintro", course.getCourseTitle()));
      showFileButton = LinkFactory.createButton("showfile", myContent, this);
      File exportDir = CourseFactory.getDataExportDirectory(ureq.getIdentity(), course.getCourseTitle());
      boolean exportDirExists = false;
      if (exportDir!=null && exportDir.exists() && exportDir.isDirectory()) {
        exportDirExists = true;
      }
      myContent.contextPut("hascourselogarchive", new Boolean(exportDirExists));
View Full Code Here

Examples of org.olat.course.ICourse

        final Date end = logFileChooserForm.getEndDate();
       
        UserManager um = UserManager.getInstance();
        final String charset = um.getUserCharset(ureq.getIdentity());
       
        ICourse course = CourseFactory.loadCourse(ores);
        final String courseTitle = course.getCourseTitle();
        final String targetDir = CourseFactory.getOrCreateDataExportDirectory(ureq.getIdentity(), courseTitle).getPath();
       
        final Long resId = ores.getResourceableId();
        final Locale theLocale = ureq.getLocale();
        final String email = ureq.getIdentity().getUser().getProperty(UserConstants.EMAIL, ureq.getLocale());
       
       
        AsyncExportManager.getInstance().asyncArchiveCourseLogFiles(ureq.getIdentity(), new Runnable() {

          @Override
          public void run() {
            showExportFinished();
          }
         
        },
        resId, targetDir, begin, end, logAdminChecked, logUserChecked, logStatisticChecked, charset, theLocale, email);

        showExportOngoing(courseTitle);
      }
      else if (event == Form.EVNT_FORM_CANCELLED) {
        myPanel.setContent(myContent);
      }
    }
    else if (source == showFileButton){
      ICourse course = CourseFactory.loadCourse(ores);
      String personalFolderDir = CourseFactory.getPersonalDirectory(ureq.getIdentity()).getPath();
      String targetDir = CourseFactory.getOrCreateDataExportDirectory(ureq.getIdentity(), course.getCourseTitle()).getPath();
     
      String relPath = "";
     
      if (targetDir.startsWith(personalFolderDir)) {
        // that should always be the case
View Full Code Here

Examples of org.olat.course.ICourse

    // initialize polling
    myPanel.put("updatecontrol", new JSAndCSSComponent("intervall", this.getClass(), null, null, false, null, 3000));
  }

  protected void showExportFinished() {
    ICourse course = CourseFactory.loadCourse(ores);
    VelocityContainer vcFeedback = createVelocityContainer("courselogs_feedback");
    showFileButton = LinkFactory.createButton("showfile", vcFeedback, this);
    vcFeedback.contextPut("body", translate("course.logs.feedback", course.getCourseTitle()));
    myPanel.setContent(vcFeedback);

    // note: polling can't be switched off unfortunatelly
    //       this is due to the fact that the jsandcsscomponent can only modify
    //       certain parts of the page and it would require a full page refresh
    //       to get rid of the poller - and that's not possible currently

    showInfo("course.logs.finished", course.getCourseTitle());
  }
View Full Code Here

Examples of org.olat.course.ICourse

    for (Iterator iter = identities.iterator(); iter.hasNext();) {
      Identity identity = (Identity) iter.next();
      if (identity != null){ 
        IdentityEnvironment ienv = new IdentityEnvironment();
        ienv.setIdentity(identity);
        ICourse course = CourseFactory.loadCourse(ores);
        UserCourseEnvironment uce = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
        ScoreEvaluation scoreEvaluation = uce.getScoreAccounting().getScoreEvaluation(courseNode);
       
        if(scoreEvaluation == null){
          nodePassedResults.add(translator.translate("bulk.action.no.value"));
        }else{
View Full Code Here

Examples of org.olat.course.ICourse

        // TODO:RH:improvement: this should use a callback method or send a general delete
        // event so that the course can take care of this rather than having it
        // here hardcoded
        OLATResourceImpl courseResource = ref.getSource();
        //ICourse course = CourseFactory.loadCourse(courseResource);
        ICourse course = CourseFactory.openCourseEditSession(courseResource.getResourceableId());
        CourseConfig cc = course.getCourseEnvironment().getCourseConfig();
        cc.setGlossarySoftKey(null);
        CourseFactory.setCourseConfig(course.getResourceableId(), cc);
        CourseFactory.closeCourseEditSession(course.getResourceableId(),true);
        // remove reference from the references table
        refM.delete(ref);
      }
    }
    // now remove the resource itself
View Full Code Here

Examples of org.olat.course.ICourse

   *      org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
   */
  public void event(UserRequest ureq, Controller source, Event event) {
    if (source == nodeListCtr) {
      if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
        ICourse course = CourseFactory.loadCourse(ores);
        TableEvent te = (TableEvent) event;
        String actionid = te.getActionId();
        if (actionid.equals(CMD_SELECT_NODE)) {
          int rowid = te.getRowId();
          Map nodeData = (Map) nodeTableModel.getObject(rowid);
          CourseNode node = course.getRunStructure().getNode((String) nodeData.get(AssessmentHelper.KEY_IDENTIFYER));
          this.currentCourseNode = node;
          archiveNode(ureq);         
          showInfo("archive."+nodeType.getType()+".successfully");
        }
      }
View Full Code Here

Examples of org.olat.course.ICourse

    nodeListCtr.addColumnDescriptor(new CustomRenderColumnDescriptor("table.header.node", 0, null, ureq.getLocale(),
        ColumnDescriptor.ALIGNMENT_LEFT, new IndentedNodeRenderer()));
    nodeListCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.action.select", 1, CMD_SELECT_NODE, ureq.getLocale()));

    // get list of course node data and populate table data model
    ICourse course = CourseFactory.loadCourse(ores);
    CourseNode rootNode = course.getRunStructure().getRootNode();
    List nodesTableObjectArrayList = addNodesAndParentsToList(0, rootNode);

    // only populate data model if data available
    if (nodesTableObjectArrayList == null) {
      nodeChoose.contextPut("hasNodes", Boolean.FALSE);
View Full Code Here

Examples of org.olat.course.ICourse

    }
    return null;
  }

  protected boolean archiveNode(UserRequest ureq) {
    ICourse course = CourseFactory.loadCourse(ores);
    File exportDir = CourseFactory.getOrCreateDataExportDirectory(ureq.getIdentity(), course.getCourseTitle());
    UserManager um = UserManager.getInstance();
    String charset = um.getUserCharset(ureq.getIdentity());
    currentCourseNode.archiveNodeData(ureq.getLocale(), course, exportDir, charset);
    return true;
  }
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.