Examples of SectionStatus


Examples of org.cast.isi.data.SectionStatus

  /* (non-Javadoc)
   * @see org.cast.isi.service.ISectionService#sectionReviewable(org.cast.cwm.data.User, org.cast.isi.ISIXmlSection)
   */
  public boolean sectionReviewable (User person, ISIXmlSection xs) {
    SectionStatus stat = getSectionStatus(person, xs);
    // teacher can only review if the sectionstatus exists, the student has completed
    // and there are no outstanding feedback messages for this section
    if (stat == null || stat.getCompleted() == null || stat.getCompleted() == false
        || stat.getUnreadTeacherMessages() > 0) {
      return false;
    }
    return true;
  }
View Full Code Here

Examples of org.cast.isi.data.SectionStatus

   */
  public SectionStatus setReviewed (User person, ContentLoc loc, boolean reviewed) {
    ISIXmlSection sec = loc.getSection().getSectionAncestor();
    if (sec == null)
      return null;
    SectionStatus stat = getSectionStatus(person, sec);
    if (stat == null || !stat.getCompleted()) {
      throw new IllegalStateException("Should not be able to adjust a review on an uncomplete or non-existant section status");
    } else {
      stat.setReviewed(reviewed);
    }
    cwmService.flushChanges();
    eventService.saveEvent("section:" + (reviewed ? "reviewed" : "not reviewed"), null, loc.getLocation());
    return stat;
  }
View Full Code Here

Examples of org.cast.isi.data.SectionStatus

   */
  public SectionStatus toggleReviewed (User person, ContentLoc loc) {
    ISIXmlSection sec = loc.getSection().getSectionAncestor();
    if (sec == null)
      return null;
    SectionStatus stat = getSectionStatus(person, sec);
    if (stat == null || !stat.getCompleted()) {
      throw new IllegalStateException("Should not be able to adjust a review on an uncomplete or non-existant section status");
    } else {
      boolean reviewed = stat.getReviewed();
      stat.setReviewed(!reviewed);
    }
    cwmService.flushChanges();
    eventService.saveEvent("section:" + (stat.getReviewed() ? "reviewed" : "not reviewed"), null, loc.getLocation());
    return stat;
  }
View Full Code Here

Examples of org.cast.isi.data.SectionStatus

  public SectionStatus setLocked(User person, ContentLoc loc, boolean locked) {
    ISIXmlSection sec = loc.getSection().getSectionAncestor();
    if (sec == null)
      return null;
    SectionStatus stat = getSectionStatus(person, sec);
    if (stat == null || !stat.getCompleted()) {
      throw new IllegalStateException("Should not be able to adjust a lock on an uncomplete or non-existant section status");
    } else {
      stat.setLocked(locked);
    }
    cwmService.flushChanges();
    return stat;
  }
View Full Code Here

Examples of org.cast.isi.data.SectionStatus

        this.targetUserModel = targetUserModel;
      }

      @Override
      public Component getIconFor(ISIXmlSection section) {
        SectionStatus stat = sectionService.getSectionStatus(targetUserModel.getObject(), section);
        return ISIApplication.get().studentStatusIconFor(section, stat);         
      }
View Full Code Here

Examples of org.cast.isi.data.SectionStatus

        this.targetUserModel = targetUserModel;
      }

      @Override
      public Component getIconFor(ISIXmlSection section) {
        SectionStatus stat = sectionService.getSectionStatus(targetUserModel.getObject(), section);
        return ISIApplication.get().teacherStatusIconFor(section, stat);         
      }
View Full Code Here

Examples of org.cast.isi.data.SectionStatus

    User user = targetUserModel.getObject();
    return !(prompt.isDelayFeedback() && needsReview(prompt, user));
  }
 
  private boolean needsReview(ISIPrompt prompt, User user) {
    SectionStatus sectionStatus = sectionService.getSectionStatus(user, prompt.getSection());
    return (sectionStatus == null) || !sectionStatus.getReviewed();
  }
View Full Code Here

Examples of org.cast.isi.data.SectionStatus

    when(sectionXmlSection.getContentLoc()).thenReturn(sectionContentLoc);
    sectionSectionXmlModel = new Model(sectionXmlSection);

    when(pageXmlSection.getSectionAncestor()).thenReturn(sectionXmlSection);
   
    sectionStatus = new SectionStatus();
    sectionStatus.setCompleted(false);
    sectionStatus.setReviewed(false);
    sectionStatus.setLocked(false);
    setupInjectedServices();
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.