Package org.olat.course.properties

Examples of org.olat.course.properties.CoursePropertyManager


  /**
   * @see org.olat.course.nodes.CourseNode#cleanupOnDelete(org.olat.course.ICourse)
   */
  public void cleanupOnDelete(ICourse course) {
    CoursePropertyManager pm = course.getCourseEnvironment().getCoursePropertyManager();
    // 1) Delete all properties: score, passed, log, comment, coach_comment,
    // attempts
    pm.deleteNodeProperties(this, null);
    // 2) Delete all user files for this scorm node
    // FIXME gs
    // it is problematic that the data is stored using username/courseid-scormid/
    // much better would be /courseid-scormid/username/
    // I would consider refatoring this and setting up an upgrade task that moves the
View Full Code Here


  /**
   * @see org.olat.course.nodes.CourseNode#cleanupOnDelete(org.olat.course.ICourse)
   */
  public void cleanupOnDelete(ICourse course) {
    CoursePropertyManager pm = course.getCourseEnvironment().getCoursePropertyManager();
    // 1) Delete all properties: score, passed, log, comment, coach_comment,
    // attempts
    pm.deleteNodeProperties(this, null);
    // 2) Delete all qtiresults for this node
    String repositorySoftKey = (String) getModuleConfiguration().get(IQEditController.CONFIG_KEY_REPOSITORY_SOFTKEY);
    Long repKey = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(repositorySoftKey, true).getKey();
    QTIResultManager.getInstance().deleteAllResults(course.getResourceableId(), this.getIdent(), repKey);
  }
View Full Code Here

    vfButton = LinkFactory.createButton("link.solutionFolder", solutionVC, this);
  }

  private VFSSecurityCallback getTaskFolderSecCallback(String relPath) {
    // check if any tasks assigned yet
    CoursePropertyManager cpm = PersistingCoursePropertyManager.getInstance(course);
    List assignedProps = cpm.listCourseNodeProperties(node, null, null, TaskController.PROP_ASSIGNED);
//    return new TaskFolderCallback(relPath, (assignedProps.size() > 0));
    return new TaskFolderCallback(relPath, false); // do not look task folder
  }
View Full Code Here

  @Override
  public void event(UserRequest ureq, Component source, Event event) {   
    if (log.isDebug()) log.debug("event source=" + source + " " + event.toString());   
    if (source == btfButton){
      // check if there are already assigned tasks
      CoursePropertyManager cpm = PersistingCoursePropertyManager.getInstance(course);
      List assignedProps = cpm.listCourseNodeProperties(node, null, null, TaskController.PROP_ASSIGNED);
      if (assignedProps.size() == 0) {
        // no task assigned
        String relPath = TACourseNode.getTaskFolderPathRelToFolderRoot(course, node);
        OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(relPath, null);
        OlatNamedContainerImpl namedFolder = new OlatNamedContainerImpl(translate("taskfolder"), rootFolder);
View Full Code Here

    CourseNode node = getUserCourseEnv().getCourseEnvironment().getRunStructure().getNode(nodeId)
    // invalid node id's return still a valid double
    //TODO fg: check with editor tree model DONE: above checks ensure correct node references
    //if (node == null) return new Double(Double.NEGATIVE_INFINITY);

    CoursePropertyManager pm = getUserCourseEnv().getCourseEnvironment().getCoursePropertyManager();
    Identity identity = getUserCourseEnv().getIdentityEnvironment().getIdentity();
   
    Property recentTime = pm.findCourseNodeProperty(node,
        identity, null, ENCourseNode.PROPERTY_RECENT_ENROLLMENT_DATE);

    if (recentTime != null) {
      String firstTimeMillis = recentTime.getStringValue();
      return Double.valueOf(firstTimeMillis);
View Full Code Here

  }

  @Override
  public void cleanupOnDelete(ICourse course) {
    super.cleanupOnDelete(course);
    CoursePropertyManager cpm = PersistingCoursePropertyManager.getInstance(course);
    cpm.deleteNodeProperties(this, CONF_CANCEL_ENROLL_ENABLED);
    DENManager denManager = DENManager.getInstance();
    //empty List as first argument, so all dates for this course node are going to delete
    denManager.persistDENSettings(new ArrayList(), course, this);
  }
View Full Code Here

    // While this is not explicitly so, implicitly it is: currently the only user this method is
    // the AssessmentEditController - which as the 2nd last method calls into saveScoreEvaluation
    // - which in turn does update the EfficiencyStatement - at which point we're happy and everything works fine.
    // But it seems like this mechanism is a bit unobvious and might well be worth some refactoring...
    ICourse course = CourseFactory.loadCourse(ores);
    final CoursePropertyManager cpm = course.getCourseEnvironment().getCoursePropertyManager();
    CoordinatorManager.getCoordinator().getSyncer().doInSync(createOLATResourceableForLocking(assessedIdentity), new SyncerExecutor(){
      public void execute() {
        Property attemptsProperty = cpm.findCourseNodeProperty(courseNode, assessedIdentity, null, ATTEMPTS);
        if (attemptsProperty == null) {
          attemptsProperty = cpm.createCourseNodePropertyInstance(courseNode, assessedIdentity, null, ATTEMPTS,
              null, new Long(attempts.intValue()), null, null);
          cpm.saveProperty(attemptsProperty);
        } else {
          attemptsProperty.setLongValue(new Long(attempts.intValue()));
          cpm.updateProperty(attemptsProperty);
        }
        // add to cache
        putPropertyIntoCache(assessedIdentity, attemptsProperty);
      }
    });
View Full Code Here

   *      org.olat.core.id.Identity, org.olat.core.id.Identity,
   *      java.lang.String)
   */
  public void saveNodeComment(final CourseNode courseNode, final Identity identity, final Identity assessedIdentity, final String comment) {
    ICourse course = CourseFactory.loadCourse(ores);
    final CoursePropertyManager cpm = course.getCourseEnvironment().getCoursePropertyManager();
    CoordinatorManager.getCoordinator().getSyncer().doInSync(createOLATResourceableForLocking(assessedIdentity), new SyncerExecutor(){
      public void execute() {
        Property commentProperty = cpm.findCourseNodeProperty(courseNode, assessedIdentity, null, COMMENT);
        if (commentProperty == null) {
          commentProperty = cpm.createCourseNodePropertyInstance(courseNode, assessedIdentity, null, COMMENT, null, null, null, comment);
          cpm.saveProperty(commentProperty);
        } else {
          commentProperty.setTextValue(comment);
          cpm.updateProperty(commentProperty);
        }
        // add to cache
        putPropertyIntoCache(assessedIdentity, commentProperty);
      }
    });
View Full Code Here

   * @see org.olat.course.assessment.AssessmentManager#saveNodeCoachComment(org.olat.course.nodes.CourseNode,
   *      org.olat.core.id.Identity, java.lang.String)
   */
  public void saveNodeCoachComment(final CourseNode courseNode, final Identity assessedIdentity, final String comment) {
    ICourse course = CourseFactory.loadCourse(ores);
    final CoursePropertyManager cpm = course.getCourseEnvironment().getCoursePropertyManager();
    CoordinatorManager.getCoordinator().getSyncer().doInSync(createOLATResourceableForLocking(assessedIdentity), new SyncerExecutor(){
      public void execute() {
        Property commentProperty = cpm.findCourseNodeProperty(courseNode, assessedIdentity, null, COACH_COMMENT);
        if (commentProperty == null) {
          commentProperty = cpm.createCourseNodePropertyInstance(courseNode, assessedIdentity, null, COACH_COMMENT, null, null, null, comment);
          cpm.saveProperty(commentProperty);
        } else {
          commentProperty.setTextValue(comment);
          cpm.updateProperty(commentProperty);
        }
        // add to cache
        putPropertyIntoCache(assessedIdentity, commentProperty);
      }
    });
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

TOP

Related Classes of org.olat.course.properties.CoursePropertyManager

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.